Difference between revisions of "API Order"
From Spiffy Stores Knowledge Base
Line 257: | Line 257: | ||
|- | |- | ||
|line_items | |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": " | + | |<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/> }] }</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: | ||
+ | |||
+ | * id - A unique identifier for the line item | ||
+ | * fulfillable_quantity: The amount available to fulfill. This is the quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity. | ||
+ | * fulfillment_service: Service provider who is doing the fulfillment. Valid values are either "manual" or the name of the provider. eg: "amazon", "shipwire", etc. | ||
+ | * fulfillment_status: How far along an order is in terms line items fulfilled. Valid values are: fulfilled, null or partial. | ||
+ | * grams: The weight of the item in grams. | ||
+ | * price: The price of the item. | ||
+ | * product_id: The unique numeric identifier for the product in the fulfillment. Can be null if the original product associated with the order is deleted at a later date | ||
+ | * quantity: The number of products that were purchased. | ||
+ | * requires_shipping: States whether or not the fulfillment requires shipping. Values are: true or false. | ||
+ | * sku: A unique identifier of the item in the fulfillment. | ||
+ | * title: The title of the product. | ||
+ | * variant_id: The id of the product variant. | ||
+ | * variant_title: The title of the product variant. | ||
+ | * vendor: The name of the supplier of the item. | ||
+ | * name: The name of the product variant. | ||
+ | * gift_card: States wether or not the line_item is a gift card. If so, the item is not taxed or considered for shipping charges. | ||
+ | * taxable: States whether or not the product was taxable. Values are: true or false. | ||
+ | * tax_lines: A list of tax_line objects, each of which details the taxes applicable to this line_item. | ||
+ | |||
|} | |} |
Revision as of 12:01, 25 February 2015
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
|
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. |
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
|