Feed your checkout's delivery pickers from Nova Poshta: cities and warehouses
in Ukraine, and cities and warehouses abroad. The plugin adds four Shop API queries, picks the warehouse
types customers may choose per country, and keeps Nova Poshta's country refs on your Country entities.
Every query is a live request to Nova Poshta: nothing is cached or stored besides the country refs. The
client is built on the global fetch, so the plugin has no runtime dependencies besides graphql-tag.
Compatible with Vendure ^3.7.0.
Install · Usage · Options · Database · Shop API · Delivering abroad · Admin API · API key per request · Calling other methods · Errors · Limitations
Get the key in your Nova Poshta business account: Settings → Security → API key.
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | NovaPoshtaApiKeyStrategy | — | The key, or a strategy that resolves it per request: see API key per request. |
apiUrl | string | 'https://api.novaposhta.ua/v2.0/json/' | Nova Poshta's JSON endpoint. |
timeout | number | 10000 | Milliseconds before a request is aborted. |
countrySync | { schedule?: ScheduledTaskConfig['schedule'] } | false | { schedule: '0 7 * * *' } | The daily task that syncs country refs. Needs a scheduler plugin. false leaves the task out; the mutation stays. |
The plugin adds two Region custom fields and no tables. Generate a migration after installing it:
| Custom field | Type | Public | Written by |
|---|---|---|---|
novaPoshtaCountryRef | string, nullable, read-only | yes | the country sync |
novaPoshtaWarehouseCategories | string list, one of four options | no | an admin |
Custom fields on Region apply to provinces too; the plugin reads them on countries only.
The queries are public, like the rest of checkout. cityId is the Ref of a city from novaPoshtaCities.
Typographic apostrophes in term (Кам’янське) are replaced with the plain one Nova Poshta matches.
A typical domestic picker:
then novaPoshtaWarehouses(input: { cityId: "<Ref>", term: "5" }) as the customer types the branch.
Nova Poshta identifies a country by its own Ref, not by ISO code. The country sync reads
International.getCountries and writes that ref into customFields.novaPoshtaCountryRef of every Vendure
country whose ISO code matches. Clients read it from availableCountries and pass it as country:
Countries without a ref are the ones Nova Poshta does not deliver to.
On the country page in the dashboard, Nova Poshta: warehouse types chooses which types
novaPoshtaInternationalWarehouses returns there. Empty means all of them.
| Value | Meaning |
|---|---|
PostBranch | Nova Post's own post branches |
CargoBranch | Nova Post's cargo branches and fulfilment |
PUDO | Partner pick-up points |
Poshtomat | Parcel lockers |
These are the values of the WarehouseCategory filter of International.getWarehouses. The filter takes one
value per request and the response does not say a warehouse's type, so each selected type is a request of its
own, run in parallel; the results are merged in the order the types are stored and capped at limit.
Runs the country sync now. Requires UpdateCountry. Run it once after installing the plugin, or wait for
the daily task.
To keep the key in the database or use a key per channel, pass a strategy instead of a string. The plugin
calls its init(injector) on bootstrap and destroy() on shutdown.
NovaPoshtaClient is exported and calls any method of the Nova Poshta API with the resolved key: creating a
waybill, tracking a parcel.
NovaPoshtaService is exported as well, for the lookups above.
Every failure throws a NovaPoshtaError:
status;success: false, with Nova Poshta's errors and errorCodes.In the Shop API it surfaces as a GraphQL error.
updateCountry in the Admin API.See CHANGELOG.md.
MIT
Nova Poshta and Vendure are trademarks of their respective owners. This is an independent plugin, not affiliated with or endorsed by either.
c7d7775 Thanks @brmk! - Install alongside Vendure 3.8: the @nestjs/common and @nestjs/core peers now accept ^11 || ^12, and @nestjs/graphql accepts ^13 || ^14. Vendure 3.8 moved to NestJS 12, so npm install failed with ERESOLVE against the old ^11 / ^13 ranges. Nothing changes on Vendure 3.7.0e7568c Thanks @brmk! - The warehouse types on the country page are a multi-select of the four Nova Poshta types, not a free-text tag input that ignores them.