NBOX Now API Documentation

Introduction

The NBOX Now API is designed to seamlessly integrate your e-commerce website with the NBOX Now system, enabling automated shipping rate calculations and order management. Upon integration, users will be able to:

  • Retrieve real-time shipping rates from NBOX Now based on product dimensions and shipping destinations.
  • Push store information and orders to NBOX Now for streamlined fulfillment and shipping services.

By leveraging this API, merchants can optimize their shipping workflow, reduce manual processing, and ensure efficient order handling.

Base URLs

Use the appropriate base URL depending on your environment:

  • Live (Production): https://nbox.now/api
  • Staging (Testing): https://staging.nbox.now/api

Below is a list of the APIs you will use for integrating with NBOX Now. These endpoints allow you to authenticate, manage locations, retrieve shipping rates, and handle orders within the system.

Login API

Log in to the system by calling the authentication endpoint:

A token is returned upon successful authentication and should be used for further API requests.

Method: POST

Endpoint: POST https://{base_url}/login

Request

The following parameters should be included in the request body:

NameTypeRequiredDescription
emailStringRequiredUser's email address (e.g., juan.delacruz@email.com)
passwordStringRequiredUser's password (e.g., *******)
shopIdStringRequiredShop's unique identifier (domain) (e.g., nbox.now)
shopNameStringRequiredShop's name (e.g., Nbox Store)
platformStringRequiredE-commerce platform (e.g., WooCommerce, Shopify, Magento, custom) (e.g., woocommerce)
urlStringRequiredShop's URL (e.g., https://store.nbox.now)
locationsArray of ObjectsOptional

optional field and can include shop fulfillment locations.

Shop locations (e.g., address: 143 Missing Street, Unknown area, city: Al Rayyan, state: Qatar, countryCode: QA, zip: 0000, country: Qatar)

Response

StatusDescription
200 OKActivation successful or failed based on the provided parameters
400 Bad RequestMissing or invalid parameters
401 UnauthorizedInvalid token and/or shop domain
500 Internal Server ErrorServer-side error during activation process

Locations API

To manage locations in the NBOX Now system, you can use the following endpoints. Both endpoints accept the same request body containing an array of location objects.

Make sure to include both the token and the shop domain in the request headers. The API will validate these to ensure the request is coming from an authorized shop. The locations can be provided in a single object or an array of location objects, depending on the platform. The lat and lng fields are optional but can be included if the geographic coordinates of the location are known.

Method: POST

Endpoint:

  • POST https://{base_url}/locations/add - Add new locations.
  • POST https://{base_url}/locations/update - Update existing locations.

Headers

NameDescription
x-nbox-shop-tokenThe token retrieved from the login API. This token authenticates the user.
x-nbox-shop-domainThe domain of the e-commerce website (e.g., nbox.now) associated with the shop.

Request

NameTypeRequiredDescription (with Example)
refIdStringRequiredA unique reference ID for the location (e.g., "loc123")
refNameStringRequiredA unique reference name for displaying the location (e.g., "Main Warehouse")
addressStringRequiredThe street address of the location (e.g., "123 Main St")
cityStringRequiredThe city of the location (e.g., "New York")
stateStringRequiredThe state or province of the location (e.g., "New York")
countryCodeStringRequiredThe two-letter country code (e.g., "US")
countryStringOptionalThe name of the country (e.g., "United States")
zipStringRequiredThe ZIP or postal code of the location (e.g., "10001")
longitudeNumberOptionalThe longitude of the location (e.g., "-73.935242")
latitudeNumberOptionalThe latitude of the location (e.g., "40.730610")

Response

StatusDescription
200 OKActivation successful or failed based on the provided parameters
400 Bad RequestMissing or invalid parameters
401 UnauthorizedInvalid token and/or shop domain
500 Internal Server ErrorServer-side error during activation process

Activation API

Method: POST

Endpoint: POST https://{base_url}/activation

Headers

NameDescription
x-nbox-shop-tokenThe token retrieved from the login API. This token authenticates the user.
x-nbox-shop-domainThe domain of the e-commerce website (e.g., nbox.now) associated with the shop.

Request

NameTypeRequiredDescription (with Example)
activateBooleanRequiredWhether to activate the shop (true or false) (e.g., true)
locationsArrayOptionalAn array of location objects to be activated (e.g., [{"refId": "loc123", "refName": "Main Warehouse", "address": "123 Main St", "city": "New York", "state": "NY", "zip": "10001", "countryCode": "US", "country": "United States"}])

Response

StatusDescription
200 OKActivation successful or failed based on the provided parameters
400 Bad RequestMissing or invalid parameters
401 UnauthorizedInvalid token and/or shop domain
500 Internal Server ErrorServer-side error during activation process

Rates API

Method: POST

Endpoint: POST https://{base_url}/rates

Headers

NameDescription
x-nbox-shop-tokenThe token retrieved from the login API. This token authenticates the user.
x-nbox-shop-domainThe domain of the e-commerce website (e.g., nbox.now) associated with the shop.

Description

This API calculates shipping rates based on product details, origin, and destination. The system intelligently computes dimensions and weight from individual products for accurate rate calculation. Legacy weight/volume parameters are supported for backward compatibility.

Request

Recommended: Use the products array for accurate dimensional weight calculations. The system will compute total weight and volume from individual product specifications.

Main Request Structure
NameTypeRequiredDescription
productsArrayRecommendedList of products with dimensions and weight for accurate calculation
volumeNumberLegacy(Legacy) The volume of the package in cubic units (e.g., 1.5)
weightNumberLegacy(Legacy) The weight of the package in kilograms (e.g., 2.5)
originObjectRequiredThe origin location object (see Origin and Destination Objects below)
destinationObjectRequiredThe destination location object (see Origin and Destination Objects below)
typeStringOptionalThe type of shipping (e.g., "non_document", "document", etc. Default is "non_document")
Product Object (Recommended)
NameTypeRequiredDescription
nameStringRequiredName of the product
quantityNumberRequiredQuantity of the product
priceNumberRequiredPrice per unit of the product
gramsNumberRequiredWeight of the product in grams
lengthNumberRequiredLength of the product in cm
widthNumberRequiredWidth of the product in cm
heightNumberRequiredHeight of the product in cm
volumeNumberRequiredVolume of the product in cubic centimeters (cm³)
currencyStringRequiredCurrency for the product's price
Origin and Destination Objects
NameTypeRequiredDescription
addressStringRequiredFull address, including address lines and any supplementary address info
cityStringRequiredCity
stateStringOptionalState or province (accepts null for regions without states)
countryCodeStringRequiredCountry code (e.g., "US", "QA")
countryStringOptionalCountry Name (e.g., "United States", "Qatar")
zipStringRequiredPostal code/Zip code
longitudeNumberOptionalLongitude of the address (supports both longitude and lng formats)
latitudeNumberOptionalLatitude of the address (supports both latitude and lat formats)

Response

StatusDescription
200 OKActivation successful or failed based on the provided parameters
400 Bad RequestMissing or invalid parameters
401 UnauthorizedInvalid token and/or shop domain
500 Internal Server ErrorServer-side error during activation process
Response Body

The response body will contain an array of rate objects, with the following structure:

NameTypeDescription (with Example)
idStringA unique identifier for the rate (e.g., "f9d17f56-7eeb-44ad-bc7e-b95f61d5d2ed")
logoStringURL of the service provider's logo (e.g., "/images/nbox-logistics.png")
pickup_dropoff_methodStringThe method of pickup and delivery (e.g., "Door to Door")
service_nameStringThe name of the shipping service (e.g., "NBOX Express Local Delivery")
service_codeStringThe code for the shipping service (e.g., "NBOX")
total_priceNumberThe total price for the service in the specified currency (e.g., 20.00)
descriptionStringA description of the service, such as delivery time (e.g., "Estimate Time of Delivery: 3 hours")
currencyStringThe currency of the total price (e.g., "QAR")

Order API

Method: POST

Endpoint: POST https://{base_url}/order

Description

This API is called during the checkout process on the eCommerce site. It pushes the order details from the eCommerce store to the NBOX Now system for processing. The system will handle tasks like calculating the shipping cost, updating the order status, and generating email notifications for the operations team and the user.

Headers

NameDescription
x-nbox-shop-tokenThe token retrieved from the login API. This token authenticates the user.
x-nbox-shop-domainThe domain of the e-commerce website (e.g., nbox.now) associated with the shop.

Request

The request body should contain the details of the order, including carrier, customer details, destination, and product information. Below is the structure of the request data:

Main Object Structure
NameTypeRequiredDescription
orderObjectRequiredOrder details including carrier, order number, subtotal, and shipping fee.
customerObjectRequiredCustomer information, including name, email, and phone.
originObjectRequiredOrigin address of the eCommerce store (shop). Includes address, city, state, and zip code.
destinationObjectRequiredShipping destination details, including the recipient's address, city, state, and zip code.
productsArrayRequiredList of products in the order with attributes such as name, price, quantity, weight, dimensions, and volume.
Order Object
NameTypeRequiredDescription
shopDomainStringRequiredThe domain of the eCommerce store
carrierStringRequiredThe shipping carrier for the order
subTotalNumberRequiredSubtotal amount of the order
orderNumberNumberRequiredThe unique order number
orderReferenceStringRequiredReference number for the order
totalNumberRequiredTotal amount of the order
currencyStringRequiredThe currency of the order
shippingFeeNumberRequiredThe shipping fee for the order
Customer Object
NameTypeRequiredDescription
firstNameStringRequiredCustomer's first name
lastNameStringRequiredCustomer's last name
emailStringRequiredCustomer's email address
phoneStringOptionalCustomer's phone number
Origin and Destination Objects
NameTypeRequiredDescription
addressStringRequiredFull address, including address lines and any supplementary address info
cityStringRequiredCity
stateStringOptionalState or province (accepts null for regions without states)
countryCodeStringRequiredCountry code (e.g., "US", "QA")
countryStringOptionalCountry Name (e.g., "United States", "Qatar")
zipStringRequiredPostal code/Zip code
longitudeNumberOptionalLongitude of the address (supports both longitude and lng formats)
latitudeNumberOptionalLatitude of the address (supports both latitude and lat formats)
Product Object
NameTypeRequiredDescription
nameStringRequiredName of the product
quantityNumberRequiredQuantity of the product
priceNumberRequiredPrice per unit of the product
gramsNumberRequiredWeight of the product in grams
lengthNumberRequiredLength of the product in cm
widthNumberRequiredWidth of the product in cm
heightNumberRequiredHeight of the product in cm
volumeNumberRequiredVolume of the product in cubic centimeters (cm³)
currencyStringRequiredCurrency for the product's price

Response

StatusDescription
200 OKActivation successful or failed based on the provided parameters
400 Bad RequestMissing or invalid parameters
401 UnauthorizedInvalid token and/or shop domain
500 Internal Server ErrorServer-side error during activation process
Response Body

The response body will contain the following fields:

NameTypeDescription
messageStringStatus message indicating success or failure
orderIdStringUnique order ID
errorDetailsStringAny error details if the order was not processed successfully

Fulfilled API

Method: POST

Endpoint: POST https://{base_url}/fulfilled

Description

This API is called when an order has been fulfilled (shipped). It pushes the fulfillment status of the order from the eCommerce store to the NBOX Now system for further processing, such as updating the order status or notifying the customer.

Headers

NameDescription
x-nbox-shop-tokenThe token retrieved from the login API. This token authenticates the user.
x-nbox-shop-domainThe domain of the e-commerce website (e.g., nbox.now) associated with the shop.

Request

The following parameters should be included in the request body:

NameTypeRequiredDescription
orderNumberNumberRequiredThe unique order number

Response

StatusDescription
200 OKActivation successful or failed based on the provided parameters
400 Bad RequestMissing or invalid parameters
401 UnauthorizedInvalid token and/or shop domain
500 Internal Server ErrorServer-side error during activation process
Response Body
NameTypeDescription
messageStringStatus message indicating success or failure
orderIdStringUnique order ID
errorDetailsStringAny error details if the fulfillment was not processed successfully

Cancelled API

Method: POST

Endpoint: POST https://{base_url}/order/cancelled

Description

This API is called when an order has been cancelled. It sends the cancellation status from the eCommerce store to the NBOX Now system for further processing, such as updating the order status and notifying the customer of the cancellation.

Headers

NameDescription
x-nbox-shop-tokenThe token retrieved from the login API. This token authenticates the user.
x-nbox-shop-domainThe domain of the e-commerce website (e.g., nbox.now) associated with the shop.

Request

NameTypeRequiredDescription
orderNumberNumberRequiredThe unique order number

Response

StatusDescription
200 OKActivation successful or failed based on the provided parameters
400 Bad RequestMissing or invalid parameters
401 UnauthorizedInvalid token and/or shop domain
500 Internal Server ErrorServer-side error during activation process