REST Auth API: Order ApproveRequests
The ApproveOrderRequest resource represents a request to approve an existing Order. This operation is used when the platform has a review process for submitted orders, either by waiting for payment (withholding approval until paid), or after a manual review of the order/purchase and approving with a deferred payment expected.
Submitting this request will transition the order from its current state to Approved, and cause related pending registration workflows to be triggered, such as sending confirmation emails.
Only orders in the AwaitingApproval or Pending status may be approved. Attempting to approve an order in any other state will result in a 422 Unprocessable Entity error.
This resource supports submitting approve requests via HTTP POST.
ApproveOrderRequest collection resource
Resource URI
/api/2012-02-01/auth/resources/orders/{OrderID}/approverequests/
General structure
<ApproveOrderRequest> <CommunicationWorkflow>Default</CommunicationWorkflow> <Link rel="http://schemas.arlo.co/api/2012/02/auth/related/ApprovedByContact" type="application/xml" title="ApprovedByContact" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contacts/32/"/> </ApproveOrderRequest>
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 |
|---|---|
| ApprovedByContact | Reference to a Contact resource representing the individual who approved 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 approve an existing Order. The order must be in the AwaitingApproval or Pending state.
Attempting to approve 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 |
|---|---|
| ApprovedByContact | Reference to a Contact resource representing the individual who approved 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 | The request to approve was processed, and the status of the order (and any related registrations) was updated. |
| 400 Bad Request |
HTTP request body contains malformed or invalid parameters. Common causes include: a missing ApproveOrderRequest 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 approved because it is not in an allowed state (AwaitingApproval or Pending), or the supplied contact ID is invalid.
|
Example 1
Approve an order with ID 302 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/approverequests HTTP/1.1 Accept: application/xml Accept-Encoding: gzip, deflate Content-Type: application/xml <ApproveOrderRequest />
HTTP/1.1 204 No Content
Example 2
Approve an order with ID 302, specifying a refernce to a contact (with ID 32) who performed the approval and suppressing all notifications.
POST https://demo.arlo.co/api/2012-02-01/auth/resources/orders/302/approverequests HTTP/1.1 Accept: application/xml Accept-Encoding: gzip, deflate Content-Type: application/xml <ApproveOrderRequest> <CommunicationWorkflow>None</CommunicationWorkflow> <Link rel="http://schemas.arlo.co/api/2012/02/auth/related/ApprovedByContact" type="application/xml" title="ApprovedByContact" href="https://demo.arlo.co/api/2012-02-01/auth/resources/contacts/32/"/> </ApproveOrderRequest>
HTTP/1.1 204 No Content
HTTP PUT
Not supported.
HTTP DELETE
Not supported.
