Adding package
Request
POST /packages?trackNumber={trackNumber}&courierId={courierId}
Required GET request parameters:
Parameter | Type | Description |
---|---|---|
trackNumber | String | Package tracking number |
courierId | Int | Delivery service digital ID. To automatically identify the delivery service, send the value -1. When a delivery service is automatically identified, 1/5 of the package cost will be deducted from your plan's package limit for each delivery service identification request. So, if you add 5 packages with automatic delivery service identification, your plan package limit will be reduced by 6 packages: 5 packages added + 1 package for 5 automatic delivery service identifications. |
Optional POST request parameters:
Parameter | Type | Description |
---|---|---|
destinationCountry | String (ISO 3166-1 alpha-2) | Two-letter code for package destination country |
departureAddress | String | Sender's address |
destinationAddress | String | Delivery address |
orderId | String | Int | Order number |
recipientName | String | Recipient name |
recipientEmail | String | Recipient's e-mail |
recipientPhone | String | Recipient phone number |
comment | String | Note for the package |
Required POST request parameters:
Some delivery services also require additional information in the POST request parameters. Read more in Additional Fields.
Example of a successful response
The response will return the Package object of the newly created package.
To get the latest checkpoints from the delivery service on the added package, be sure to update it.
{
"code": 200,
"payload": {
"created_at": "2021-07-06T13:46:25+03:00",
"updated_at": "2021-07-06T13:46:25+03:00",
"started_tracking_at": "2021-07-06T13:46:25+03:00",
"track_number": "UA937578848US",
"origin": null,
"destination": null,
"last_status": "Receiving status...",
"status": -1,
"checkpoints": [
{
"id": "",
"date": "2021-07-06T13:46:25+03:00",
"title": "Tracking started",
"location": "The package most likely isn't shipped yet",
"latitude": null,
"longitude": null,
"courier_id": null
}
],
"last_status_date": "2021-07-06T13:46:25+03:00",
"est_delivery_date_from": null,
"est_delivery_date_to": null,
"extra_track_numbers": [],
"hash": "f25370e9",
"consolidated_track_number": null,
"consolidation_date": null,
"destination_country_code": "ru",
"updating": false,
"last_tracking_date": null,
"days_on_way": 1,
"weight": null,
"extra_info": [],
"couriers_ids": [
1,
4,
10,
366
],
"courier_id": null,
"info": []
}
}
Error response codes
Followed by 400 HTTP status code. Possible values:
Code | Description |
---|---|
900 | Invalid tracking number format |
901 | Invalid delivery service ID |
902 | Tracking number has already been added |
904 | Failed to automatically identify the delivery service for the given tracking number |
905 | You've reached your plan's limit for adding packages for the billing period |
Error codes possible with HTTP status code other than 400:
Code | Description |
---|---|
422 | Error validating data sent by POST request |