Create a Delivery Job
POST/delivery/jobs
This endpoint initiates a new delivery job and supports two job types: One-Stop job (job_type_id = 3) and Collection and Dropoff job (job_type_id = 1). For a One-Stop Delivery, it is required to specify only one destination. In contrast, the Collection and Dropoff job type necessitates exactly two designated points - one for collection and one for the final dropoff.
A write that ends in a 500 "Server Error" or a 502 "Bad Gateway" has an unknown outcome, so it may have been saved. Before you retry, check whether it exists with GET /delivery/jobs and filter.reference_number.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 422
- 500
- 502
- 503
Successful operation
The request body is declared as JSON but cannot be parsed, or is not a JSON object or array. Nothing was processed.
Unauthorized access. Authentication is required.
Access is forbidden. The user does not have permission to access this resource. Delivery write endpoints also return this error when the request is authenticated with a subuser api_key, which cannot write to Delivery; in that case error.message is Unauthorized and error.data.message is Unauthorized for this role. Authenticate with the main account's api_key and, where supported, set the subuser_id body field to act on behalf of a subuser.
The requested resource was not found.
Validation failed for the input parameters.
Server Error. The request could not be processed, so the API may need more time to process it. The response has error.message "Server Error" and an error.reason that classifies the failure, for example "dependency_unavailable" or "internal_error". New values may be added over time, so treat an unrecognised error.reason as a generic server error. The outcome of a write is unknown, so it may have been saved. Before you retry, check whether it exists with GET /delivery/jobs and filter.reference_number.
Bad Gateway. The request could not be completed because a service needed to process it returned an error. The response has error.message "Bad Gateway" and error.reason "upstream_error". The outcome of a write is unknown, so it may have been saved. Before you retry, check whether it exists with GET /delivery/jobs and filter.reference_number.
Service temporarily unavailable. The request did not complete and can be retried after the number of seconds in the Retry-After header, when one is sent.
Response Headers
Seconds to wait before retrying. Sent with db_busy and db_pool_timeout.