Novaposhta
A small library that provides a helper class to work with Nova Poshta API.
Usage
Install it using the following command:
npm i novaposhta
The library exports the NovaPoshta
class that you need to use to make requests to API. You need to instantiate an instance of the class providing an object with configuration options. The instance of the class has getters that allows you to get access to a specific model of the APIs.
Also, please, pay attention that some API methods require API key for authorization. You can obtain it by going to this page.
Here is a basic example that shows how to use the library:
; const api = apiKey: '...' ; apiaddress ;
A bit more advanced example that demonstrates how you can configure a Winston Logger and use it with the library:
;;; const winstonLogger = level: "debug" ;winstonLogger; const api = apiKey: '...' logger: winstonLogger; apiaddress;
Supported API Methods
Address
const api = apiKey: '...' ; apiaddress;
- searchSettlements
- searchSettlementStreets
- update
- save
- getAreas
- getCities
- getSettlements
- getWarehouses
- getWarehouseTypes
- getStreet
- delete
Common
const api = apiKey: '...' ; apicommon;
- getTimeIntervals
- getCargoTypes
- getBackwardDeliveryCargoTypes
- getPalletsList
- getTypesOfPayers
- getTypesOfPayersForRedelivery
- getPackList
- getTiresWheelsList
- getCargoDescriptionList
- getMessageCodeText
- getServiceTypes
- getTypesOfCounterparties
- getPaymentForms
- getOwnershipFormsList
Counterparty
const api = apiKey: '...' ; apicounterparty;
- getCounterpartyAddresses
- getCounterpartyOptions
- getCounterpartyContactPersons
- getCounterparties
- save
- update
- delete
ContactPerson
const api = apiKey: '...' ; apicontactPerson;
Internet Document
const api = apiKey: '...' ; apiinternetDocument;
- getDocumentList
- getDocumentDeliveryDate
- getDocumentPrice
- getStatusDocuments
- save
- update
- delete
- generateReport
ScanSheet
const api = apiKey: '...' ; apiscanSheet;
AdditionalService
const api = apiKey: '...' ; apiadditionalService;
- delete
- getChangeEWOrdersList
- getRedirectionOrdersList
- getReturnOrdersList
- getReturnReasons
- getReturnReasonsSubtypes
- CheckPossibilityChangeEW
- CheckPossibilityCreateReturn
- save
AdditionalServiceGeneral
const api = apiKey: '...' ; apiadditionalServiceGeneral;
Contribute
Want to help or have a suggestion? Open a new ticket and we can discuss it or submit a pull request. Please, make sure you run npm test
before submitting a pull request.
License
MIT