Difference between revisions of "API Order"
From Spiffy Stores Knowledge Base
(27 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
== Order Properties == | == Order Properties == | ||
− | + | {| class="reference" | |
− | + | !id | |
− | |||
− | |||
− | |||
− | {| class=" | ||
− | |||
|<code>{ "id" : 123456789 }</code><br/> | |<code>{ "id" : 123456789 }</code><br/> | ||
A unique numeric identifier for the order. This ID is only used with the API interface. This ID is not the same as the Order Number, which is also a unique numeric identifier for the order, but is used by the store owner and customer. | A unique numeric identifier for the order. This ID is only used with the API interface. This ID is not the same as the Order Number, which is also a unique numeric identifier for the order, but is used by the store owner and customer. | ||
|- | |- | ||
− | + | !order_number | |
|<code>{ "order_number" : 1045 }</code><br/> | |<code>{ "order_number" : 1045 }</code><br/> | ||
A unique numeric identifier for the order that is used as a reference number for the store owner and customers. This is not the same as the <code>id</code>, which is only used to refer to orders within the API. | A unique numeric identifier for the order that is used as a reference number for the store owner and customers. This is not the same as the <code>id</code>, which is only used to refer to orders within the API. | ||
|- | |- | ||
− | + | !name | |
|<code>{ "name" : "#001045" }</code><br/> | |<code>{ "name" : "#001045" }</code><br/> | ||
This is the <code>order_number</code>, formatted according the the store preferences for order number formatting. | This is the <code>order_number</code>, formatted according the the store preferences for order number formatting. | ||
|- | |- | ||
− | + | !browser_ip | |
|<code>{ "browser_ip" : "202.60.66.249" }</code><br/> | |<code>{ "browser_ip" : "202.60.66.249" }</code><br/> | ||
This is the IP address used by the customer when the order was placed. | This is the IP address used by the customer when the order was placed. | ||
|- | |- | ||
− | + | !buyer_accepts_marketing | |
|<code>{ "buyer_accepts_marketing" : true }</code><br/> | |<code>{ "buyer_accepts_marketing" : true }</code><br/> | ||
If the customer indicates during the checkout process that they are happy to receive marketing and other promotional emails, then their response is recorded here. | If the customer indicates during the checkout process that they are happy to receive marketing and other promotional emails, then their response is recorded here. | ||
|- | |- | ||
− | + | !cart_token | |
|<code>{ "cart_token" : "65853ecbd10916e70999e7056b01a5e7" }</code><br/> | |<code>{ "cart_token" : "65853ecbd10916e70999e7056b01a5e7" }</code><br/> | ||
This is a unique token that identifies the cart that is associated with a particular order. | This is a unique token that identifies the cart that is associated with a particular order. | ||
|- | |- | ||
− | + | !created_at | |
|<code>{ "created_at" : "2007-10-24T18:26:31Z" }</code><br/> | |<code>{ "created_at" : "2007-10-24T18:26:31Z" }</code><br/> | ||
The date and time when the order was created. The timestamp is in ISO 8601 format. | The date and time when the order was created. The timestamp is in ISO 8601 format. | ||
|- | |- | ||
− | + | !updated_at | |
|<code>{ "updated_at" : "2014-01-16T05:50:56Z" }</code><br/> | |<code>{ "updated_at" : "2014-01-16T05:50:56Z" }</code><br/> | ||
The date and time when the order was last updated. The timestamp is in ISO 8601 format. | The date and time when the order was last updated. The timestamp is in ISO 8601 format. | ||
|- | |- | ||
− | + | !currency | |
|<code>{ "currency" : "AUD" }</code><br/> | |<code>{ "currency" : "AUD" }</code><br/> | ||
The three letter currency code (ISO 4217) used for the order. | The three letter currency code (ISO 4217) used for the order. | ||
|- | |- | ||
− | + | !email | |
|<code>{ "email" : "customer@any_domain.com" }</code><br/> | |<code>{ "email" : "customer@any_domain.com" }</code><br/> | ||
The customer's email address. | The customer's email address. | ||
|- | |- | ||
− | + | !credit | |
|<code>{ "credit" : "0.0" }</code><br/> | |<code>{ "credit" : "0.0" }</code><br/> | ||
An order can have credit applied to it from a customer's account. If this is the case, then the amount of credit that has been applied to the order is returned here. | An order can have credit applied to it from a customer's account. If this is the case, then the amount of credit that has been applied to the order is returned here. | ||
|- | |- | ||
− | + | !taxes_included | |
|<code>{ "taxes_included" : true }</code><br/> | |<code>{ "taxes_included" : true }</code><br/> | ||
For certain tax systems such as GST and VAT, the amount of tax is included in the price of an item and in this case, this field will return <code>true</code>. In a sales tax system, where the amount of sales tax is added to the final amount of the order, then <code>false</code> will be returned. | For certain tax systems such as GST and VAT, the amount of tax is included in the price of an item and in this case, this field will return <code>true</code>. In a sales tax system, where the amount of sales tax is added to the final amount of the order, then <code>false</code> will be returned. | ||
|- | |- | ||
− | + | !tax_price | |
|<code>{ "tax_price" : "3.04" }</code><br/> | |<code>{ "tax_price" : "3.04" }</code><br/> | ||
The total amount of all taxes applied to the order. | The total amount of all taxes applied to the order. | ||
|- | |- | ||
− | + | !included_tax_price | |
|<code>{ "included_tax_price" : "3.04" }</code><br/> | |<code>{ "included_tax_price" : "3.04" }</code><br/> | ||
The total amount of all taxes applied to the order that are included as part of the item prices. | The total amount of all taxes applied to the order that are included as part of the item prices. | ||
|- | |- | ||
− | + | !tax_label | |
|<code>{ "tax_label" : "GST" }</code><br/> | |<code>{ "tax_label" : "GST" }</code><br/> | ||
The description of the tax item applied to the entire order. | The description of the tax item applied to the entire order. | ||
|- | |- | ||
− | + | !discount_price | |
|<code>{ "discount_price" : "0.0" }</code><br/> | |<code>{ "discount_price" : "0.0" }</code><br/> | ||
The total amount of all discounts that have been applied to the order via coupon codes. Note that this does not include the amount of any discount that has been calculated as a result of a shopping cart discount. This amount is available through <code>line_items_discount_price</code>. | The total amount of all discounts that have been applied to the order via coupon codes. Note that this does not include the amount of any discount that has been calculated as a result of a shopping cart discount. This amount is available through <code>line_items_discount_price</code>. | ||
|- | |- | ||
− | + | !cart_discount_price | |
|<code>{ "cart_discount_price" : "3.8" }</code><br/> | |<code>{ "cart_discount_price" : "3.8" }</code><br/> | ||
The total amount of all discounts that have been applied to the order via shopping cart discounts. | The total amount of all discounts that have been applied to the order via shopping cart discounts. | ||
|- | |- | ||
− | + | !shipping_price | |
|<code>{ "shipping_price" : "17.2" }</code><br/> | |<code>{ "shipping_price" : "17.2" }</code><br/> | ||
The total amount of shipping costs for the order. | The total amount of shipping costs for the order. | ||
|- | |- | ||
− | + | !shipping_lines | |
|<code>{ "shipping_lines" : [<br/> { "code": "WEIGHT_BASED",<br/> "price": "7.2",<br/> "weight": 0.2,<br/> "title": "Australia Post - Regular Parcel"<br/> }<br/>] }</code><br/> | |<code>{ "shipping_lines" : [<br/> { "code": "WEIGHT_BASED",<br/> "price": "7.2",<br/> "weight": 0.2,<br/> "title": "Australia Post - Regular Parcel"<br/> }<br/>] }</code><br/> | ||
An array of <code>shipping_line</code> objects is returned. Each object represents a physical parcel that needs to be shipped, based upon the weight and physical dimensions of the products that have been ordered. Each <code>shipping_line</code> has the following properties: | An array of <code>shipping_line</code> objects is returned. Each object represents a physical parcel that needs to be shipped, based upon the weight and physical dimensions of the products that have been ordered. Each <code>shipping_line</code> has the following properties: | ||
Line 89: | Line 84: | ||
* weight - The weight of the parcel | * weight - The weight of the parcel | ||
* title - The description for the shipping method | * title - The description for the shipping method | ||
− | + | ||
The following shipping method codes are used: | The following shipping method codes are used: | ||
Line 99: | Line 94: | ||
: The price for shipping is determined by the Shipping Code | : The price for shipping is determined by the Shipping Code | ||
|- | |- | ||
− | |subtotal_price | + | !surcharge_price |
+ | |<code>{ "surcharge_price" : "1.63" }</code><br/> | ||
+ | The total amount added to the order as a surcharge. This can include surcharges added for the use of specific credit-cards or other payment methods. | ||
+ | |- | ||
+ | !surcharge_percentage | ||
+ | |<code>{ "surcharge_percentage" : "1.5" }</code><br/> | ||
+ | The percentage amount of the surcharge. | ||
+ | |- | ||
+ | !surcharge_label | ||
+ | |<code>{ "surcharge_label" : "Surcharge on payment by Visa card (1.5%)" }</code><br/> | ||
+ | The description of the surcharge that has been applied. | ||
+ | |- | ||
+ | !subtotal_price | ||
|<code>{ "subtotal_price" : "16.19" }</code><br/> | |<code>{ "subtotal_price" : "16.19" }</code><br/> | ||
The total amount of the order less coupon code discounts, but before shipping and additional taxes. | The total amount of the order less coupon code discounts, but before shipping and additional taxes. | ||
|- | |- | ||
− | + | !total_line_items_price | |
|<code>{ "total_line_items_price" : "16.19" }</code><br/> | |<code>{ "total_line_items_price" : "16.19" }</code><br/> | ||
The total amount of the order, before shipping and additional taxes and before any coupon code discounts have been applied. | The total amount of the order, before shipping and additional taxes and before any coupon code discounts have been applied. | ||
|- | |- | ||
− | + | !total_price | |
|<code>{ "total_price" : "33.39" }</code><br/> | |<code>{ "total_price" : "33.39" }</code><br/> | ||
The total amount of all items in the order, including shipping, taxes and discounts. | The total amount of all items in the order, including shipping, taxes and discounts. | ||
|- | |- | ||
− | + | !test | |
|<code>{ "test" : false }</code><br/> | |<code>{ "test" : false }</code><br/> | ||
Return true if this is a test order. | Return true if this is a test order. | ||
|- | |- | ||
− | + | !gateway | |
|<code>{ "gateway" : "Bank Deposit" }</code><br/> | |<code>{ "gateway" : "Bank Deposit" }</code><br/> | ||
The name of the payment gateway that was used to process the payment for this order. | The name of the payment gateway that was used to process the payment for this order. | ||
|- | |- | ||
− | + | !note | |
|<code>{ "note" : "This order has top priority." }</code><br/> | |<code>{ "note" : "This order has top priority." }</code><br/> | ||
The text of an optional note that can be attach to the order by the store owner. | The text of an optional note that can be attach to the order by the store owner. | ||
|- | |- | ||
− | + | !total_weight | |
|<code>{ "total_weight" : 200.0 }</code><br/> | |<code>{ "total_weight" : 200.0 }</code><br/> | ||
The total weight of all items in the order, expressed in grams. | The total weight of all items in the order, expressed in grams. | ||
|- | |- | ||
− | |financial_status | + | !attributes |
+ | |<code>{ "attributes" : {<br> "child_name": "Timmy",<br> "delivery_date": "2018-12-25"<br> }<br>}</code><br> | ||
+ | |- | ||
+ | !financial_status | ||
|<code>{ "financial_status" : "paid" }</code><br/> | |<code>{ "financial_status" : "paid" }</code><br/> | ||
Returns the current financial status of the order. The following statuses are used: | Returns the current financial status of the order. The following statuses are used: | ||
Line 136: | Line 146: | ||
* paid - The order has been fully paid | * paid - The order has been fully paid | ||
|- | |- | ||
− | + | !fulfilment_status | |
|<code>{ "fulfilment_status" : null }</code><br/> | |<code>{ "fulfilment_status" : null }</code><br/> | ||
Returns the current fulfilment status of the order. The following statuses are used: | Returns the current fulfilment status of the order. The following statuses are used: | ||
Line 144: | Line 154: | ||
* partial: At least one item in the order has been fulfilled | * partial: At least one item in the order has been fulfilled | ||
|- | |- | ||
− | + | !tax_lines | |
|<code>{ "tax_lines" : [<br/> { "title": "Including GST",<br/> "rate": "0.1",<br/> "price": "3.04"<br/> }<br/>] }</code><br/> | |<code>{ "tax_lines" : [<br/> { "title": "Including GST",<br/> "rate": "0.1",<br/> "price": "3.04"<br/> }<br/>] }</code><br/> | ||
An array of <code>tax_line</code> objects is returned. Each object details the total taxes applicable to the order, and has the following properties: | An array of <code>tax_line</code> objects is returned. Each object details the total taxes applicable to the order, and has the following properties: | ||
Line 152: | Line 162: | ||
* price - The amount of tax to be charged | * price - The amount of tax to be charged | ||
|- | |- | ||
− | + | !cancel_reason | |
|<code>{ "cancel_reason" : "Fraudulent order" }</code><br/> | |<code>{ "cancel_reason" : "Fraudulent order" }</code><br/> | ||
If an order has been cancelled, the reason for the cancellation is returned. The following reasons may be returned: | If an order has been cancelled, the reason for the cancellation is returned. The following reasons may be returned: | ||
Line 161: | Line 171: | ||
* Other | * Other | ||
|- | |- | ||
− | + | !cancelled_at | |
|<code>{ "cancelled_at" : "2015-02-23T03:02:51Z" }</code><br/> | |<code>{ "cancelled_at" : "2015-02-23T03:02:51Z" }</code><br/> | ||
The date and time when the order was cancelled. The timestamp is in ISO 8601 format. | The date and time when the order was cancelled. The timestamp is in ISO 8601 format. | ||
|- | |- | ||
− | + | !closed_at | |
|<code>{ "closed_at" : "2015-02-23T03:02:51Z" }</code><br/> | |<code>{ "closed_at" : "2015-02-23T03:02:51Z" }</code><br/> | ||
The date and time when the order was closed. The timestamp is in ISO 8601 format. | The date and time when the order was closed. The timestamp is in ISO 8601 format. | ||
|- | |- | ||
− | + | !discount_codes | |
|<code>{ "discount_codes" : [<br/> { "code": "STOCKTAKE",<br/> "amount": "0.1",<br/> "type": "3.04"<br/> }<br/>] }</code><br/> | |<code>{ "discount_codes" : [<br/> { "code": "STOCKTAKE",<br/> "amount": "0.1",<br/> "type": "3.04"<br/> }<br/>] }</code><br/> | ||
An array of <code>discount_code</code> objects is returned. Each object details the coupon code discounts that have been applied to the order, and has the following properties: | An array of <code>discount_code</code> objects is returned. Each object details the coupon code discounts that have been applied to the order, and has the following properties: | ||
Line 184: | Line 194: | ||
* discount_price - The discount is a fixed price for a product | * discount_price - The discount is a fixed price for a product | ||
|- | |- | ||
− | + | !billing_address | |
|<code>{ "billing_address" : {<br/> "id": 2075,<br/> "title": "Mr",<br/> "first_name": "Frodo",<br/> "last_name": "Baggins",<br/> "name": "Mr Frodo Baggins",<br/> "company": "The Fellowship of the Ring",<br/> "address1": "1 Bag End",<br/> "address2": "",<br/> "city": "Hobbiton",<br/> "province": "The Shire",<br/> "province_code": "",<br/> "country": "Middle Earth",<br/> "country_code": "ME",<br/> "zip": "1234",<br/> "phone": "0412123456"}<br/>}</code><br/> | |<code>{ "billing_address" : {<br/> "id": 2075,<br/> "title": "Mr",<br/> "first_name": "Frodo",<br/> "last_name": "Baggins",<br/> "name": "Mr Frodo Baggins",<br/> "company": "The Fellowship of the Ring",<br/> "address1": "1 Bag End",<br/> "address2": "",<br/> "city": "Hobbiton",<br/> "province": "The Shire",<br/> "province_code": "",<br/> "country": "Middle Earth",<br/> "country_code": "ME",<br/> "zip": "1234",<br/> "phone": "0412123456"}<br/>}</code><br/> | ||
Returns the billing address associated with the order. The address has the following properties: | Returns the billing address associated with the order. The address has the following properties: | ||
Line 204: | Line 214: | ||
* phone - A contact phone number for the customer | * phone - A contact phone number for the customer | ||
|- | |- | ||
− | + | !shipping_address | |
|<code>{ "shipping_address" : {<br/> "id": 2075,<br/> "title": "Mr",<br/> "first_name": "Frodo",<br/> "last_name": "Baggins",<br/> "name": "Mr Frodo Baggins",<br/> "company": "The Fellowship of the Ring",<br/> "address1": "1 Bag End",<br/> "address2": "",<br/> "city": "Hobbiton",<br/> "province": "The Shire",<br/> "province_code": "",<br/> "country": "Middle Earth",<br/> "country_code": "ME",<br/> "zip": "1234",<br/> "phone": "0412123456"}<br/>}</code><br/> | |<code>{ "shipping_address" : {<br/> "id": 2075,<br/> "title": "Mr",<br/> "first_name": "Frodo",<br/> "last_name": "Baggins",<br/> "name": "Mr Frodo Baggins",<br/> "company": "The Fellowship of the Ring",<br/> "address1": "1 Bag End",<br/> "address2": "",<br/> "city": "Hobbiton",<br/> "province": "The Shire",<br/> "province_code": "",<br/> "country": "Middle Earth",<br/> "country_code": "ME",<br/> "zip": "1234",<br/> "phone": "0412123456"}<br/>}</code><br/> | ||
Returns the shipping address associated with the order. The address has the following properties: | Returns the shipping address associated with the order. The address has the following properties: | ||
Line 224: | Line 234: | ||
* phone - A contact phone number for the customer | * phone - A contact phone number for the customer | ||
|- | |- | ||
− | + | !customer | |
|<code>{ "customer" : {<br/> "id": 6,<br/> "title": "Mr",<br/> "first_name": "Frodo",<br/> "last_name": "Baggins",<br/> "name": "Mr Frodo Baggins",<br/> "email": "frodo@theshire.com",<br/> "accepts_marketing": true,<br/> "created_at": "2010-06-15T13:15:50Z",<br/> "updated_at": "2015-02-23T03:02:51Z",<br/> "note": "This customer has an interest in rings.",<br/> "orders_count": 512,<br/> "state": "enabled",<br/> "total_spent": "11230.63",<br/> "sign_in_count": 261,<br/> "current_sign_in_at": "2015-02-23T03:02:51Z",<br/> "current_sign_in_ip": "192.168.10.164",<br/> "last_sign_in_at": "2015-02-19T05:58:54Z",<br/> "last_sign_in_ip": "192.168.10.164",<br/> "wholesale": false,<br/> "credit": "0.0",<br/> "tags": "friend,ring_bearer,brave,hobbit"<br/>} }</code><br/> | |<code>{ "customer" : {<br/> "id": 6,<br/> "title": "Mr",<br/> "first_name": "Frodo",<br/> "last_name": "Baggins",<br/> "name": "Mr Frodo Baggins",<br/> "email": "frodo@theshire.com",<br/> "accepts_marketing": true,<br/> "created_at": "2010-06-15T13:15:50Z",<br/> "updated_at": "2015-02-23T03:02:51Z",<br/> "note": "This customer has an interest in rings.",<br/> "orders_count": 512,<br/> "state": "enabled",<br/> "total_spent": "11230.63",<br/> "sign_in_count": 261,<br/> "current_sign_in_at": "2015-02-23T03:02:51Z",<br/> "current_sign_in_ip": "192.168.10.164",<br/> "last_sign_in_at": "2015-02-19T05:58:54Z",<br/> "last_sign_in_ip": "192.168.10.164",<br/> "wholesale": false,<br/> "credit": "0.0",<br/> "tags": "friend,ring_bearer,brave,hobbit"<br/>} }</code><br/> | ||
Returns an object containing information about the customer. This information is only available if the customer has registered for an account, so this information will not be available for guest checkout orders. | Returns an object containing information about the customer. This information is only available if the customer has registered for an account, so this information will not be available for guest checkout orders. | ||
Line 256: | Line 266: | ||
* tags - Tags associated with customer | * tags - Tags associated with customer | ||
|- | |- | ||
− | + | !line_items | |
|<code>{ "line_items" : [<br/> { "id": 1200,<br/> "product_id": 1512,<br/> "variation_id": 1705,<br/> "product_exists": true,<br/> "quantity": 1,<br/> "sku": "3445657",<br/> "name": "Cute Dog - Brown",<br/> "title": "Cute Dog",<br/> "variation_title": "Brown",<br/> "discount_description": <nowiki>"<br/>10% Off<br/>Wholesale"</nowiki>,<br/> "vendor": "Spiffy Stores",<br/> "weight": 0.2,<br/> "grams": 200.0,<br/> "length": 0.0,<br/> "width": 0.0,<br/> "height": 0.0,<br/> "price": "19.99",<br/> "wholesale_price": "9.99",<br/> "taxable": true,<br/> "discount_price": "3.8",<br/> "total_price": "16.19",<br/> "ship_separately": false,<br/> "free_shipping": false,<br/> "requires_shipping": true,<br/> "fulfilment_service": "manual",<br/> "fulfillable_quantity": 1,<br/> "shipping_method": "",<br/> "instalments": 1,<br/> "gift_card": false,<br/> "fulfilment_status": null<br/> }<br/>] }</code><br/> | |<code>{ "line_items" : [<br/> { "id": 1200,<br/> "product_id": 1512,<br/> "variation_id": 1705,<br/> "product_exists": true,<br/> "quantity": 1,<br/> "sku": "3445657",<br/> "name": "Cute Dog - Brown",<br/> "title": "Cute Dog",<br/> "variation_title": "Brown",<br/> "discount_description": <nowiki>"<br/>10% Off<br/>Wholesale"</nowiki>,<br/> "vendor": "Spiffy Stores",<br/> "weight": 0.2,<br/> "grams": 200.0,<br/> "length": 0.0,<br/> "width": 0.0,<br/> "height": 0.0,<br/> "price": "19.99",<br/> "wholesale_price": "9.99",<br/> "taxable": true,<br/> "discount_price": "3.8",<br/> "total_price": "16.19",<br/> "ship_separately": false,<br/> "free_shipping": false,<br/> "requires_shipping": true,<br/> "fulfilment_service": "manual",<br/> "fulfillable_quantity": 1,<br/> "shipping_method": "",<br/> "instalments": 1,<br/> "gift_card": false,<br/> "fulfilment_status": null<br/> }<br/>] }</code><br/> | ||
An array of <code>line_item</code> objects, containing information about the items that have been ordered. Each object has the following properties: | An array of <code>line_item</code> objects, containing information about the items that have been ordered. Each object has the following properties: | ||
Line 293: | Line 303: | ||
Items that are marked as gift cards are not taxed or included in any shipping charge calculations. | Items that are marked as gift cards are not taxed or included in any shipping charge calculations. | ||
|- | |- | ||
− | + | !fulfilments | |
|<code>{ "fulfilments" : [<br/> { "id": 397,<br/> "order_id": 1035,<br/> "tracking_company": "",<br/> "tracking_number": "12345678",<br/> "tracking_numbers": ["12345678"],<br/> "tracking_url": "",<br/> "tracking_urls": [],<br/> "status": "Success",<br/> "receipt": {},<br/> "inventory_management": "spiffy",<br/> "created_at": "2015-02-12T06:27:11Z",<br/> "updated_at": "2015-02-12T06:28:06Z",<br/> "line_items": [<br/> { "id": 1198,<br/> "product_id": 1534,<br/> "variation_id": 2178,<br/> "product_exists": true,<br/> "quantity": 1,<br/> "sku": "123456789",<br/> "name": "Suitcase - Red/Large/Leather",<br/> "title": "Suitcase",<br/> "variation_title": "Red/Large/Leather",<br/> "discount_description": <nowiki>"<br/>10% Off"</nowiki>,<br/> "vendor": "Spiffy Stores",<br/> "weight": 0.1,<br/> "grams": 100.0,<br/> "length": 0.0,<br/> "width": 0.0,<br/> "height": 0.0,<br/> "price": "12.34",<br/> "wholesale_price": "0.0",<br/> "taxable": true,<br/> "discount_price": "1.23",<br/> "total_price": "11.11",<br/> "ship_separately": false,<br/> "free_shipping": false,<br/> "requires_shipping": true,<br/> "fulfilment_service": "manual",<br/> "fulfillable_quantity": 1,<br/> "shipping_method": "",<br/> "instalments": 1,<br/> "gift_card": false,<br/> "fulfilment_status": "fulfilled"}<br/> ]<br/> }<br/>] }</code><br/> | |<code>{ "fulfilments" : [<br/> { "id": 397,<br/> "order_id": 1035,<br/> "tracking_company": "",<br/> "tracking_number": "12345678",<br/> "tracking_numbers": ["12345678"],<br/> "tracking_url": "",<br/> "tracking_urls": [],<br/> "status": "Success",<br/> "receipt": {},<br/> "inventory_management": "spiffy",<br/> "created_at": "2015-02-12T06:27:11Z",<br/> "updated_at": "2015-02-12T06:28:06Z",<br/> "line_items": [<br/> { "id": 1198,<br/> "product_id": 1534,<br/> "variation_id": 2178,<br/> "product_exists": true,<br/> "quantity": 1,<br/> "sku": "123456789",<br/> "name": "Suitcase - Red/Large/Leather",<br/> "title": "Suitcase",<br/> "variation_title": "Red/Large/Leather",<br/> "discount_description": <nowiki>"<br/>10% Off"</nowiki>,<br/> "vendor": "Spiffy Stores",<br/> "weight": 0.1,<br/> "grams": 100.0,<br/> "length": 0.0,<br/> "width": 0.0,<br/> "height": 0.0,<br/> "price": "12.34",<br/> "wholesale_price": "0.0",<br/> "taxable": true,<br/> "discount_price": "1.23",<br/> "total_price": "11.11",<br/> "ship_separately": false,<br/> "free_shipping": false,<br/> "requires_shipping": true,<br/> "fulfilment_service": "manual",<br/> "fulfillable_quantity": 1,<br/> "shipping_method": "",<br/> "instalments": 1,<br/> "gift_card": false,<br/> "fulfilment_status": "fulfilled"}<br/> ]<br/> }<br/>] }</code><br/> | ||
An array of <code>fulfilment</code> objects is returned, representing individual parcel shipments for this order. Each object has the following properties: | An array of <code>fulfilment</code> objects is returned, representing individual parcel shipments for this order. Each object has the following properties: | ||
Line 310: | Line 320: | ||
* updated_at - The date and time the fulfilment was updated | * updated_at - The date and time the fulfilment was updated | ||
* line_items - The line items included in this fulfilment | * line_items - The line items included in this fulfilment | ||
+ | |- | ||
+ | !transactions | ||
+ | |<code>{ "transactions" : [<br/> { "id": 253,<br/> "order_id": 378,<br/> "amount": "10.0",<br/> "authorization": "1156177",<br/> "created_at": "2015-02-27T18:08:34Z",<br/> "gateway": "Friendly Bank",<br/> "kind": "Authorization",<br/> "status": "Success",<br/> "transaction_id": "",<br/> "description": "TRANSACTION APPROVED" }<br/>] }</code><br/> | ||
+ | An array of <code>transaction</code> objects is returned representing all of the financial transactions associated with the order. Each object has the following properties: | ||
+ | |||
+ | * id - The unique numeric identifier for the transaction | ||
+ | * order_id - The unique numeric identifier for the order | ||
+ | * amount - The amount processed in the transaction | ||
+ | * authorization - The authorization code returned by the payment gateway | ||
+ | * created_at - The date and time the transaction was created | ||
+ | * gateway - The name of the gateway that processed the transaction | ||
+ | * kind - The type of transaction | ||
+ | ** Sale - The combination of Authorization and Capture | ||
+ | ** Authorization - Payment has been agreed but not processed | ||
+ | ** Capture - Payment is completed after an Authorization | ||
+ | ** Void - The transaction has been cancelled | ||
+ | ** Refund - The transaction has been reversed | ||
+ | * status - The status of the transaction | ||
+ | ** Success - The transaction completed normally | ||
+ | ** Pending - The transaction has yet to be completed | ||
+ | ** Error - There was an error in the transaction | ||
+ | ** Failure - A failure prevented processing the transaction | ||
+ | * transaction_id - The transaction identifier returned by the gateway | ||
+ | * description - A text description of the transaction | ||
|} | |} | ||
+ | |||
+ | == Endpoints == | ||
+ | |||
+ | === <code>GET /api/orders.json</code> === | ||
+ | |||
+ | Return a list of open orders. Use the optional <code>status</code> to return other orders. | ||
+ | |||
+ | ==== Optional Parameters ==== | ||
+ | |||
+ | {| class="reference" | ||
+ | !limit | ||
+ | |Number of results returned. The default is 30, with a maximum of 50 in a single request. | ||
+ | |- | ||
+ | !page | ||
+ | |The number of the page to return. The number of results per page is set by the <code>limit</code> parameter. If more results are required, then submit the request again, increasing the page number each time. | ||
+ | |- | ||
+ | !ids | ||
+ | |A comma-separated list of order ids. | ||
+ | |- | ||
+ | !since_id | ||
+ | |Limit the results to only include objects which have an id greater than the given value. | ||
+ | |- | ||
+ | !created_at_min | ||
+ | |Return only the orders created after the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !created_at_max | ||
+ | |Return only the orders created before the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !updated_at_min | ||
+ | |Return only the orders updated after the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !updated_at_max | ||
+ | |Return only the orders updated before the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !paid_at_min | ||
+ | |Return only the orders paid after the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !paid_at_max | ||
+ | |Return only the orders paid before the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !closed_at_min | ||
+ | |Return only the orders closed after the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !closed_at_max | ||
+ | |Return only the orders closed before the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !status | ||
+ | |Return only orders with the given status.<br/> | ||
+ | * open - Include only open orders (default) | ||
+ | * closed - Include only closed orders | ||
+ | * cancelled - Include only cancelled orders | ||
+ | * abandoned - Include only abandoned orders | ||
+ | * any - Include all orders | ||
+ | |- | ||
+ | !financial_status | ||
+ | |Return only orders with the given financial status.<br/> | ||
+ | * pending - Include only unpaid orders | ||
+ | * authorized - Include only authorized orders | ||
+ | * paid - Include only paid orders | ||
+ | * partially_paid - Include only partially paid orders | ||
+ | * any - Include orders with any financial status (default) | ||
+ | |- | ||
+ | !fulfilment_status | ||
+ | |Return only orders with the given fulfilment status.<br/> | ||
+ | * unshipped - Include only unshipped orders | ||
+ | * shipped - Include only shipped orders | ||
+ | * partial - Include only partially shipped orders | ||
+ | * any - Include orders with any fulfilment status (default) | ||
+ | |- | ||
+ | !test_status | ||
+ | |Return only orders with the given test status.<br/> | ||
+ | * true - Include only test orders | ||
+ | * false - Exclude all test orders | ||
+ | * any - Include orders regardless of their test status (default) | ||
+ | |- | ||
+ | !customer_id | ||
+ | |Return all the orders belonging to the specified customer. | ||
+ | |- | ||
+ | !email | ||
+ | |Return all orders that have been placed with the specified email address. | ||
+ | |- | ||
+ | !fields | ||
+ | |A comma-separated list of fields to return in the response. If a list of fields is provided, then the <code>customer</code>, <code>billing_address</code>, <code>shipping_address</code> and <code>line_items</code> fields will always be excluded. | ||
+ | |} | ||
+ | |||
+ | ==== Example Request and Response ==== | ||
+ | |||
+ | <pre> | ||
+ | GET /api/orders.json | ||
+ | |||
+ | HTTP/1.1 200 OK | ||
+ | |||
+ | { | ||
+ | "orders": [ | ||
+ | { | ||
+ | "id": 378, | ||
+ | "order_number": 1169, | ||
+ | "name": "#01169", | ||
+ | "browser_ip": "127.0.0.1", | ||
+ | "buyer_accepts_marketing": false, | ||
+ | "cart_token": null, | ||
+ | "created_at": "2015-02-27T18:08:33Z", | ||
+ | "updated_at": "2015-02-27T18:08:33Z", | ||
+ | "currency": "AUD", | ||
+ | "email": "customer@customer.domain.com", | ||
+ | "credit": "0.0", | ||
+ | "taxes_included": true, | ||
+ | "tax_price": "0.91", | ||
+ | "included_tax_price": "0.91", | ||
+ | "tax_label": "GST", | ||
+ | "discount_price": "0.0", | ||
+ | "cart_discount_price": "0.0", | ||
+ | "shipping_price": "0.0", | ||
+ | "subtotal_price": "10.0", | ||
+ | "total_line_items_price": "10.0", | ||
+ | "total_price": "10.0", | ||
+ | "test": false, | ||
+ | "gateway": "Friendly Bank", | ||
+ | "note": "Very important customer", | ||
+ | "total_weight": 100.0, | ||
+ | "financial_status": "authorized", | ||
+ | "attributes": { "name": "Timmy" }, | ||
+ | "billing_address": | ||
+ | { | ||
+ | "id": 687, | ||
+ | "title": "Mr", | ||
+ | "first_name": "Important", | ||
+ | "last_name": "Customer", | ||
+ | "name":"Mr Important Customer", | ||
+ | "company": "", | ||
+ | "address1": "1 Main St", | ||
+ | "address2": "", | ||
+ | "city": "Sydney", | ||
+ | "province": "New South Wales", | ||
+ | "province_code": "NSW", | ||
+ | "country": "Australia", | ||
+ | "country_code": "AU", | ||
+ | "zip": "1234", | ||
+ | "phone": "0291234567" | ||
+ | }, | ||
+ | "shipping_address": | ||
+ | { | ||
+ | "id": 688, | ||
+ | "title": "Mr", | ||
+ | "first_name": "Important", | ||
+ | "last_name": "Customer", | ||
+ | "name": "Mr Important Customer", | ||
+ | "company": "", | ||
+ | "address1": "1 Main St", | ||
+ | "address2": "", | ||
+ | "city": "Sydney", | ||
+ | "province": "New South Wales", | ||
+ | "province_code": "NSW", | ||
+ | "country": "Australia", | ||
+ | "country_code": "AU", | ||
+ | "zip": "1234", | ||
+ | "phone": "0291234567" | ||
+ | }, | ||
+ | "customer": | ||
+ | { | ||
+ | "id": 6, | ||
+ | "title": "Mr", | ||
+ | "first_name": "Important", | ||
+ | "last_name": "Customer", | ||
+ | "name": "Mr Important Customer", | ||
+ | "email": "customer@customer.domain.com", | ||
+ | "accepts_marketing": true, | ||
+ | "created_at": "2010-06-15T13:15:50Z", | ||
+ | "note": "Here is some sample text.", | ||
+ | "orders_count": 512, | ||
+ | "state": "enabled", | ||
+ | "total_spent": "11230.63", | ||
+ | "updated_at": "2015-02-23T03:02:51Z", | ||
+ | "sign_in_count": 261, | ||
+ | "current_sign_in_at": "2015-02-23T03:02:51Z", | ||
+ | "current_sign_in_ip": "192.168.10.164", | ||
+ | "last_sign_in_at": "2015-02-19T05:58:54Z", | ||
+ | "last_sign_in_ip": "192.168.10.164", | ||
+ | "wholesale": true, | ||
+ | "credit": "0.0", | ||
+ | "tags":"friend,wholesaler" | ||
+ | }, | ||
+ | "fulfilments": [], | ||
+ | "line_items": [ | ||
+ | { | ||
+ | "id": 410, | ||
+ | "product_id": 1506, | ||
+ | "variation_id": 1691, | ||
+ | "product_exists": true, | ||
+ | "quantity": 1, | ||
+ | "sku": "SHIRT002", | ||
+ | "name": "T-Shirt - S - Teal-Blue", | ||
+ | "title": "T-Shirt", | ||
+ | "variation_title": "S/Teal-Blue", | ||
+ | "discount_description": "", | ||
+ | "vendor": "Spiffy Stores", | ||
+ | "weight": 0.1, | ||
+ | "grams": 100.0, | ||
+ | "length": 0.0, | ||
+ | "width": 0.0, | ||
+ | "height": 0.0, | ||
+ | "price": "10.0", | ||
+ | "wholesale_price": "0.0", | ||
+ | "taxable": true, | ||
+ | "discount_price": "0.0", | ||
+ | "total_price": "10.0", | ||
+ | "ship_separately": false, | ||
+ | "free_shipping": false, | ||
+ | "requires_shipping": true, | ||
+ | "fulfilment_service": "manual", | ||
+ | "fulfillable_quantity": 1, | ||
+ | "shipping_method": "", | ||
+ | "instalments": 1, | ||
+ | "gift_card": false, | ||
+ | "fulfilment_status": null | ||
+ | } | ||
+ | ], | ||
+ | "transactions": [ | ||
+ | { | ||
+ | "id": 253, | ||
+ | "order_id": 378, | ||
+ | "amount": "10.0", | ||
+ | "authorization": "1156177", | ||
+ | "created_at": "2009-02-27T18:08:34Z", | ||
+ | "gateway": "Friendly Bank", | ||
+ | "kind": "Authorization", | ||
+ | "status": "Success", | ||
+ | "transaction_id": "", | ||
+ | "description": "TRANSACTION APPROVED" | ||
+ | } | ||
+ | ], | ||
+ | "tax_lines": [ | ||
+ | { | ||
+ | "title": "Including GST", | ||
+ | "rate": "0.1", | ||
+ | "price": "0.91" | ||
+ | } | ||
+ | ], | ||
+ | "shipping_lines": [], | ||
+ | "discount_codes": [] | ||
+ | }, ... | ||
+ | ] | ||
+ | } | ||
+ | |||
+ | Examples using filters | ||
+ | |||
+ | GET /api/orders.json?status=closed | ||
+ | |||
+ | GET /api/orders.json?customer_id=2322 | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | === <code>GET /api/orders/count.json</code> === | ||
+ | |||
+ | Return a count of open orders. Use the optional <code>status</code> to return the count of other orders. | ||
+ | |||
+ | ==== Optional Parameters ==== | ||
+ | |||
+ | {| class="reference" | ||
+ | !since_id | ||
+ | |Limit the results to only include objects which have an id greater than the given value. | ||
+ | |- | ||
+ | !created_at_min | ||
+ | |Return only the orders created after the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !created_at_max | ||
+ | |Return only the orders created before the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !updated_at_min | ||
+ | |Return only the orders updated after the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !updated_at_max | ||
+ | |Return only the orders updated before the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !paid_at_min | ||
+ | |Return only the orders paid after the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !paid_at_max | ||
+ | |Return only the orders paid before the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !closed_at_min | ||
+ | |Return only the orders closed after the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !closed_at_max | ||
+ | |Return only the orders closed before the given date and time. Use the format "2014-12-31 12:00". | ||
+ | |- | ||
+ | !status | ||
+ | |Return only orders with the given status.<br/> | ||
+ | * open - Include only open orders (default) | ||
+ | * closed - Include only closed orders | ||
+ | * cancelled - Include only cancelled orders | ||
+ | * abandoned - Include only abandoned orders | ||
+ | * any - Include all orders | ||
+ | |- | ||
+ | !financial_status | ||
+ | |Return only orders with the given financial status.<br/> | ||
+ | * pending - Include only unpaid orders | ||
+ | * authorized - Include only authorized orders | ||
+ | * paid - Include only paid orders | ||
+ | * partially_paid - Include only partially paid orders | ||
+ | * any - Include orders with any financial status (default) | ||
+ | |- | ||
+ | !fulfilment_status | ||
+ | |Return only orders with the given fulfilment status.<br/> | ||
+ | * unshipped - Include only unshipped orders | ||
+ | * shipped - Include only shipped orders | ||
+ | * partial - Include only partially shipped orders | ||
+ | * any - Include orders with any fulfilment status (default) | ||
+ | |- | ||
+ | !test_status | ||
+ | |Return only orders with the given test status.<br/> | ||
+ | * true - Include only test orders | ||
+ | * false - Exclude all test orders | ||
+ | * any - Include orders regardless of their test status (default) | ||
+ | |- | ||
+ | !customer_id | ||
+ | |Return all the orders belonging to the specified customer. | ||
+ | |- | ||
+ | !email | ||
+ | |Return all orders that have been placed with the specified email address. | ||
+ | |} | ||
+ | |||
+ | ==== Example Request and Response ==== | ||
+ | |||
+ | <pre> | ||
+ | GET /api/orders/count.json | ||
+ | |||
+ | HTTP/1.1 200 OK | ||
+ | |||
+ | { | ||
+ | "count": 123 | ||
+ | } | ||
+ | |||
+ | Examples using filters | ||
+ | |||
+ | GET /api/orders/count.json?status=closed | ||
+ | </pre> | ||
+ | |||
+ | === <code>GET /api/orders/ORDER_ID.json</code> === | ||
+ | |||
+ | Return a single order. | ||
+ | |||
+ | ==== Optional Parameters ==== | ||
+ | |||
+ | {| class="reference" | ||
+ | !fields | ||
+ | |A comma-separated list of fields to return in the response. If a list of fields is provided, then the <code>customer</code>, <code>billing_address</code>, <code>shipping_address</code> and <code>line_items</code> fields will always be excluded. | ||
+ | |} | ||
+ | |||
+ | ==== Example Request and Response ==== | ||
+ | |||
+ | <pre> | ||
+ | GET /api/orders/16789.json | ||
+ | |||
+ | HTTP/1.1 200 OK | ||
+ | |||
+ | { | ||
+ | "order": | ||
+ | { | ||
+ | "id": 16789, | ||
+ | "order_number": 23543, | ||
+ | "name": "#023543", | ||
+ | "browser_ip": "127.0.0.1", | ||
+ | "buyer_accepts_marketing": false, | ||
+ | "cart_token": null, | ||
+ | "created_at": "2015-02-27T18:08:33Z", | ||
+ | "updated_at": "2015-02-27T18:08:33Z", | ||
+ | ... | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | == Further Reference == | ||
+ | |||
+ | * [[An Introduction to the Spiffy Stores API]] | ||
+ | * [[Creating Private API Keys]] | ||
+ | * [[Using the API]] | ||
+ | * [[API Reference]] |
Latest revision as of 10:18, 22 August 2018
The Spiffy Stores API Order object represents a request from a customer to purchase one or more products from your store. The process of creating an order during the checkout process collects together sets of information about the customer's requested, including customer details and billing and shipping addresses, a list of the items being purchased, information about the payment, and shipping and fulfilment details.
Order Properties
id | { "id" : 123456789 } A unique numeric identifier for the order. This ID is only used with the API interface. This ID is not the same as the Order Number, which is also a unique numeric identifier for the order, but is used by the store owner and customer. |
---|---|
order_number | { "order_number" : 1045 } A unique numeric identifier for the order that is used as a reference number for the store owner and customers. This is not the same as the |
name | { "name" : "#001045" } This is the |
browser_ip | { "browser_ip" : "202.60.66.249" } This is the IP address used by the customer when the order was placed. |
buyer_accepts_marketing | { "buyer_accepts_marketing" : true } If the customer indicates during the checkout process that they are happy to receive marketing and other promotional emails, then their response is recorded here. |
cart_token | { "cart_token" : "65853ecbd10916e70999e7056b01a5e7" } This is a unique token that identifies the cart that is associated with a particular order. |
created_at | { "created_at" : "2007-10-24T18:26:31Z" } The date and time when the order was created. The timestamp is in ISO 8601 format. |
updated_at | { "updated_at" : "2014-01-16T05:50:56Z" } The date and time when the order was last updated. The timestamp is in ISO 8601 format. |
currency | { "currency" : "AUD" } The three letter currency code (ISO 4217) used for the order. |
{ "email" : "customer@any_domain.com" } The customer's email address. | |
credit | { "credit" : "0.0" } An order can have credit applied to it from a customer's account. If this is the case, then the amount of credit that has been applied to the order is returned here. |
taxes_included | { "taxes_included" : true } For certain tax systems such as GST and VAT, the amount of tax is included in the price of an item and in this case, this field will return |
tax_price | { "tax_price" : "3.04" } The total amount of all taxes applied to the order. |
included_tax_price | { "included_tax_price" : "3.04" } The total amount of all taxes applied to the order that are included as part of the item prices. |
tax_label | { "tax_label" : "GST" } The description of the tax item applied to the entire order. |
discount_price | { "discount_price" : "0.0" } The total amount of all discounts that have been applied to the order via coupon codes. Note that this does not include the amount of any discount that has been calculated as a result of a shopping cart discount. This amount is available through |
cart_discount_price | { "cart_discount_price" : "3.8" } The total amount of all discounts that have been applied to the order via shopping cart discounts. |
shipping_price | { "shipping_price" : "17.2" } The total amount of shipping costs for the order. |
shipping_lines | { "shipping_lines" : [ An array of
The following shipping method codes are used:
|
surcharge_price | { "surcharge_price" : "1.63" } The total amount added to the order as a surcharge. This can include surcharges added for the use of specific credit-cards or other payment methods. |
surcharge_percentage | { "surcharge_percentage" : "1.5" } The percentage amount of the surcharge. |
surcharge_label | { "surcharge_label" : "Surcharge on payment by Visa card (1.5%)" } The description of the surcharge that has been applied. |
subtotal_price | { "subtotal_price" : "16.19" } The total amount of the order less coupon code discounts, but before shipping and additional taxes. |
total_line_items_price | { "total_line_items_price" : "16.19" } The total amount of the order, before shipping and additional taxes and before any coupon code discounts have been applied. |
total_price | { "total_price" : "33.39" } The total amount of all items in the order, including shipping, taxes and discounts. |
test | { "test" : false } Return true if this is a test order. |
gateway | { "gateway" : "Bank Deposit" } The name of the payment gateway that was used to process the payment for this order. |
note | { "note" : "This order has top priority." } The text of an optional note that can be attach to the order by the store owner. |
total_weight | { "total_weight" : 200.0 } The total weight of all items in the order, expressed in grams. |
attributes | { "attributes" : { |
financial_status | { "financial_status" : "paid" } Returns the current financial status of the order. The following statuses are used:
|
fulfilment_status | { "fulfilment_status" : null } Returns the current fulfilment status of the order. The following statuses are used:
|
tax_lines | { "tax_lines" : [ An array of
|
cancel_reason | { "cancel_reason" : "Fraudulent order" } If an order has been cancelled, the reason for the cancellation is returned. The following reasons may be returned:
|
cancelled_at | { "cancelled_at" : "2015-02-23T03:02:51Z" } The date and time when the order was cancelled. The timestamp is in ISO 8601 format. |
closed_at | { "closed_at" : "2015-02-23T03:02:51Z" } The date and time when the order was closed. The timestamp is in ISO 8601 format. |
discount_codes | { "discount_codes" : [ An array of
The following discount types are supported:
|
billing_address | { "billing_address" : { Returns the billing address associated with the order. The address has the following properties:
|
shipping_address | { "shipping_address" : { Returns the shipping address associated with the order. The address has the following properties:
|
customer | { "customer" : { Returns an object containing information about the customer. This information is only available if the customer has registered for an account, so this information will not be available for guest checkout orders. Customer objects contain the following fields:
|
line_items | { "line_items" : [ An array of
Items that are marked as gift cards are not taxed or included in any shipping charge calculations. |
fulfilments | { "fulfilments" : [ An array of
|
transactions | { "transactions" : [ An array of
|
Endpoints
GET /api/orders.json
Return a list of open orders. Use the optional status
to return other orders.
Optional Parameters
limit | Number of results returned. The default is 30, with a maximum of 50 in a single request. |
---|---|
page | The number of the page to return. The number of results per page is set by the limit parameter. If more results are required, then submit the request again, increasing the page number each time.
|
ids | A comma-separated list of order ids. |
since_id | Limit the results to only include objects which have an id greater than the given value. |
created_at_min | Return only the orders created after the given date and time. Use the format "2014-12-31 12:00". |
created_at_max | Return only the orders created before the given date and time. Use the format "2014-12-31 12:00". |
updated_at_min | Return only the orders updated after the given date and time. Use the format "2014-12-31 12:00". |
updated_at_max | Return only the orders updated before the given date and time. Use the format "2014-12-31 12:00". |
paid_at_min | Return only the orders paid after the given date and time. Use the format "2014-12-31 12:00". |
paid_at_max | Return only the orders paid before the given date and time. Use the format "2014-12-31 12:00". |
closed_at_min | Return only the orders closed after the given date and time. Use the format "2014-12-31 12:00". |
closed_at_max | Return only the orders closed before the given date and time. Use the format "2014-12-31 12:00". |
status | Return only orders with the given status.
|
financial_status | Return only orders with the given financial status.
|
fulfilment_status | Return only orders with the given fulfilment status.
|
test_status | Return only orders with the given test status.
|
customer_id | Return all the orders belonging to the specified customer. |
Return all orders that have been placed with the specified email address. | |
fields | A comma-separated list of fields to return in the response. If a list of fields is provided, then the customer , billing_address , shipping_address and line_items fields will always be excluded.
|
Example Request and Response
GET /api/orders.json HTTP/1.1 200 OK { "orders": [ { "id": 378, "order_number": 1169, "name": "#01169", "browser_ip": "127.0.0.1", "buyer_accepts_marketing": false, "cart_token": null, "created_at": "2015-02-27T18:08:33Z", "updated_at": "2015-02-27T18:08:33Z", "currency": "AUD", "email": "customer@customer.domain.com", "credit": "0.0", "taxes_included": true, "tax_price": "0.91", "included_tax_price": "0.91", "tax_label": "GST", "discount_price": "0.0", "cart_discount_price": "0.0", "shipping_price": "0.0", "subtotal_price": "10.0", "total_line_items_price": "10.0", "total_price": "10.0", "test": false, "gateway": "Friendly Bank", "note": "Very important customer", "total_weight": 100.0, "financial_status": "authorized", "attributes": { "name": "Timmy" }, "billing_address": { "id": 687, "title": "Mr", "first_name": "Important", "last_name": "Customer", "name":"Mr Important Customer", "company": "", "address1": "1 Main St", "address2": "", "city": "Sydney", "province": "New South Wales", "province_code": "NSW", "country": "Australia", "country_code": "AU", "zip": "1234", "phone": "0291234567" }, "shipping_address": { "id": 688, "title": "Mr", "first_name": "Important", "last_name": "Customer", "name": "Mr Important Customer", "company": "", "address1": "1 Main St", "address2": "", "city": "Sydney", "province": "New South Wales", "province_code": "NSW", "country": "Australia", "country_code": "AU", "zip": "1234", "phone": "0291234567" }, "customer": { "id": 6, "title": "Mr", "first_name": "Important", "last_name": "Customer", "name": "Mr Important Customer", "email": "customer@customer.domain.com", "accepts_marketing": true, "created_at": "2010-06-15T13:15:50Z", "note": "Here is some sample text.", "orders_count": 512, "state": "enabled", "total_spent": "11230.63", "updated_at": "2015-02-23T03:02:51Z", "sign_in_count": 261, "current_sign_in_at": "2015-02-23T03:02:51Z", "current_sign_in_ip": "192.168.10.164", "last_sign_in_at": "2015-02-19T05:58:54Z", "last_sign_in_ip": "192.168.10.164", "wholesale": true, "credit": "0.0", "tags":"friend,wholesaler" }, "fulfilments": [], "line_items": [ { "id": 410, "product_id": 1506, "variation_id": 1691, "product_exists": true, "quantity": 1, "sku": "SHIRT002", "name": "T-Shirt - S - Teal-Blue", "title": "T-Shirt", "variation_title": "S/Teal-Blue", "discount_description": "", "vendor": "Spiffy Stores", "weight": 0.1, "grams": 100.0, "length": 0.0, "width": 0.0, "height": 0.0, "price": "10.0", "wholesale_price": "0.0", "taxable": true, "discount_price": "0.0", "total_price": "10.0", "ship_separately": false, "free_shipping": false, "requires_shipping": true, "fulfilment_service": "manual", "fulfillable_quantity": 1, "shipping_method": "", "instalments": 1, "gift_card": false, "fulfilment_status": null } ], "transactions": [ { "id": 253, "order_id": 378, "amount": "10.0", "authorization": "1156177", "created_at": "2009-02-27T18:08:34Z", "gateway": "Friendly Bank", "kind": "Authorization", "status": "Success", "transaction_id": "", "description": "TRANSACTION APPROVED" } ], "tax_lines": [ { "title": "Including GST", "rate": "0.1", "price": "0.91" } ], "shipping_lines": [], "discount_codes": [] }, ... ] } Examples using filters GET /api/orders.json?status=closed GET /api/orders.json?customer_id=2322
GET /api/orders/count.json
Return a count of open orders. Use the optional status
to return the count of other orders.
Optional Parameters
since_id | Limit the results to only include objects which have an id greater than the given value. |
---|---|
created_at_min | Return only the orders created after the given date and time. Use the format "2014-12-31 12:00". |
created_at_max | Return only the orders created before the given date and time. Use the format "2014-12-31 12:00". |
updated_at_min | Return only the orders updated after the given date and time. Use the format "2014-12-31 12:00". |
updated_at_max | Return only the orders updated before the given date and time. Use the format "2014-12-31 12:00". |
paid_at_min | Return only the orders paid after the given date and time. Use the format "2014-12-31 12:00". |
paid_at_max | Return only the orders paid before the given date and time. Use the format "2014-12-31 12:00". |
closed_at_min | Return only the orders closed after the given date and time. Use the format "2014-12-31 12:00". |
closed_at_max | Return only the orders closed before the given date and time. Use the format "2014-12-31 12:00". |
status | Return only orders with the given status.
|
financial_status | Return only orders with the given financial status.
|
fulfilment_status | Return only orders with the given fulfilment status.
|
test_status | Return only orders with the given test status.
|
customer_id | Return all the orders belonging to the specified customer. |
Return all orders that have been placed with the specified email address. |
Example Request and Response
GET /api/orders/count.json HTTP/1.1 200 OK { "count": 123 } Examples using filters GET /api/orders/count.json?status=closed
GET /api/orders/ORDER_ID.json
Return a single order.
Optional Parameters
fields | A comma-separated list of fields to return in the response. If a list of fields is provided, then the customer , billing_address , shipping_address and line_items fields will always be excluded.
|
---|
Example Request and Response
GET /api/orders/16789.json HTTP/1.1 200 OK { "order": { "id": 16789, "order_number": 23543, "name": "#023543", "browser_ip": "127.0.0.1", "buyer_accepts_marketing": false, "cart_token": null, "created_at": "2015-02-27T18:08:33Z", "updated_at": "2015-02-27T18:08:33Z", ... } }