Endpoints
- POST/consolidationsCreate a new consolidation from multiple orders
- POST/consolidations/{parent_order}Append additional orders to an existing consolidation
- DELETE/consolidations/{parent_order}Reverse the consolidation of all child orders under a parent order
Create a consolidation
POST/consolidations
Creates a consolidated parent order from a set of existing orders.
To perform this operation, you must authenticate using an authentication token.
The consolidated parent order is returned in full.
Parameters
ordersarray[string]bodyRequired- List of orders to consolidate into a single consignment
reference_orderstringbodyOptional- Order to use as the reference for the parent consolidation. If not provided, the first order in the array becomes the parent.
Response codes
| Status | Meaning | Description |
|---|---|---|
| 201 | Created | Returns the consolidated order response |
| 400 | Bad Request | Returned when there is a problem with the input parameters |
| 403 | Forbidden | Returned when the API key doesn't match a valid merchant account, or the API secret is missing the permission this endpoint requires. |
| 404 | Not Found | Returned when the system can't find one or more orders |
| 415 | Unsupported Media Type | Returned when the request doesn't set a Content-Type of application/json. |
| 422 | Unprocessable Entity | Returned when the consolidation request fails validation. This happens with fewer than two orders, when an order is in the wrong state or is already consolidated, or when the reference order is missing from orders. |
| 500 | Internal Server Error | Returned when an unknown error occurs |
RequestJSON
{
"orders": [
"ppabcd1234efg",
"ppabcd5678hij"
],
"reference_order": "ppabcd1234efg"
}JSON
{
"order": {
"slug": "ppparent12345",
"state": "processing",
"courier_type": "standard",
"delivery_address": "1 Union Street",
"delivery_postcode": "2009",
"delivery_state": "NSW",
"delivery_suburb": "Pyrmont",
"authority_to_leave": "Yes",
"parcel_attributes": [
{
"qty": 1,
"weight": 2.1
}
],
"user_attributes": {
"email": "test@shippit.com",
"first_name": "John",
"last_name": "Smith"
},
"consolidation": {
"parent_order": {
"tracking_number": "ppparent12345",
"slug": "ppparent12345",
"retailer_invoice": ""
},
"sub_orders": [
{
"tracking_number": "PPabcd1234EFG",
"slug": "ppabcd1234efg",
"retailer_invoice": ""
},
{
"tracking_number": "PPabcd5678HIJ",
"slug": "ppabcd5678hij",
"retailer_invoice": ""
}
]
}
}
}
JSON
{
"error": "bad_request",
"error_description": "orders is required"
}JSON
{
"error": "orders_not_found",
"error_description": "One or more orders could not be found"
}JSON
{
"error": "consolidation_failed",
"error_description": "At least 2 orders are required for consolidation"
}JSON
{
"error": "consolidation_failed",
"error_description": "One or more orders are not eligible for consolidation"
}JSON
{
"error": "consolidation_failed",
"error_description": "Specified parent order not found in order list"
}JSON
{
"error": "system",
"error_description": "An unknown error has occurred."
}Append to a consolidation
POST/consolidations/{parent_order}
Appends additional child orders to an existing consolidated parent order.
To perform this operation, you must authenticate using an authentication token.
The updated parent order is returned in full.
Parameters
parent_orderstringpathRequired- Existing consolidated order
ordersarray[string]bodyRequired- List of orders to append to the consolidation
Response codes
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Returns the updated consolidated order response |
| 400 | Bad Request | Returned if there is a problem with the input parameters |
| 403 | Forbidden | Returned when the API key doesn't match a valid merchant account, or the API secret is missing the permission this endpoint requires. |
| 404 | Not Found | Returned when Shippit can't find the order or one or more child orders |
| 415 | Unsupported Media Type | Returned when the request doesn't set a Content-Type of application/json. |
| 422 | Unprocessable Entity | Returned when the append request fails validation |
| 500 | Internal Server Error | Returned when an unknown error occurs |
RequestJSON
{
"orders": [
"ppabcd9999xyz",
"ppabcd7777qwe"
]
}JSON
{
"order": {
"slug": "ppparent12345",
"state": "processing",
"courier_type": "standard",
"delivery_address": "1 Union Street",
"delivery_postcode": "2009",
"delivery_state": "NSW",
"delivery_suburb": "Pyrmont",
"authority_to_leave": "Yes",
"parcel_attributes": [
{
"qty": 1,
"weight": 2.1
}
],
"user_attributes": {
"email": "test@shippit.com",
"first_name": "John",
"last_name": "Smith"
},
"consolidation": {
"parent_order": {
"tracking_number": "PPparent12345",
"slug": "ppparent12345",
"retailer_invoice": ""
},
"sub_orders": [
{
"tracking_number": "PPabcd1234EFG",
"slug": "ppabcd1234efg",
"retailer_invoice": ""
},
{
"tracking_number": "PPabcd5678HIJ",
"slug": "ppabcd5678hij",
"retailer_invoice": ""
},
{
"tracking_number": "PPabcd9999XYZ",
"slug": "ppabcd9999xyz",
"retailer_invoice": ""
}
]
}
}
}JSON
{
"error": "bad_request",
"error_description": "orders is required"
}JSON
{
"error": "orders_not_found",
"error_description": "One or more orders could not be found"
}JSON
{
"error": "orders_not_found",
"error_description": "Parent order not found"
}JSON
{
"error": "consolidation_failed",
"error_description": "Order is not a consolidated parent order"
}JSON
{
"error": "consolidation_failed",
"error_description": "Parent order is not in an eligible state for appending"
}JSON
{
"error": "consolidation_failed",
"error_description": "One or more orders are not eligible for consolidation"
}JSON
{
"error": "system",
"error_description": "An unknown error has occurred."
}Reverse a consolidation
DELETE/consolidations/{parent_order}
Reverses consolidation of all child orders under the parent order.
To perform this operation, you must authenticate using an authentication token.
Reversing a consolidation splits the parent order back into its child orders.
Parameters
parent_orderstringpathRequired- The consolidated order to separate into individual child orders
Response codes
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | Returns a success response once the system splits the parent order back into child orders |
| 403 | Forbidden | Returned when the API key doesn't match a valid merchant account, or the API secret is missing the permission this endpoint requires. |
| 404 | Not Found | Returned when the system can't locate the parent order |
| 422 | Unprocessable Entity | Returned when the request fails validation |
| 500 | Internal Server Error | Returned when an unknown error occurs |
JSON
{
"response": {
"message": "Deconsolidation successful"
}
}JSON
{
"error": "orders_not_found",
"error_description": "Order not found"
}JSON
{
"error": "consolidation_failed",
"error_description": "Order is not a parent order"
}JSON
{
"error": "consolidation_failed",
"error_description": "Deconsolidation is not allowed at this time"
}