This API enables customer to cancel their shipping.
{warning} This API can only cancel a shipment which has a status of Submitted (AY-0001).
This API only accepts POST
requests.
https://dev-api.aymakan.com.sa/v2/shipping/cancel_by_reference
https://api.aymakan.net/v2/shipping/cancel_by_reference
The following headers should be sent along with the request
Your account security code / Api Token
The request body should have the reference number of the shipment related to the customer account only as detailed below.
{
"reference": "66899292"
}
Upon successful request, the following response will be sent back with an HTTP status 200 OK
.
{
"success": true,
"message": "Shipping is cancelled successfully"
}
In case of an error, the following response can be returned.Usually because the status of the shipment is not (AY-0001).
{
"error": true,
"message": "This shipping can not be cancelled"
}
If a shipment is not found, then the following error will be returned.
{
"error": true,
"message": "Shipping not found"
}
Also, an HTTP status of 422 Unprocessable Entity
will be returned.
In case of invalid credentials 401 Unauthorized
, the following response will be returned.
{
"error": true,
"response": "Invalid Credentials"
}