Order API
This is description of zubibu Orders API. You can also consider using our Web Hooks - push notifications are fired when orders are created, paid, updated, etc.
Get a list of all Orders
GET /orders.:format
This method requires authentication
Available URL Query parameters:
- per_page — Amount of results per page (default: 10) (maximum: 50)
- page — Page to show (default: 1) (read more about pagination here)
- since_id — Restrict results to after the specified ID
- created_at_min — Show orders created after date (format: 2008-01-01 03:00)
- created_at_max — Show orders created before date (format: 2008-01-01 03:00)
- updated_at_min — Show orders last updated after date (format: 2008-01-01 03:00)
- updated_at_max — Show orders last updated before date (format: 2008-01-01 03:00)
- status
- paid - Show only paid orders (default)
- unpaid - Show only unpaid orders
- dispatched - Show only paid dispatched
- cancelled - Show only paid cancelled
- any - Any order status
Example
$ curl http://api.zubibu.com/v1/orders.json?api_key=API_KEY&status=any&page=2
Response
HTTP/1.1 200 OK
[
{
"number": 58,
"line_items": [
{
"name": "Hama Traveller Compact",
"original_id": "3347",
"price": 29.0,
"quantity": 1
}
],
"created_at": "2011-05-30T16:14:25+02:00",
"delivery_method": "UPS Express",
"line_items_cost": 29.0,
"notes": "",
"payment_gateway": "Cash on delivery",
"id": "4de3a6417826c9650900000c",
"delivery_cost": 0.0,
"customer": {
"address1": "Kruczkowskiego 12",
"city": "Gdansk",
"address2": "",
"zip": "80-288",
"country": "Poland",
"phone": "007",
"last_name": "Bond",
"province": null,
"email": "james.bond@mi5.co.uk",
"first_name": "James"
},
"currency": "PLN",
"status": "unpaid",
"total_cost": 29.0
},
{....}
]
Response is truncated for readability
Get a single order
GET /orders/:order_id.:format
This method requires authentication
Example
$ curl http://api.zubibu.com/v1/orders/4de3a6417826c9650900000c.xml?api_key=API_KEY
Response
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8"?>
<order>
<customer>
<last-name>Bond</last-name>
<country>Poland</country>
<phone>007</phone>
<zip>80-288</zip>
<city>Gdansk</city>
<first-name>James</first-name>
<email>james.bond@mi5.co.uk</email>
<address1>Kruczkowskiego 12</address1>
<province nil="true"></province>
<address2></address2>
</customer>
<line-items type="array">
<line-item>
<price type="float">29.0</price>
<original-id>3347</original-id>
<name>Hama Traveller Compact</name>
<quantity type="integer">1</quantity>
</line-item>
</line-items>
<status>unpaid</status>
<delivery-method>UPS Express</delivery-method>
<payment-gateway>Cash on delivery</payment-gateway>
<currency>PLN</currency>
<created-at type="datetime">2011-05-30T16:14:25+02:00</created-at>
<number type="integer">58</number>
<line-items-cost type="float">29.0</line-items-cost>
<delivery-cost type="float">0.0</delivery-cost>
<notes></notes>
<total-cost type="float">29.0</total-cost>
<id type="BSON::ObjectId">4de3a6417826c9650900000c</id>
</order>
