Orders

The Orders API provides a simple interface to manage orders.

An Order is a list of Line Items associated with a deal.

The API allows you to create, delete and update your orders. You can also retrieve a single order as well as list of all orders.

Line Items, Products and Orders are available only to users who are on the Enterprise plan.

Account’s administrators can disable changes to these entities in the account’s settings. When disabled, all data are preserved but only GET requests are allowed.

Properties

Attribute Description
id number readonly

Unique identifier of the order.

deal_id number

Id of the deal the order is associated to.

discount number

Discount on the whole order in percents.

created_at string readonly

Date and time that the order was created in UTC (ISO8601 format).

updated_at string readonly

Date and time of the last update on the order in UTC (ISO8601 format).


Endpoints


Retrieve all orders

Returns all orders available to the user according to the parameters provided.

Parameters

Attribute Description
page number optional

Page number to start from. Page numbering starts at 1, and omitting the page parameter will return the first page.

e.g. ?page=2
per_page number optional

Number of records to return per page. Default limit is 25 and the maximum number that can be returned is 100.

e.g. ?per_page=20
sort_by string optional

A field to sort by. Default ordering is ascending. If you want to change the sort ordering to descending, append :desc to the field e.g. sort_by=value:desc.

Possible values:

  • id
  • updated_at
  • created_at
e.g. ?sort_by=created_at
ids string optional

Comma-separated list of order IDs to be returned in a request.

e.g. ?ids=1,2,3
deal_id number optional

Id of the deal order is associated to.

e.g. ?deal_id=12

Create an order

Create a new order for a deal. User needs to have access to the deal to create an order. Each deal can have at most one order and error is returned when attempting to create more.

Parameters

Attribute Description
deal_id number required
e.g. "deal_id": "12"
discount number optional
e.g. "discount": "50"

Retrieve a single order

Returns a single order available to the user, according to the unique order ID provided. If the specified order does not exist, the request will return an error.

Parameters

Attribute Description
id number required

Unique identifier of the order.


Update an order

Updates order information. If the specified order does not exist, the request will return an error.

Parameters

Attribute Description
deal_id number optional
e.g. "deal_id": "12"
discount number optional
e.g. "discount": "25"

Delete an order

Delete an existing order and remove all of the associated line items in a single call. If the specified order does not exist, the request will return an error. This operation cannot be undone.

Parameters

Attribute Description
id number required

Unique identifier of the order.