Skip to Content

Developer / API Learning Center

Integrate shipping, tracking, labels, and rate quotes into your platform.

Cancel shipments

Use this endpoint to cancel a shipment that has not yet been assigned to a driver. Once a driver is assigned or the shipment is in progress, cancellation may not be available.

Authentication: an API key is required. Use Authorization: Bearer YOUR_API_KEY, or keep the existing query/form key. A supplied header takes precedence over legacy credentials and browser/masquerade sessions. Invalid Bearer credentials return JSON HTTP 401 without falling back to another identity. Cancellation restrictions are unchanged.

Endpoint

GET https://www.jetdelivery.com/api/v1/order/cancel/json/

Quick example

curl "https://www.jetdelivery.com/api/v1/order/cancel/json/?id=2345678" \
  -H "Authorization: Bearer YOUR_API_KEY"

Tip: Use the tracking number returned from the Create Shipments endpoint as the id. Existing ?id=2345678&key=YOUR_API_KEY requests remain supported; no migration is required. Send only one request when you intend to cancel a shipment.

Parameters

Click any parameter to expand details.

id string Required
The 6–8 digit tracking number assigned to the shipment at time of booking (up to 8 characters).
key string Required without Bearer
Your API key (linked to a Jet Delivery account). Required unless you supply the Bearer header.
If the shipment is already assigned to a driver, this endpoint may return an error or deny cancellation. In that case, contact your Jet Delivery representative or dispatch for assistance.

Response

On success, the endpoint returns a simple success result. If cancellation is not allowed or the request is invalid, the response will include an error message.

Example (success)

{
  "error": null,
  "data": {
    "result": "success"
  }
}

Example (error)

{
  "data": null,
  "error": {
    "message": "This order cannot be canceled.",
    "exception": null
  }
}
Common error messages include:
  • You did not provide an access token.
  • IP address is blocked
  • Access denied.
  • A valid tracking number is required.
  • The order is already canceled.
  • This order cannot be canceled.

Note: Depending on your account configuration (cancel method), some cancellations may return a provider response payload. If you need a strict, always-consistent response format, tell us and we can standardize it.

Next steps