/orders
Loads a list of orders or information on a single order.
URL parameters
Parameters that you can append to the URL, for example: ?parameter=value
Title | Type | Description | Required? |
---|---|---|---|
id | int | ID of a single orders to load. Can be used after the slash. Example: orders/27 load order with ID 27 | No |
page | int | Number of the page to load. Defaults to 1 | No |
sort | string | One or more attributes to sort the items by. Defaults to id descending. For descending, add ! before the attribute name. For multiple attributes, separate them by commas. Example: orders?sort=!id,title sort by descending id first, then by ascending email | No |
size | int | Number of items per page. Defaults to 20 | No |
Response attributes
Attributes that you will receive in response from the endpoint in JSON format, for example:
{"id": 1,"title": "Order"}
Title | Type | Description |
---|---|---|
id | int | ID of the order, same as the order number. Example: 4041 |
display_number | string | Order number together with the display prefix/suffix. Example: CH-4041 |
string | Email of the customer | |
status | int | Fulfilment status. Can be: 0 - Not sent to fulfilment 1 - Partially sent to fulfilment 2 - Partially sent to fulfilment and shipped 3 - Sent to fulfilment 4 - Partially shipped 5 - Shipped |
paid | int | Payment status. Can be: 0 - Not paid 1 - Paid -1 - Partially refunded -2 - Fully refunded |
discounts | object | Discounts related to the order |
shipping | array | Shipping details of the order |
shipping.description | string | Shipping method description |
shipping.price | decimal | Price of shipping |
tax | decimal | Tax paid |
total | decimal | Total amount of the order |
ip | string | IP used to make the order |
items | object | Items ordered |
items.data | array | Instance of LineItems |
items.status | array | Fulfilment status of the item Includes counter fields: quantity not_fulfilled fulfilled shipped restocked |
fulfilments | object | Array of Fulfilments for the order |
shipments | object | Array of Shipments for the order |
restocks | object | Array of Restocks for the order |
customer | array | Data about the customer that made the order Includes fields: id first_name last_name |
address | array | Instance of Addresses |
payment | array | Payment info Includes fields: type (e.g. Visa, MasterCard, PayPal) last4 (last 4 digits of the card, if applicable) |
conversion | array | Conversion info Includes fields: landing_page referrer |
risk_level | array | Info on fraud risk level Includes boolean fields: ip_fail address_fail zip_fail cvc_fail True values indicate greater risk. |
refunded | decimal | Amount refunded |
refund_possible | bool | If refunding this order is still possible |
order_date | timestamp | Timestamp of when the order was made |
updated_at | timestamp | When the order was updated, if at all |
notes | string | Field to put optional info in |
Loading page number
If you need to load the page number that the order is on using the order ID, you can use this request:
GET https://mystore.commercehq.com/api/v1/orders/1400/page
GET https://mystore.commercehq.com/api/v1/orders/1400
{
"id": 4041,
"display_number": "RH4041",
"email": "[email protected]",
"status": 0,
"paid": 1,
"discounts": [],
"shipping": {
"description": "Super fast shipping",
"price": "7.95"
},
"tax": 0,
"total": 21.89,
"ip": "::1",
"items": [
{
"data": {
"id": 9550,
"product_id": 47,
"title": "Amazing necklace",
"is_multi": true,
"type": "Necklace",
"is_giftcard": false,
"shipping_weight": 2,
"vendor": null,
"auto_fulfilment": false,
"track_inventory": false,
"sku": "0170301",
"price": 13.94,
"compare_price": 46.5,
"image": null,
"image_max_size": 8,
"variant": {
"id": 36,
"variant": [
"Purple"
]
}
},
"status": {
"quantity": 1,
"not_fulfilled": 1,
"fulfilled": 0,
"shipped": 0,
"restocked": 0
}
}
],
"fulfilments": [],
"shipments": [],
"restocks": [],
"customer": {
"id": 2819,
"email": "[email protected]",
"first_name": "Jack",
"last_name": "Black"
},
"address": {
"shipping": {
"first_name": "Jack",
"last_name": "Black",
"company": null,
"street": "Grove str.",
"suite": null,
"city": "Los Santos",
"country": "US",
"state": "San Andreas",
"zip": "90250"
},
"billing": {
"first_name": "Jack",
"last_name": "Black",
"company": null,
"street": "Long str.",
"suite": null,
"city": "Los Santos",
"country": "US",
"state": "San Andreas",
"zip": "90250"
},
"phone": null
},
"payment": {
"type": "Visa",
"last4": "4242"
},
"conversion": {
"landing_page": "http://dummy-client.com/product/amazing-necklace",
"referrer": "dummy-client.com"
},
"risk_level": {
"ip_fail": false,
"address_fail": false,
"zip_fail": false,
"cvc_fail": false
},
"refunded": 0,
"refund_possible": true,
"order_date": 1494594582,
"updated_at": null,
"notes": null
},