Create New Shipment

Creating a new shipment requires you making a post request to the shipment endpoint ensure to pass the required header parameters and body parameters to get the appropriate response

Sample Payload to request shipment

{
        "origin" : {
            "first_name" : "Will",
            "last_name" : "Smith",
            "street" : "10 Olasheun Crescent",
            "street_line_2" : "HQ",
            "state" : "Lagos",
            "email" : null,
            "city" : "Obanikoro",
            "country" : "NG",
            "post_code" : "102216",
            "phone" : "+234 800 666 0419",
            "lng" : 3.37,
            "lat" : 6.56,
            "name" : null
        },
    "destination": {
        "first_name": "Joe",
        "last_name": "Goldberg",
        "post_code": "94612",
        "phone": "+1 267 000 0",
        "lng": -122.27,
        "lat": 37.81,
        "name": null,
        "street": "31 Hall Crescent",
        "street_line_2": "",
        "state": "paris",
        "email": "",
        "city": "paris",
        "country": "FR"
    },
    "weight" : 2,
        "dimension" : {
            "length" : 1,
            "width" : 1,
            "height" : 1
        },
        "incoming_option" : "pickup",
        "region" : "NG",
        "service_type" : "international",
        "package_type" : "general",
        "total_value" : 15000,
        "currency" : "NGN",
        "channel_code" : "api",
        "pickup_date" : "2023-07-20",
        "items" : [
            {
                "item_type" : "snail",
                "hts_code":"9000.10",
                "quantity" : 2,
                "name" : "African Wax Fabrics - Orange Lace Fabric that is Not Woven",
                "value" : 1500
            }
        ],
        "service_code": "standard",
        "customs_option": "recipient",
        "callback_url":"https://your_callback_url/"
        
}

Staging URL: https://sandbox.staging.sendbox.co/shipping/shipments

Create New Shipment

https://live.sendbox.co/shipping/shipments

This creates a new shipment

Headers

Name

Type

Description

Authorization

String

Authorization-key

Content-type

String

application/json

Body Parameters

Name

Type

Description

origin

Object

senders details

destination

Object

recipient details

weight

Float

weight of package

items

Array

An array of objects that contain:

- name [String]

- weight [Float]

- item_type_code [String optional]

- hts_code [String optional]

- description [String]

- quantity [Integer]

- value [Float]

incoming_option

String

set to either pickup or dropoff

pickup_date

Date

date in ISO format

total_value

Float

value of shipment

package_type

String

package type

channel_code

String

channel the request is being made from; in this case set it to api

service_code

String

can be set to either international, nation-wide, and local.

region

String

region the shipment is being shipped from.

custom_options

String

custom options

callback_url

String

a webhook url to get the tracking update.

hts_code

String

pass in the item code to match it's description.

Payload Explained

While some of the payloads are self explained, lets go over some of them that seem a bit confusing.

channel_code

This tells us where the request came from this case it's form the api.

Items

This is an array of objects. It includes the name of what you are shipping, weight, item_type_code, package_size_code, a value which is the total price of the item(s) you are shipping, and quantity of your shipment. An example of an items payload will look like this

"items": [
		{
			"name": "Laptop",
			"item_type_code": "other",
			"hts_code": "9001.10",
			"package_size_code": "medium",
			"quantity": 2,
			"weight": 3,
			"value":120000
		}
	]

Callback_url

This should be a webhook url which you will pass with your other request shipment payloads. Sendbox will post tracking updates to this url from pending, processing and completed.

Fund your staging account

To stimulate a successful request on your staging account you have to fund your staging account by making a post to add_money endpoint

{
  "amount": 10000
}

Check your staging account balance

You can simply do this by doing a get to the staging payment profile

https://sandbox.staging.sendbox.co/payments/profile

Stimulate webhooks events

You can stimulate webhook events for tracking status on staging by sending tracking code to move_tracking endpoint

https://sandbox.staging.sendbox.co/shipping/move_tracking

{
  code: <tracking_code>
}

Last updated