Skip to main content

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 typePOST
Path / URL/api/v1/orders/{orderNumber}/cancel
DescriptionMethod for cancelling an order at the courier service's request.
DirectionThe request is executed by the courier service. The response is provided by the Gold Apple IS.

Request​

Header Parameters​

ParameterData typeRequiredDescriptionComment
Authorizationstring1Access token issued by the servicesee the Authorization in the Service method
content-typestring1Request content typeFilled in as "application/json"

Path Parameters​

ParameterData typeRequiredDescriptionComment
orderNumberstring1Gold Apple order numberInternal order number in the Gold Apple IS. Tracking number.

Request Parameters​

ParameterData typeRequiredDescriptionComment
dateTimedate1Date and time of the order cancellationPer the "ISO 8601" standard, UTC0 (YYYY-MM-DDThh:mm:ssZ)
commentstring1Comment on the cancellation eventFree-form string comment

Request example​

{
"dateTime": "2019-04-05T12:05:18Z",
"comment": "Customer requested cancellation"
}

Response​

Response Codes and Messages​

CodeStatusMessageReason
200OKOrder has been marked for cancellationEverything completed successfully. The order was marked for cancellation in the Gold Apple IS
400Bad RequestMissing or inappropriate required parametersRequired parameters are missing or invalid
401UnauthorizedToken is invalidAuthentication error at the courier service
403ForbiddenHas no permissionInsufficient permissions
500Internal Server ErrorServer unavailableThe server is unavailable

Successful Response Parameters​

200 OK

Unsuccessful Response Parameters​

ParameterData typeRequiredDescriptionComment
errorstring1Human-readable description of the errorsee the "Response Codes and Messages" section

Unsuccessful response example​

{
"error": "Has no permission"
}

/api/v1/orders/{orderNumber}/cancel

Authorizations:
Bearer
path Parameters
orderNumber
required
string
Request Body schema:
required
dateTime
required
string <date-time>
comment
required
string non-empty

Responses

Request samples

Content type
{
  • "dateTime": "2019-08-24T14:15:22Z",
  • "comment": "string"
}

Response samples

Content type
application/json
{ }