A sales order represents a sale of goods.

Properties:

id - Integer - Unique id of the sales order

name - String - Helper method that tries to associate a name with the order by trying the customer's name, then the billing address name, then the shipping address name. The first one to return a name is used. If no name is found the string 'No Name' will be returned.

order_number - Integer - Unique and sequential number used to identify and order that has been placed

order_hash - String - Unique and opaque identifier for the order. Our system uses this value to lookup an order on the receipt page. Example: /receipts/2923a1fd-0539-4753-9fe4-fe151fb34130 

amazon_order_id - String - The ID provided by Amazon for orders placed on Amazon

email - String - Email address where the receipt and tracking emails are to be delivered

status - String - One of: pending, placed, in_review, partially_back_ordered, back_ordered, completed, cancelled, deleted

discounted? - Boolean - Indicates if a discount has been applied directly to the order.

discount_total - Decimal - Total amount of the discount

discount_description - String - Description of the discount applied to the order

customer - Customer - The customer who placed the order. Can be nil if the order was placed by a guest.

location - Location - The location assigned to the order. Typically where the order ships or is picked up from.

subtotal - Decimal - The order subtotal which is the item total minus the discount_total minus the promo_total

tax - Decimal - The amount of tax on the order

shipping - Decimal - The shipping price the customer pays for the order

total - Decimal - The amount the customer pays for the order

shipping_address - Address - The address where the order is to be shipped

billing_address - Address - The billing address for the order. This is where invoices will be mailed or orders placed using the invoice  payment method.

placed_at - DateTime - The date and time when the order was placed

shipping_method - ShippingMethod - The shipping method used for the order

shipping_method_name - String - The name of the shipping method. Example: StandardShipping or FedEx Ground 

payment_method - String - One of: CreditCard, Paypal, Invoice, Check, Cash, or Pay On Pickup, or Manual Collection

payment_details - String - Details about the payment method which could be the credit card type and last four digits or the number or a check number, etc.

po_number - String - A reference number used by the customer

comments - String - Comments about the order. These are visible to the customer whereas notes are not.

carrier - String - When the customer specifies that they want to ship their goods using their own carrier account the name of the carrier will be here.

carrier_account - String - When the customer specifies that they want to ship their goods using their own carrier account, the account number for their carrier will be here.

gsa? - Boolean - Indicates if any of the items on the order have gsa pricing applied or if the customer is eligible for gsa pricing

ship_blind? - Boolean - Indicates if the customer has requested that the goods be blind shipped

pickup? - Boolean - Indicates if the order is to be picked up at a location rather than being shipped. When true, the location on the order is where the order will be picked up.

first_time_order? - Boolean - Indicates if this is the customer's first order

preorder_products? - Boolean - Indicates if the order contains products marked for preorder

item_count - Integer - The number of items on the order

items - [SalesOrderItem] - Array of items on the order

shipments - [Shipment] - Array of shipments for the order

packages - [Package] - Array of packages being shipped for the order

promo_codes - [PromoCode] - Array of promo codes used on the sales order

url - String - URL to the receipt page for the order on your store. Uses the order_hash for identification. Example: https://your.domain/receipts/2923a1fd-0539-4753-9fe4-fe151fb34130

completely_shipped? - Boolean - Indicates if the order has been completely fulfilled

ga_tracking_path - String - URL to use for Google Analytics e-commerce tracking. All the logic necessary to report to GA about the sale has been done for you. On your receipt page, simply add:

<script src="{{ order.ga_tracking_path }}"></script>

Did this answer your question?