nshift-api-sdk v1.0.0
nShift API SDK
Description: SDK for nShift REST APIs
Table of Contents
Use Case
All js based front-end or back-ends can benefit from using a general SDK when developing nshift integrations.
Installation
npm install nshift-api-sdk
Setting Up Environment Variables
Before running the nShift SDK in your Node.js application, you need to set up the following environment variables in a .env
file. This file should be placed in the root directory of your project. If the file does not exist, you can create one.
deliveryCheckoutId=yourDeliveryCheckoutId
publicKey=yourPublicKey
privateKey=yourPrivateKey
API Reference & Package Functions
udcPlugin
Description: This function returns the JavaScript library, which should be included in the checkout page.
udcPluginConfig
Description: This function returns the default plugin config required for initiating the plugin.
getDeliveryCheckouts
Description: Fetches a delivery checkout configuration. For more information, refer to the Unifaun API documentation.
postDeliveryCheckouts
Description: Creates a prepared shipment from the delivery checkout configuration and the shipment object. Refer to the nShift Help Center for details.
getPreparedShipment
Description: Retrieves a prepared shipment using the prepareId. Refer to the nShift Help Center for more information.
deletePreparedShipment
Description: Deletes a prepared shipment using the prepareId.
createShipmentFromPrepared
Description: Creates a shipment from a prepared shipment.
Reference
Reference
License
This SDK is licensed under the ISC License.
1 year ago