Order Cancellation at Gold Apple's Request
If an order needs to be canceled for any reason, the Gold Apple IS may send a request to cancel the delivery order to the courier service's IS. The delivery order created in the courier service IS is canceled automatically (if this is permitted given the current delivery status), and the courier service IS records that it accepted the request. The details of the services' physical interaction are not specified in this document. The physical shipment may remain with the courier after the order is canceled in the IS. The endpoint must be published over the secure HTTPS protocol.
info
After receiving a cancellation at Gold Apple's request, the courier service's IS sends the status GA_CANCEL_REQUEST using the Changing Order Status method
Basic Information
| Request method type | POST |
|---|---|
| Path / URL | /api/v1/orders/{orderNumber}/cancel |
| Description | Method for cancelling an order at the courier service, at Gold Apple's request. |
| Direction | The request is executed by the Gold Apple IS. The response is provided by the courier service. |
Request
Header Parameters
| Parameter | Data type | Required | Description | Comment |
|---|---|---|---|---|
| Authorization | string | 1 | Access token obtained during authorization. Passed in the format Bearer <access_token> | The format is defined by the courier service (see Authorization in the ECS Service) |
| content-type | string | 1 | Request content type | Filled in as "application/json" |
Path Parameters
| Parameter | Data type | Required | Description | Comment |
|---|---|---|---|---|
| orderNumber | string | 1 | Gold Apple order number | Internal order number in the Gold Apple IS. Tracking number. |
Response
Response Codes and Messages
| Code | Status | Message | Reason |
|---|---|---|---|
| 200 | OK | Order has been canceled | Everything completed successfully. The order was canceled in the courier service's IS |
| 400 | Bad Request | Missing or inappropriate required parameters | Required parameters are missing or invalid |
| 401 | Unauthorized | Token is invalid | Authentication error at the courier service |
| 403 | Forbidden | Has no permission | Insufficient permissions |
| 500 | Internal Server Error | Server unavailable | The server is unavailable |
Successful Response Parameters
200 OK
Unsuccessful Response Parameters
| Parameter | Data type | Required | Description | Comment |
|---|---|---|---|---|
| error | string | 1 | Human-readable description of the error | see the "Response Codes and Messages" section |
Unsuccessful response example
{
"error": "Token is invalid"
}