Order Cancellation at the Courier Service's Request
If it becomes known that an order cannot be delivered to the customer for any reason, including at the customer's request, the courier service's IS may send a request to cancel the order to the Gold Apple IS. The delivery order recorded in the Gold Apple IS when the shipment was created will be updated automatically and the cancellation period will begin (if this is permitted given the current delivery status). In addition, the Gold Apple IS records that it accepted the request, and if, within 48 hours (this period depends on the terms of the service agreement), no request to reverse a cancellation is registered by the courier service (see Request to Reverse a Cancellation), the order will be canceled. 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.
Basic Information
| Request method type | POST |
|---|---|
| Path / URL | /api/v1/orders/{orderNumber}/cancel |
| Description | Method for cancelling an order at the courier service's request. |
| Direction | The request is executed by the courier service. The response is provided by the Gold Apple IS. |
Request
Header Parameters
| Parameter | Data type | Required | Description | Comment |
|---|---|---|---|---|
| Authorization | string | 1 | Access token issued by the service | see the Authorization in the Service method |
| 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. |
Request Parameters
| Parameter | Data type | Required | Description | Comment |
|---|---|---|---|---|
| dateTime | date | 1 | Date and time of the order cancellation | Per the "ISO 8601" standard, UTC0 (YYYY-MM-DDThh:mm:ssZ) |
| comment | string | 1 | Comment on the cancellation event | Free-form string comment |
Request example
{
"dateTime": "2019-04-05T12:05:18Z",
"comment": "Customer requested cancellation"
}
Response
Response Codes and Messages
| Code | Status | Message | Reason |
|---|---|---|---|
| 200 | OK | Order has been marked for cancellation | Everything completed successfully. The order was marked for cancellation in the Gold Apple 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": "Has no permission"
}