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_name": "Mrs. Hippo",
    "origin_phone": "+2348170441446",
    "origin_street": "Clayton St.",
    "origin_city": "Ikorodu",
    "origin_country": "NIGERIA",
    "origin_country_code": "NG",  -------->(optional)
    "origin_state": "Lagos",
    "origin_state_code": "LOS", ------------>(optional)
    "origin_post_code":"10100",
    "destination_name": "Brian",
    "destination_phone": "+2348170441446",
    "destination_street": "Drydock Ave Suite 610",
    "destination_city": "Ikeja",
    "destination_country": "NIGERIA",
    "destination_country_code": "NG", ---------->(optional)
    "destination_state": "Lagos",
    "destination_state_code": "LOS", ---------->(optional)
    "$destination_post_code":"1001",
    "weight": "0.5",
    "items": [
        {
            "name": "Test Brian Iyoha",
            "quantity": "1",
            "weight": "1",
            "amount": "100",
            "value": "120000"
    
    }
    ],
    "selected_courier_id": "rate_key_cb2d48e5eb1fddbe8815b154812f675f",
    "channel_code": "api"
    "insurance_option":"standard"
}

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_country

String

senders country

origin_state

String

senders state

origin_street

String

senders street

origin_city

String

senders city

origin_email

String

senders email address

origin_phone

String

senders phone number

destination_country

String

recipient country

destination_state

String

recipient state

destination_city

String

recipient city

destination_street

String

recipient street

destination_email

String

recipient email address

destination_phone

String

recipient phone number

weight

Float

weight of package

selected_courier_id

Float

selected courier id.

items

Array

array of objects including name, weight, item_type_code, package_size_code and quantity

incoming_option_code

String

set to either pickup or dropoff

payment_option_code

String

set this to "prepaid"

channel_code

String

set this to "api"

pickup_date

Date

date in ISO format

deliver_priority_code

String

set this to "next_day"

callback_url

String

a webhook url to get the tracking update.

insurance_option

String

this can be either standard or extended.

Payload Explained

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

Selected_courier_id

This should be gotten based on the value of courier_id selected when shipping quotes endpoint is called.

channel_code

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

Items

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

"items": [
		{
			"name": "Laptop",
			"item_type_code": "other",
			"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.

Book a shipment without fetching quotes first.

You can create a shipment without fetching quotes by passing "rate_code":"standard" in the create shipment payload.

Fund your staging account

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

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

{
   "amount" : 100000
}

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/dispatch/staging/move_tracking

{
  code: <tracking_code>
}

Last updated