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
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
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
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
Last updated