ShippitDeveloper Centre

Group order API

The group order API allows you to create a group order and finalise it. A group order collects several orders under one reference so they travel together; once you finalise it, no more orders can be added.

Endpoints

The group order object

idstringRequired
The ID of the group order. Pass this as group_order.id on an order to add that order to the group.
Sample responseJSON
{
    "id": "GOFIHRxykEyiP"
}

Create a group order

POST/group_orders

Submits a group order to be created on Shippit.

To perform this operation, you must be authenticated with an authentication token.

Parameters

reference_numberstringRequired
Reference number for the group order

Response codes

StatusMeaningDescription
200OKReturns an object representing the ID of your successfully created group order.
400Bad RequestReturned when Shippit has a problem with the input parameters. Not all input errors result in this error. Depending on the request, the error might be parsed as an unknown error or as part of the response body. If returned as text or html, it's blank.
403ForbiddenReturned when the API key doesn't match a valid merchant account, or the API secret is missing the permission this endpoint requires.
500Internal Server ErrorReturned when an unknown error occurs. This can happen if Shippit has trouble with the combination of the input or merchant account configuration.
RequestJSON
{
    "reference_number": "R12345"
}
JSON
{
    "errors": {
        "reference_number": "field must be provided"
    }
}

Finalise a group order

PATCH/group_orders/{group_order_id}/finalise

Finalise the group order. When a group order has been finalised, no more orders can be added to the group order.

A successful call returns a 204 with no response payload body.

To perform this operation, you must be authenticated with an authentication token.

Parameters

group_order_idstringpathRequired
The ID of the group order

Response codes

StatusMeaningDescription
204No ContentGroup order has been successfully finalised. Nothing is returned in the response payload body.
403ForbiddenReturned when the API key doesn't match a valid merchant account, or the API secret is missing the permission this endpoint requires.
404Not FoundReturns an error indicating that the group order couldn't be found in Shippit
422Unprocessable EntityReturned when the group order holds no orders, so there is nothing to finalise.
500Internal Server ErrorReturned when an unknown error occurs. Might be returned if Shippit has trouble with the combination of the input or merchant account configuration.
JSON
{
  "error": "invalid_merchant_account",
  "error_description": "An unknown error has occurred."
}

The error object

Both endpoints return the same shape when they fail.

errorstringRequired
Error code returned by Shippit
error_descriptionstringOptional
Human-readable description of error encountered.