👀 Provides easy access to api novaposhta. API has 6 controllers which is got from Official Documentation. Also each of controller has own methods that are listed below.
Installing by npm
npm install api-novaposhta
Installing by yarn
yarn add api-novaposhta
- 📦 Internet Document - methods for receiving information about waybills.
- 🏡 Address - it's help you work with addresses of counterparty, cities or streets where has novaposhta.
- 🥸 Counterparty - easy way to control counterparty in account.
- 🛠 Common - ways to receive common data for options to other methods.
- ⚙️ Service - services as redelivery, backward or change information in account.
- 🗃 Registry - better way to working with internet document in registry.
🔒 Designation that you need an api key for a method or controller
-
Internet Document 🔒
- getListDocument - get list of internet document in account
- getParcelDeliveryDate - get forecast about delivery date
- getParcelPrice - get parcel price from entered params
- createDocument - create a internet document
- deleteDocument - delete internet document
- generateReport - generate report of all internet documents
- updateDocument - update information in internet document
- getStatusDocuments - get status of internet document(s)
- getTrackingInfo - get tracking information about internet document
- getTrackingHistory - get tracking history where the parcel passed
-
Address
- 🔒 getSettlements - get settlements where has novaposhta
- 🔒 getAreas - get areas by params in Ukraine
- 🔒 getCities - same as getAreas but for cities
- searchCity - search city with branch by params in request
- 🔒searchStreet - same as searchCity but for street
- 🔒 getWarehouses - get branches in Ukraine or by params in request
- 🔒 getWarehouseStreet - get branches in Ukraine by name street
- 🔒 deleteContractorAddress - delete counterparty address
- 🔒 createContractorAddress - create counterparty address
- 🔒 updateContractorAddress - update existed counterparty address
-
Counterparty 🔒
- getCounterpartyAddresses - get counterparty addresses in account
- getCounterpartyOptions - get options for create internet document with additional service
- getCounterpartyContactPerson - get contacts of counterparty in account
- getCounterparties - get list of counterparties
- updateContactPerson - update contacts of counterparty
- updateCounterparty - update information about counterparty
- createContactPerson - create contact for counterparty
- createCounterparty - create counterparty
- createLegalCounterparty - create counterparty for legal entity
- createThirdPersonCounterparty - create counterparty for third person
- deleteContactPerson - delete contact for counterparty
- deleteCounterparty - delete counterparty
-
Common
- getTimeIntervals - get time intervals for service time intervals in internet document
- 🔒 getCargoTypes - get types of cargo for create internet document
- 🔒 getBackwardDeliveryCargoTypes - same as getCargoTypes but for service backward delivery
- 🔒 getPalletsList - get list of pallets
- 🔒 getPayersType - get types of payers who could pay
- 🔒 getRedeliveryPayersType - same as getPayersType but for service redelivery
- getPackList - get list of packs for create internet document
- 🔒 getTiresWheelsList - get dimensions and other info about wheels
- 🔒 getCargoDescriptionList - get details about cargo type
- 🔒 getMessageCodeText - get descriptions of codes from request
- 🔒 getServiceTypes - get types of service
- 🔒 getTypesOfCounterparties - get types of counterparties
- 🔒 getPaymentForms - get types of payments
- 🔒 getOwnershipFormsList - get list of ownership
-
Service 🔒
- canCreateRequest - check possibility using one of services
- createServiceRequest - create request to one of services
- deleteServiceRequest - delete request one of services
- getListServiceRequests - get list of services which is api provide
-
Registry 🔒
- addDocumentToRegistry - add internet document to registry
- getRegistryInfo - get all information about registry in account
- getListRegistryInfo - same as getRegistryInfo but returns list
- deleteRegistry - delete registry in account
- deleteDocumentFromRegistry - delete internet document from registry
{
"apiKey": "<YOUR_API_KEY>",
"apiUrl": "<YOUR_API_URL>",
"formatResponse": "json or xml"
}
All controllers are accepted base api options. Example below is shown using for address api and get areas method in two variants.
In this variant you can import and use each of one controllers as individual class with own methods.
const api = new ApiAddress({
apiKey: '<API_KEY>',
});
await api.getAreas();
But in this variant you don't need to import extra controllers, you only need a main controller and using method get with param as api controller class and after all, access to methods will be allowed.
const api = new NovaPoshta({
apiKey: '<API_KEY>',
});
await api.get(ApiAddress).getAreas();
Some methods in api has options, in that nothing too hard, all options have types declared for better understanding and avoid mistake for using methods.
const api = new ApiAddress({
apiKey: '<API_KEY>',
});
await api.getAreas();
const api = new NovaPoshta({
apiKey: '<API_KEY>',
});
await api.get(ApiAddress).getCities({
FindByString: 'Kiev',
});