Difference between revisions of "API Order"

From Spiffy Stores Knowledge Base

Line 85: Line 85:
 
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:
  
* code: This describes the type of shipping method being used
+
* code - This describes the type of shipping method being used
* price: The price for shipping the parcel
+
* price - The price for shipping the parcel
* 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
 
<br/>
 
<br/>
 
The following shipping method codes are used:
 
The following shipping method codes are used:
  
* WEIGHT_BASED - The calculated price is based upon the weight of the parcel
+
; WEIGHT_BASED  
* FREE_SHIPPING - The parcel has free shipping
+
The calculated price is based upon the weight of the parcel
* SHIPPING_CODE - The price for shipping is determined by the Shipping Code
+
; FREE_SHIPPING
 +
The parcel has free shipping
 +
; SHIPPING_CODE
 +
The price for shipping is determined by the Shipping Code
 
|}
 
|}

Revision as of 11:02, 24 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 id, which is only used to refer to orders within the API.

name { "name" : "#001045" }

This is the order_number, formatted according the the store preferences for order number formatting.

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 { "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 true. In a sales tax system, where the amount of sales tax is added to the final amount of the order, then false will be returned.

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 line_items_discount_price.

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" : [
  { "code": "WEIGHT_BASED",
    "price": "7.2",
    "weight": 0.2,
    "title": "Australia Post - Regular Parcel"
  }
] }

An array of shipping_line 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 shipping_line has the following properties:

  • code - This describes the type of shipping method being used
  • price - The price for shipping the parcel
  • weight - The weight of the parcel
  • title - The description for the shipping method


The following shipping method codes are used:

WEIGHT_BASED
The calculated price is based upon the weight of the parcel
FREE_SHIPPING
The parcel has free shipping
SHIPPING_CODE
The price for shipping is determined by the Shipping Code