Endpoint
POST
https://api.gospeedlog.com/deliveries/{order_number}/cancel
Path Parameters
order_number
string
required
The order number of the delivery you want to cancel
Request Body (optional)
reason string
Reason for cancellation
Required Headers
x-gsl-token
string
required
Your API authentication token
x-gsl-secret
string
required
Your API secret key
Content-Type
string
required
Must be set to
application/jsonRequest Example (cURL)
curl --request POST \
--url https://api.gospeedlog.com/deliveries/ORD-0012345/cancel \
--header 'x-gsl-token: ' \
--header 'x-gsl-secret: ' \
--header 'Content-Type: application/json' \
--data '{
"reason": "Customer cancelled before pickup"
}'
Replace <your_api_token>
and <your_api_secret>
with your actual credentials.
Response
200 OK
The delivery was successfully cancelled. Returns updated delivery status.
Response Body
{
"reason": "Customer requested cancellation"
}
400 Bad Request
The delivery cannot be cancelled because it has already been started or completed.
Response Body
{
"error": "Cannot Cancel",
"message": "Delivery has already been picked up and cannot be cancelled"
}
401 Unauthorized
Your API key is missing or invalid. Make sure authentication headers are included in the request.
Common Error Codes
- 400 Bad Request: Invalid request data or missing required fields
- 401 Unauthorized: Invalid or missing API credentials (x-gsl-token or x-gsl-secret)
- 404 Not Found: Delivery not found
- 422 Unprocessable Entity: Cannot process request (e.g., trying to cancel a completed delivery)
- 500 Internal Server Error: Server error
Validation Errors
When validation fails, the API returns a 400 status code with detailed error information:
{
"error": "Cannot Cancel",
"message": "Delivery has already been picked up and cannot be cancelled"
}
Support
For API support and questions, please contact our development team at api-support@gospeedlog.com .
Our team typically responds within 24 hours during business days.