8 API Reference‎ > ‎Resources‎ > ‎


NOTE: Used only in Distribution API.

Order represents orders made by consumers in consumer facing applications. There is some difference in orders workflow for different offer types. For digital offers such as deals and gift cards the system returns vouchers as a result of order placement.

  • id string.
  • order_number string.
  • status string. "active" or "cancelled".
  • items OrderItem.
  • account_id string.
  • customer_name string.
  • purchased_at time.
  • shipping_address Location.
  • shipments list of Shipment.
  • application_id string (for standalone applications like plugins).

Data Example


    "id": "",
    "order_number": "",
    "status": "",
    "items": [OrderItem, ...],
    "account_id": "",
    "customer_name": "",
    "purchased_at": "",
    "shipping_address": {"
             address_line_1": "",

            "address_line_2": "",
            "city": "",
            "state_code": "",
            "postal_code": ""
    "shipments": [Shipment, ...]




Place Order

Placing new orders is most common Order object operation. For “deal” type offers the only required attributes for placing an order are valid customer name, unique order_number and offer_id/quantity combination for each order item.

As a reply for “place order” request you’ll receive order object. It’ll also have vouchers section filled if you ordered “deal” type offers.

Request type: POST
Resource URI: /orders
Sample URL: http://testapi.adility.com/distribution/beta/orders

Sample CURL requests (“deal” type offer)

curl -k -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "X-ADILITY-API-KEY: <your key>" 'http://testapi.adility.com/distribution/beta/orders' -d '{"order":{"order_number": "<order number>", "customer_name": "John Smith", "items": [{"offer_id": "<id string>", "quantity": 2}] } }'

curl -k -X POST -H "Content-Type: application/xml" -H "Accept: application/xml" -H "X-ADILITY-API-KEY: <your key>" 'http://testapi.adility.com/distribution/beta/orders' -d '<?xml version="1.0" encoding="UTF-8" ?>
<customer_name>John Smith</customer_name>
<offer_id>[valid offer id]</offer_id>

Get Order Details

Getting order details. This operation is usually used for checking order status.

Request type: GET
Resource URI: /orders/<id>
Sample URL: http://testapi.adility.com/distribution/beta/orders/<order id>

curl -k -X GET -H "Content-Type: application/json" -H "Accept: application/json" -H "X-ADILITY-API-KEY: <your key>" 'http://testapi.adility.com/distribution/beta/orders/<order id>'

curl -k -X GET -H "Content-Type: application/xml" -H "Accept: application/xml" -H "X-ADILITY-API-KEY: <your key>" 'http://testapi.adility.com/distribution/beta/orders/<order id>'

Cancel Order

This operation will cancel an order with all its vouchers. Technically order cancellation is just sending updated order status.

Request type: PUT
Resource URI: /orders/<id>
Sample URL: http://testapi.adility.com/distribution/beta/orders/<id>

curl -k -X PUT -H "Content-Type: application/json" -H "Accept: application/json" -H "X-ADILITY-API-KEY: <your key>" "http://testapi.adility.com/distribution/beta/orders/<order id>" -d '{"order": {"status": "cancelled"}}'

curl -k -X PUT -H "Content-Type: application/json" -H "Accept: application/json" -H "X-ADILITY-API-KEY: <your key>" "http://testapi.adility.com/distribution/beta/orders/<order id>" -d '<?xml version="1.0" encoding="UTF-8" ?>

Related resources
Offer, Voucher, Shipment