REST Auth API: Order CancelRequests
The CancelOrderRequest resource represents a request to cancel an existing Order. Submitting this request will transition the order to the Cancelled state.
Orders may be cancelled for a variety of reasons, such as a customer changing their mind, or an administrator identifying an issue with the order during processing. Cancelling an order is not the same as a refund, and
is purely an administrative operation that marks the order with the Cancelled status and sends a cancellation notification to the billing contact if appropriate.
Only orders in the AwaitingApproval, Approved or Pending status may be cancelled. Attempting to cancel an order in any other state will result in a 422 Unprocessable Entity error.
This resource supports submitting cancel requests via HTTP POST.
CancelOrderRequest collection resource
Resource URI
/api/2012-02-01/auth/resources/orders/{OrderID}/cancelrequests/
General structure
<CancelOrderRequest> <CommunicationWorkflow>Default</CommunicationWorkflow> <Link rel="http://schemas.arlo.co/api/2012/02/auth/related/CancelledByContact" type="application/xml" title="CancelledByContact" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contacts/32/"/> </CancelOrderRequest>
Resource properties
| Property | Description |
|---|---|
| CommunicationWorkflow |
An optional OrderCommunicationWorkflow value controlling whether platform notifications are sent during the operation. Defaults to Default if omitted. Must be a valid enumeration value (Default or None).
|
Related resource links
| Link (title) | Description |
|---|---|
| CancelledByContact | Reference to a Contact resource representing the individual who cancelled the order. If not specified, the identity of the executing user will be used instead. This link does not support inline data. |
HTTP GET
Not supported.
HTTP POST
Submits a request to cancel an existing Order. The order must be in the AwaitingApproval, Approved or Pending state.
Attempting to cancel an order that does not meet these criteria will result in a 422 Unprocessable Entity response.
Optional request elements
| Parameter | Description |
|---|---|
| CommunicationWorkflow |
An optional OrderCommunicationWorkflow value controlling whether platform notifications are sent during the operation. Defaults to Default if omitted. Must be a valid enumeration value (Default or None).
|
Optional request resource links
| Link (title) | Description |
|---|---|
| CancelledByContact | Reference to a Contact resource representing the individual who cancelled the order. If not specified, the identity of the executing user will be used instead. This link does not support inline data. |
Response
See HTTP response status codes for a general overview of all possible API status codes. Common response codes for this operation are listed below.
| Status | Description |
|---|---|
| 204 No Content | Order was successfully cancelled. |
| 400 Bad Request |
HTTP request body contains malformed or invalid parameters. Common causes include: a missing CancelOrderRequest root element, or the CommunicationWorkflow value is not a valid OrderCommunicationWorkflow value.
|
| 404 Not Found | The specified order could not be found. |
| 422 Unprocessable Entity |
The order cannot be cancelled because it is not in an allowed state (AwaitingApproval, Approved or Pending), or the supplied contact ID is invalid.
|
Example 1
Cancel an order using the default communication workflow and the identity of the executing user.
POST https://demo.arlo.co/api/2012-02-01/auth/resources/orders/302/cancelrequests HTTP/1.1 Accept: application/xml Accept-Encoding: gzip, deflate Content-Type: application/xml <CancelOrderRequest />
HTTP/1.1 204 No Content
Example 2
Cancel an order, specifying a contact who performed the cancellation and suppressing all notifications.
POST https://demo.arlo.co/api/2012-02-01/auth/resources/orders/302/cancelrequests HTTP/1.1 Accept: application/xml Accept-Encoding: gzip, deflate Content-Type: application/xml <CancelOrderRequest> <CommunicationWorkflow>None</CommunicationWorkflow> <Link rel="http://schemas.arlo.co/api/2012/02/auth/related/CancelledByContact" type="application/xml" title="CancelledByContact" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contacts/32/"/> </CancelOrderRequest>
HTTP/1.1 204 No Content
HTTP PUT
Not supported.
HTTP DELETE
Not supported.
