Orders
HTTP GET
GET https://api.bootic.net/v1/shops/{id}/orders.json
Returns a paginated results response for all orders available for the a shop.
This endpoint requires a scope of admin
as a shop owner.
$ curl -H "Authorization: Bearer xxxx" -i https://api.bootic.net/v1/shops/10/orders.json
Status: 200 OK
Content-Type: application/json; charset=utf-8
Connection: keep-alive
ETag: "0728e2965bd03e20a7f1c33add2f8775"
Last-Modified: Fri, 20 Jun 2014 22:34:14 GMT
Cache-Control: must-revalidate, private, max-age=0
Date: Wed, 31 Jul 2013 21:11:52 GMT
X-OAuth-Scopes: admin
{
"_links": {
"next": {
"href": "https://api.bootic.net/v1/shops/3/orders.json?page=2"
},
"last": {
"href": "https://api.bootic.net/v1/shops/3/orders.json?page=290"
}
},
"total_items": 14486,
"per_page": 50,
"page": 1,
"_embedded": {
"items": [
]
}
}
As an example, you can filter orders by status.
$ curl -H "Authorization: Bearer xxxx" -i https://api.bootic.net/v1/shops/:shop_id/orders.json?status=pending
Order entities
The items
array of the orders results response is an array of order
entities. A single order
entity looks like follows:
{
"_links": {
"self": {
"href": "https://api.bootic.net/v1/shops/10/orders/20.json"
},
"shop": {
"href": "https://api.bootic.net/v1/shops/10.json"
},
"btc:web_checkout": {
"href": "https://checkout.bootic.net/orders/SF6A15D",
"type": "text/html",
"title": "Web checkout page for this order"
},
"btc:web_cart": {
"href": "http://simplelist.bootic.net/cart/SF6A15D",
"type": "text/html",
"title": "Web cart page to manually edit this order"
}
},
"id": 583085,
"shop_id": 29,
"code": "R1C3964",
"status": "closed",
"net_total": 29990,
"total": 33704,
"created_on": "2013-10-19T11:06:18",
"updated_on": "2013-10-19T11:20:14",
"pending_on": "2013-10-19T11:22:23",
"closed_on": "2013-10-19T11:23:10",
"shipped_on": null,
"shipping_total": 3714,
"shipping_description": "Valparaíso, Viña del Mar, San Antonio",
"discount_total": 100,
"tracking_code": null,
"courier_name": null,
"shipped_email_sent": false,
"closed_email_sent": true,
"total_weight_in_grams": 1400,
"payment_info": {
"type": "webpay",
"name": "Webpay",
"auth_code": "123456787",
"transaction_id": "111122211"
},
"fulfillment": {
"fulfillment_method": "shipping"
},
"_embedded": {
"address": {
"street": "Av. Brasil 20",
"street_2": "4to piso",
"locality_name": "Valparaiso",
"region_name": "Valparaiso",
"country_name": "Chile",
"postal_code": null,
"country_code": "CL",
"lat_long": "-33.045644,-71.620364"
},
"contact": {
"name": "Joe Perk",
"email": "joe-perk@gmail.com",
"phone_number": "12345677",
"rut": "156422222222"
},
"promotion": {
"name": "Summer discount",
"discount": 100,
"discount_type": "$",
"free_shipping": false
},
"discounts": [
],
"line_items": [
{
"_links": {
"product": {
"href": "https://api.bootic.net/v1/shops/29/products/130924-tinto"
}
},
"product_id": 31166,
"product_title": "130924 Tinto",
"unit_price": 29990,
"units": 1,
"discount_total": 100,
"net_total": 29990,
"total": 29890,
"product_weight_in_grams": 1400,
"weight_in_grams": 1400,
"variant_id": 66501,
"variant_title": "39",
"variant_sku": "SXDD3",
"requested_units": 1,
"_embedded": {
"discounts": [
{
"class": [
"discount"
],
"amount": 100,
"description": "Super offer!"
}
],
"image": {
"class": [
"image",
"asset"
],
"links": {
"thumbnail": {
"href": "http://cdn.bootic.net/29/thumbnail/73763-_MG_4360.JPG"
},
"small": {
"href": "http://cdn.bootic.net/29/small/73763-_MG_4360.JPG"
},
"m": {
"href": "http://cdn.bootic.net/29/medium/73763-_MG_4360.JPG"
},
"large": {
"href": "http://cdn.bootic.net/29/large/73763-_MG_4360.JPG"
},
"original": {
"href": "http://cdn.bootic.net/29/original/73763-_MG_4360.JPG"
}
},
"file_name": "_MG_4360.JPG",
"title": ""
}
}
}
]
}
}
Query string filters
Parameter name | Description | Example | Default value | Allowed values |
---|---|---|---|---|
q |
Full text search | “?q=shoes” | ||
page |
Page number | “?page=20” | 1 | |
per_page |
Orders per page | “?per_page=20” | 30 | |
status |
Order status , comma-separated | “?status=closed,shipped” | “all” |
all , checkout , pending , closed , shipped , invalid , successful
|
code |
Order code | “?code=RES21W” | ||
product_id |
Product ID | “?product_id=32221122” | ||
payment_method |
Payment method slug | “?payment_method=webpay” | ||
created_on_gte |
Created on greater or equal | “?created_on_gte=2013-01-02” | ||
created_on_lte |
Created on less or equal | “?created_on_lte=2013-02-02” | ||
updated_on_gte |
Updated on greater or equal | “?updated_on_gte=2013-01-02” | ||
updated_on_lte |
Updated on less or equal | “?updated_on_lte=2013-01-02” | ||
pending_on_gte |
Pending on greater or equal | “?pending_on_gte=2013-01-02” | ||
pending_on_lte |
Pending on less or equal | “?pending_on_lte=2013-01-02” | ||
closed_on_gte |
Closed on greater or equal | “?closed_on_gte=2013-01-02” | ||
closed_on_lte |
Closed on less or equal | “?closed_on_lte=2013-01-02” | ||
shipped_on_gte |
Shipped on greater or equal | “?shipped_on_gte=2013-01-02” | ||
shipped_on_lte |
Shipped on less or equal | “?shipped_on_lte=2013-01-02” | ||
net_total_gte |
Net total, greater or equal (cents) | “?net_total_gte=3000” | ||
net_total_lte |
Net total, less or equal (cents) | “?net_total_lte=4000” | ||
shipping_total_gte |
Shipping total, greater or equal | “?shipping_total_gte=1000” | ||
shipping_total_lte |
Shipping total, less or equal | “?shipping_total_lte=4000” | ||
discount_total_gte |
Discount total, greater or equal | “?discount_total_gte=3000” | ||
discount_total_lte |
Discount total, less or equal | “?discount_total_lte=5000” | ||
total_gte |
Total, greater or equal | “?total_gte=3000” | ||
total_lte |
Total, less or equal | “?total_lte=5000” | ||
lat_long |
Shipping Latitude,longitude pair | “?lat_long=0.54322222,1.4444422” | ||
distance |
Radius distance from lat_long | “?distance=10km” | “5km” | Distance expressions, ie. “1km”, “34km” |
sort |
Order sort column | “?sort=created_on.desc” | created_on.desc |
created_on.asc , created_on.desc , updated_on.asc , updated_on.desc , pending_on.asc , pending_on.desc , closed_on.asc , closed_on.desc , shipped_on.asc , shipped_on.desc
|
Successful status.
GET https://api.bootic.net/v1/shops/123/orders?status=successful
The successful
status maps internally to any orders with statuses closed
or shipped
. Use this when you need to query for any successful status.
Examples
Orders that have been closed since
GET https://api.bootic.net/v1/shops/123/orders?status=successful&closed_on_gte=2016-05-10&sort=closed_on.asc
The query above will fetch any orders in any successful state that have been closed since 2016-05-10
. Your system can use this if it needs to periodically synchronize order data.