Create shipment
POST/shipments
Create a new shipment and start tracking it with the specified courier. The list of couriers is available in the Supported couriers page or it can be retrieved from the API using the Get couriers list endpoint.
The API returns immediately after the shipment creation but tracking details are fetched by our systems after a few seconds.
Therefore the shipment status returned in the response will be unknown
and many fields will be null
.
To get the updated shipment details, use the Get shipment details endpoint, or the Get shipments list endpoint with appropriate filters, at a later time.
The courier is not mandatory. If not specified, the courier will be automatically detected based on the tracking code.
If a recipient email address is specified, email notifications will be sent for relevant shipment status changes.
Notifications are enabled only when the shipment type is set to send
.
Shipments created via the API always use the default sender. If you need to choose a different sender for shipments created through the API, contact us.
Request
- application/json
Body
required
Shipment data and optional recipient information.
Possible values: Value must match regular expression ^[a-zA-Z0-9]{4,34}$
Tracking code of the shipment.
Courier slug. If not specified, the courier will be automatically detected. The list of couriers is available in the Supported couriers page.
Possible values: [send
, receive
]
Default value: send
Shipment type. In receive
mode, recipient information is ignored and no email notifications will be sent.
Possible values: <= 100 characters
Order number associated with the shipment.
Possible values: <= 1000 characters
Additional notes about the shipment that will be visible only to the account owner.
Possible values: <= 100 characters
Name of the recipient of the shipment.
Possible values: <= 100 characters
Email of the recipient. If specified, the recipient will receive email notifications when the shipment status changes.
Responses
- 201
- 400
- 401
- 402
- 429
Details of the newly created shipment.
- application/json
- Schema
- Example (from schema)
- New Shipment Example
Schema
Array [
]
data
object
Unique identifier of the shipment.
Tracking code of the shipment.
Courier slug. The possible values are listed in the Supported couriers page.
Possible values: [send
, receive
]
Shipment type. Determines if the shipment is outgoing or incoming.
Timestamp of the creation of the shipment in the system. ISO 8601 format.
Optional order number associated with the shipment.
Additional notes that are visible only to the account owner.
Timestamp of the archiving of the shipment. ISO 8601 format.
Possible values: [delivered
, expired
, manual
, null
]
Determines the reason of the archiving of the shipment.
Timestamp of the first in_transit
checkpoint. ISO 8601 format without the UTC offset (local date time). When the time is not specified, it is set to midnight.
Number of days in transit. The first day until midnight is considered as day 0.
Timestamp of the delivery of the shipment. ISO 8601 format without the UTC offset (local date time). When the time is not specified, it is set to midnight.
Timestamp of the last time that the system checked for new checkpoints. ISO 8601 format.
Timestamp of the last time that the checkpoints history was updated. ISO 8601 format.
checkpoints
object[]
Unique identifier of the checkpoint.
Timestamp of the creation of the checkpoint in the system. ISO 8601 format.
Message published by the courier.
Location of the checkpoint, if provided by the courier.
Date and time of the checkpoint, if provided by the courier. ISO 8601 format without the UTC offset (local date time). When the time is not specified, it is set to midnight.
Additional notes provided by the courier.
Possible values: [unknown
, info_received
, in_transit
, out_for_delivery
, delivered
, attempt_fail
, available_for_pickup
, exception
, delayed
, returned_to_sender
]
Status of the checkpoint.
Possible values: [exception_generic
, exception_incorrect_address
, exception_storage
, exception_refused
, exception_damaged
, exception_lost
, exception_returning_to_sender
, null
]
Substatus of the checkpoint, available only when the status is exception
.
Possible values: [unknown
, info_received
, in_transit
, out_for_delivery
, delivered
, attempt_fail
, available_for_pickup
, exception
, inactive
, returned_to_sender
]
Status of the shipment computed from the checkpoints history. It can be different from the status of the last checkpoint.
Possible values: [exception_generic
, exception_incorrect_address
, exception_storage
, exception_refused
, exception_damaged
, exception_lost
, exception_returning_to_sender
, null
]
Substatus of the shipment, available only when the status is exception
.
true
if a delay in the shipment was detected in the tracking history.
Estimated delivery date indicated by the courier. ISO 8601 format with only the date.
Estimated delivery time range indicated by the courier.
Name of the recipient of the shipment.
Email of the recipient.
Origin of the shipment provided by the courier.
Destination of the shipment provided by the courier.
{
"data": {
"id": "string",
"tracking_code": "string",
"courier": "string",
"type": "send",
"created_at": "2024-01-01T12:00:00Z",
"order_number": "string",
"description": "string",
"archived_at": "2024-01-01T12:00:00Z",
"archive_reason": "delivered",
"shipped_at": "2024-01-01T12:00:00Z",
"transit_days": 0,
"delivered_at": "2024-01-01T12:00:00Z",
"last_check_at": "2024-01-01T12:00:00Z",
"checkpoints_updated_at": "2024-01-01T12:00:00Z",
"checkpoints": [
{
"id": "string",
"created_at": "2024-01-01T12:00:00Z",
"message": "string",
"location": "string",
"date_time": "2024-01-01T12:00:00Z",
"notes": "string",
"status": "unknown",
"substatus": "exception_generic"
}
],
"status": "unknown",
"substatus": "exception_generic",
"is_delayed": true,
"estimated_delivery_date": "2024-01-01",
"estimated_delivery_time": "string",
"recipient_name": "string",
"recipient_email": "user@example.com",
"origin_location": "string",
"destination_location": "string"
}
}
{
"data": {
"id": "Ud5sX7V",
"tracking_code": "T79B19P083",
"courier": "brt",
"type": "send",
"created_at": "2023-12-15T00:00:00Z",
"order_number": 6789,
"description": "Colori per pittura",
"archived_at": null,
"archive_reason": null,
"shipped_at": null,
"transit_days": 0,
"delivered_at": null,
"last_check_at": null,
"checkpoints_updated_at": null,
"checkpoints": [],
"status": "unknown",
"substatus": null,
"is_delayed": false,
"estimated_delivery_date": null,
"estimated_delivery_time": null,
"recipient_name": "Mario Rossi",
"recipient_email": "mario.rossi@example.com",
"origin_location": null,
"destination_location": null
}
}
The request is invalid. See the Error responses page for more details.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
error
object
HTTP status code of the error.
Human-readable message describing the error.
Optional machine-readable code providing details about some 4xx
errors.
errors
object[]
Name of the parameter with invalid value.
Human-readable message describing the error.
{
"error": {
"status": 0,
"message": "string",
"code": "string",
"errors": [
{
"field": "string",
"message": "string"
}
]
}
}
The API token in the request is missing or is invalid. See the Error responses page for more details.
- application/json
- Schema
- Example (from schema)
Schema
error
object
HTTP status code of the error.
Human-readable message describing the error.
Optional machine-readable code providing details about some 4xx
errors.
{
"error": {
"status": 0,
"message": "string",
"code": "string"
}
}
No active plan for the account or plan doesn't allow API/endpoint usage. See the Error responses page for more details.
- application/json
- Schema
- Example (from schema)
Schema
error
object
HTTP status code of the error.
Human-readable message describing the error.
Optional machine-readable code providing details about some 4xx
errors.
{
"error": {
"status": 0,
"message": "string",
"code": "string"
}
}
The API rate limit has been exceeded. See the Error responses page for more details.
- application/json
- Schema
- Example (from schema)
Schema
error
object
HTTP status code of the error.
Human-readable message describing the error.
Optional machine-readable code providing details about some 4xx
errors.
{
"error": {
"status": 0,
"message": "string",
"code": "string"
}
}