Shiprocket
Welcome to Shiprocket's API Documentation. We've designed this document to help developers and Shiprocket users fully understand and integrate our API for a seamless and easy deployment. These APIs enable you to utilize most of your Shiprocket account's panel features fully.
We've listed all the APIs, their required parameters, and their example requests and responses on the right for easy understanding. The easiest way to start using the Shiprocket APIs is by clicking the Run in Postman button above. The Postman is a free tool that helps developers run and debug API requests.
Our APIs are based around REST architecture and use the basic HTTP request methods. Our APIs accept JSON - encoded body requests and return data in the same form.
Read through the following sections for the integration process.
Getting Started
First, you need to register with ShipRocket and create an account. Click on this link to complete the sign-up process.
After the sign-up process is complete, follow the enlisted steps to create an API user:
- Open your Shiprocket account and navigate to the left-hand panel.
- Click On Settings => API => Configure => Create an API user.
- On the pop-up menu, fill in the email (this should be different from the one used to register to ShipRocket).
- Fill in an appropriate password and confirm the password.
- Click on 'Generate API Credential'. On successful completion, you should have a new API user-generated.
- The next step will be to use the Authentication API to obtain an authentication token. Copy this token and use it to authenticate your further API calls.
Document and API Usage Guidelines
-
Our APIs use the basic HTTP request codes: POST, GET, PATCH, & PUT.
-
You can select the required response and request code language by selecting it from the drop-down menu on the top.
-
You can import and test all our full API collection in the Postman app by clicking on the ' Run in Postman' button.
-
Note: Any requests made using the valid API credentials will affect the real-time data in your Shiprocket account.
-
Authorization: Bearer
-
All the APIs are provided with their appropriate example requests and responses for successful and failed calls. The example definitions are:
- Successful Call: The API call was correct.
- Invalid Data: The data entered was incorrect.
- Missing Fields: Some of the required fields are missing.
- Wrong Format: There is a syntax error in the code.
-
Note: The
order_iddefined by you at the time of order creation is your reference order id. Theorder_idreturned in the API response is the Shiprocket order id. All our APIs will use this Shiprocket order id to access your created order unless stated otherwise.
Errors and Response codes
While using Shiprocket's APIs, you may run into some standard response and error codes. The most common ones are listed along with their descriptions as follows:
| RESPONSE CODE | DESCRIPTION |
|---|---|
200 & 202 - OK & Accepted | Everything worked as expected, and you'll get a response. Some APIs may respond with an error message if data is invalid. |
400 - Bad Request | The request was invalid or cannot be otherwise served. |
401 - Unauthorized | There is some error during validation. You need to check your token or credentials. |
404 - Not Found | The URI requested is invalid or the resource requested does not exist. |
405 - Method Not Allowed | The API was accessed using the wrong method. Check your HTTP method. |
422 - Unprocessable Entity | It means the request contains incorrect syntax or cannot be fulfilled. Try checking your code for errors. |
429 - Too Many Requests | You have exceeded the API call rate limit. |
500, 502, 503, 504 - Server Errors | Some server error has occurred. Some APIs may show this due to syntax or parameter errors. Try contacting support if this persists. |
Webhooks
You can set up a webhook with Shiprocket to get tracking updates. We will proactively notify your system whenever there is a new tracking event for an order.
Setup:
- Log in to your Shiprocket account
- Go to Settings > API > Webhooks
- Add the webhook URL
- Enable the toggle
- Add the security token (not mandatory)
When we get a new tracking event, a POST request is made to the callback URL you added to your Shiprocket account.
Webhook Specifications:
- Method: POST
- The
Content-Typeheader should be set toapplication/json - Please refrain from using keywords like shiprocket, kartrocket, sr, or kr in your webhook URL
- Security token should be an
x-api-key - The URL should be set to send only code 200 in response.
Sample Body:
{
"awb":"19041424751540",
"courier_name":"Delhivery Surface",
"current_status":"IN TRANSIT",
"current_status_id":20,
"shipment_status":"IN TRANSIT",
"shipment_status_id":18,
"current_timestamp":"23 05 2023 11:43:52",
"order_id":"1373900_150876814",
"sr_order_id":348456385,
"awb_assigned_date":"2023-05-19 11:59:16",
"pickup_scheduled_date":"2023-05-19 11:59:17",
"etd":"2023-05-23 15:40:19",
"scans":[
{
"date":"2023-05-19 11:59:16",
"status":"X-UCI",
"activity":"Manifested - Manifest uploaded",
"location":"Chomu_SamodRd_D (Rajasthan)",
"sr-status":"5",
"sr-status-label":"MANIFEST GENERATED"
},
{
"date":"2023-05-19 15:32:17",
"status":"X-PPOM",
"activity":"In Transit - Shipment picked up",
"location":"Chomu_SamodRd_D (Rajasthan)",
"sr-status":"42",
"sr-status-label":"PICKED UP"
},
{
"date":"2023-05-19 16:40:19",
"status":"X-PIOM",
"activity":"In Transit - Shipment Recieved at Origin Center",
"location":"Chomu_SamodRd_D (Rajasthan)",
"sr-status":"6",
"sr-status-label":"SHIPPED"
},
{
"date":"2023-05-19 17:19:14",
"status":"X-DBL1F",
"activity":"In Transit - Added to Bag",
"location":"Chomu_SamodRd_D (Rajasthan)",
"sr-status":"NA",
"sr-status-label":"NA"
},
{
"date":"2023-05-20 10:27:56",
"status":"X-DLL2F",
"activity":"In Transit - Bag Added To Trip",
"location":"Chomu_SamodRd_D (Rajasthan)",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
},
{
"date":"2023-05-20 12:23:44",
"status":"X-ILL2F",
"activity":"In Transit - Trip Arrived",
"location":"Jaipur_Sez_GW (Rajasthan)",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
},
{
"date":"2023-05-20 14:24:50",
"status":"X-ILL1F",
"activity":"In Transit - Bag Received at Facility",
"location":"Jaipur_Sez_GW (Rajasthan)",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
},
{
"date":"2023-05-20 15:23:38",
"status":"X-IBD3F",
"activity":"In Transit - Shipment Received at Facility",
"location":"Jaipur_Sez_GW (Rajasthan)",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
},
{
"date":"2023-05-20 15:23:38",
"status":"X-DWS",
"activity":"In Transit - System weight captured",
"location":"Jaipur_Sez_GW (Rajasthan)",
"sr-status":"NA",
"sr-status-label":"NA"
},
{
"date":"2023-05-20 16:01:22",
"status":"X-DBL1F",
"activity":"In Transit - Added to Bag",
"location":"Jaipur_Sez_GW (Rajasthan)",
"sr-status":"NA",
"sr-status-label":"NA"
},
{
"date":"2023-05-21 09:50:45",
"status":"X-DLL2F",
"activity":"In Transit - Bag Added To Trip",
"location":"Jaipur_Sez_GW (Rajasthan)",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
},
{
"date":"2023-05-22 22:01:12",
"status":"X-ILL2F",
"activity":"In Transit - Trip Arrived",
"location":"Bhiwandi_Mega_GW (Maharashtra)",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
},
{
"date":"2023-05-23 02:55:34",
"status":"X-ILL1F",
"activity":"In Transit - Bag Received at Facility",
"location":"Bhiwandi_Mega_GW (Maharashtra)",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
},
{
"date":"2023-05-23 07:38:08",
"status":"X-DLL2F",
"activity":"In Transit - Bag Added To Trip",
"location":"Bhiwandi_Mega_GW (Maharashtra)",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
},
{
"date":"2023-05-23 09:48:27",
"status":"X-ILL2F",
"activity":"In Transit - Trip Arrived",
"location":"Mumbai_MiraRdIndEstate_I (Maharashtra)",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
},
{
"date":"2023-05-23 10:14:27",
"status":"X-ILL1F",
"activity":"In Transit - Bag Received at Facility",
"location":"Mumbai_MiraRdIndEstate_I (Maharashtra)",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
},
{
"location":"Mumbai_MiraRdIndEstate_I (Maharashtra)",
"date":"2023-05-23 11:43:46",
"activity":"In Transit - Shipment Received at Facility",
"status":"X-IBD3F",
"sr-status":"18",
"sr-status-label":"IN TRANSIT"
}
],
"is_return":0,
"channel_id":3422553,
"pod_status":"OTP Based Delivery",
"pod":"Not Available"
}
Support:
- All the required information on integration is in this document. Please read it thoroughly.
- For any integration and API-related support, you can feel free to drop us an email at integration@shiprocket.in.
For any other issues, please email us at: support@shiprocket.in. - The Shiprocket terms of service are listed here: Terms Of Service