Class: Falsify::Order
- Inherits:
-
Object
- Object
- Falsify::Order
- Extended by:
- Enumerize
- Defined in:
- lib/falsify/models/order/order.rb
Overview
An order is a customer's completed request to purchase one or more products from a shop. See the API documentation. Required Fields:
- line_items
Instance Attribute Summary collapse
-
#app_id ⇒ String
readonly
The ID of the app that created the order.
-
#billing_address ⇒ Address
The mailing address associated with the payment method.
-
#browser_ip ⇒ String
readonly
The IP address of the browser used by the customer when they placed the order.
-
#buyer_accepts_marketing ⇒ Boolean
Whether the customer consented to receive email updates from the shop.
-
#cancel_reason ⇒ :customer, ...
The reason why the order was canceled.
-
#cancelled_at ⇒ String
readonly
The date and time (ISO 8601 format) when the order was canceled.
-
#cart_token ⇒ String
readonly
The ID of the cart that's associated with the order.
-
#client_details ⇒ ClientDetails
readonly
Information about the browser that the customer used when they placed their order:.
-
#closed_at ⇒ String
readonly
The date and time (ISO 8601 format) when the order was closed.
-
#created_at ⇒ String
readonly
The autogenerated date and time (ISO 8601 format) when the order was created in Shopify.
-
#currency ⇒ String
The three-letter code (ISO 4217 format) for the shop currency.
-
#customer ⇒ Customer?
Information about the customer.
-
#customer_locale ⇒ String
readonly
The two or three-letter language code, optionally followed by a region modifier.
- #discount_applications ⇒ Array<DiscountApplication>
- #discount_codes ⇒ Array<DiscountCode>
-
#email ⇒ String
The customer's email address.
-
#fulfillment_status ⇒ :null, ...
The order's status in terms of fulfilled line items.
-
#fulfillments ⇒ Array<Fulfillment>
A list of fulfillments associated with the order.
-
#gateway ⇒ String
readonly
deprecated
Deprecated.
Use the Transaction resource instead.
-
#landing_site ⇒ String
readonly
The URL for the page where the buyer landed when they entered the shop.
-
#line_items ⇒ Array<LineItem>
A list of line item objects, each containing information about an item in the order.
-
#location_id ⇒ String
The ID of the physical location where the order was processed.
-
#name ⇒ String
readonly
The order name as represented by a number.
-
#note ⇒ String
An optional note that a shop owner can attach to the order.
-
#note_attributes ⇒ Array<Hash>
Extra information that is added to the order.
-
#number ⇒ String
readonly
For internal use only.
-
#order_number ⇒ String
readonly
The ID of the order used by the shop owner and customer.
-
#order_status_url ⇒ String
readonly
The URL pointing to the order status web page, if applicable.
-
#payment_details ⇒ String
readonly
deprecated
Deprecated.
Use the Transaction resource instead.
-
#payment_gateway_names ⇒ Array<String>
readonly
The list of payment gateways used for the order.
-
#phone ⇒ String
The customer's phone number for receiving SMS notifications.
-
#presentment_currency ⇒ String
The presentment currency that was used to display prices to the customer.
-
#processed_at ⇒ String
The date and time (ISO 8601 format) when an order was processed.
-
#processing_method ⇒ :checkout, ...
readonly
How the payment was processed.
-
#referring_site ⇒ String
The website where the customer clicked a link to the shop.
-
#refunds ⇒ Array<Refund>
readonly
A list of refunds applied to the order.
-
#shipping_address ⇒ Address
The mailing address to where the order will be shipped.
-
#shipping_lines ⇒ Array<ShippingLine>
An array of objects, each of which details a shipping method used.
-
#shopify_id ⇒ String
readonly
The ID of the order, used for API purposes.
-
#source_name ⇒ String
Where the order originated.
-
#subtotal_price ⇒ String
The price of the order in the shop currency after discounts but before shipping, taxes, and tips.
-
#subtotal_price_set ⇒ PriceSet
The subtotal of the order in shop and presentment currencies.
-
#tags ⇒ String
Tags attached to the order, formatted as a string of comma-separated values.
-
#tax_lines ⇒ Array<TaxLine>
An array of tax line objects, each of which details a tax applicable to the order.
-
#taxes_included ⇒ Boolean
Whether taxes are included in the order subtotal.
-
#test ⇒ Boolean
Whether this is a test order.
-
#token ⇒ String
readonly
A unique token for the order.
-
#total_discounts ⇒ String
The total discounts applied to the price of the order in the shop currency.
-
#total_discounts_set ⇒ PriceSet
The total discounts applied to the price of the order in shop and presentment currencies.
-
#total_line_items_price ⇒ String
The sum of all line item prices in the shop currency.
-
#total_line_items_price_set ⇒ String
The total of all line item prices in shop and presentment currencies.
-
#total_price ⇒ String
The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency.
-
#total_price_set ⇒ PriceSet
The total price of the order in shop and presentment currencies.
-
#total_tax ⇒ String
The sum of all the taxes applied to the order in the shop currency.
-
#total_tax_set ⇒ PriceSet
The total tax applied to the order in shop and presentment currencies.
-
#total_tip_received ⇒ String
The sum of all the tips in the order in the shop currency.
-
#total_weight ⇒ String
The sum of all line item weights in grams.
-
#updated_at ⇒ String
readonly
The date and time (ISO 8601 format) when the order was last modified.
-
#user_id ⇒ String
The ID of the user logged into Shopify POS who processed the order, if applicable.
Instance Method Summary collapse
-
#financial_status ⇒ :pending, ...
The status of payments associated with the order.
Instance Attribute Details
#app_id ⇒ String (readonly)
The ID of the app that created the order.
12 13 14 |
# File 'lib/falsify/models/order/order.rb', line 12 def app_id @app_id end |
#billing_address ⇒ Address
The mailing address associated with the payment method. This address is an optional field that won't be available on orders that do not require a payment method.
16 17 18 |
# File 'lib/falsify/models/order/order.rb', line 16 def billing_address @billing_address end |
#browser_ip ⇒ String (readonly)
The IP address of the browser used by the customer when they placed the order.
19 20 21 |
# File 'lib/falsify/models/order/order.rb', line 19 def browser_ip @browser_ip end |
#buyer_accepts_marketing ⇒ Boolean
Whether the customer consented to receive email updates from the shop.
22 23 24 |
# File 'lib/falsify/models/order/order.rb', line 22 def buyer_accepts_marketing @buyer_accepts_marketing end |
#cancel_reason ⇒ :customer, ...
The reason why the order was canceled.
:customer
- The customer canceled the order.:fraud
- The order was fraudulent.:inventory
- Items in the order were not in inventory.:declined
- The payment was declined.:other
- A reason not in this list.
32 |
# File 'lib/falsify/models/order/order.rb', line 32 enumerize :cancel_reason, in: [:customer, :fraud, :inventory, :declined, :other] |
#cancelled_at ⇒ String (readonly)
The date and time (ISO 8601 format) when the order was canceled.
35 36 37 |
# File 'lib/falsify/models/order/order.rb', line 35 def cancelled_at @cancelled_at end |
#cart_token ⇒ String (readonly)
The ID of the cart that's associated with the order.
38 39 40 |
# File 'lib/falsify/models/order/order.rb', line 38 def cart_token @cart_token end |
#client_details ⇒ ClientDetails (readonly)
Information about the browser that the customer used when they placed their order:
41 42 43 |
# File 'lib/falsify/models/order/order.rb', line 41 def client_details @client_details end |
#closed_at ⇒ String (readonly)
The date and time (ISO 8601 format) when the order was closed.
44 45 46 |
# File 'lib/falsify/models/order/order.rb', line 44 def closed_at @closed_at end |
#created_at ⇒ String (readonly)
The autogenerated date and time (ISO 8601 format) when the order was created in Shopify. The value for this property cannot be changed.
48 49 50 |
# File 'lib/falsify/models/order/order.rb', line 48 def created_at @created_at end |
#currency ⇒ String
The three-letter code (ISO 4217 format) for the shop currency.
51 52 53 |
# File 'lib/falsify/models/order/order.rb', line 51 def currency @currency end |
#customer ⇒ Customer?
Information about the customer.
The order might not have a customer and apps should not depend on the existence of a customer
object.
This value might be null
if the order was created through Shopify POS.
For more information about the customer
object, see the Customer resource.
57 58 59 |
# File 'lib/falsify/models/order/order.rb', line 57 def customer @customer end |
#customer_locale ⇒ String (readonly)
The two or three-letter language code, optionally followed by a region modifier.
60 61 62 |
# File 'lib/falsify/models/order/order.rb', line 60 def customer_locale @customer_locale end |
#discount_applications ⇒ Array<DiscountApplication>
62 63 64 |
# File 'lib/falsify/models/order/order.rb', line 62 def discount_applications @discount_applications end |
#discount_codes ⇒ Array<DiscountCode>
64 65 66 |
# File 'lib/falsify/models/order/order.rb', line 64 def discount_codes @discount_codes end |
#email ⇒ String
The customer's email address.
67 68 69 |
# File 'lib/falsify/models/order/order.rb', line 67 def email @email end |
#fulfillment_status ⇒ :null, ...
The order's status in terms of fulfilled line items.
:fulfilled
- Every line item in the order has been fulfilled.:null
- None of the line items in the order have been fulfilled.:partial
- At least one line item in the order has been fulfilled.:restocked
- Every line item in the order has been restocked and the order canceled.
91 |
# File 'lib/falsify/models/order/order.rb', line 91 enumerize :fulfillment_status, in: [:null, :fulfilled, :partial, :restocked] |
#fulfillments ⇒ Array<Fulfillment>
A list of fulfillments associated with the order. For more information, see the Fulfillment API.
82 83 84 |
# File 'lib/falsify/models/order/order.rb', line 82 def fulfillments @fulfillments end |
#gateway ⇒ String (readonly)
Use the Transaction resource instead.
The payment gateway used.
95 96 97 |
# File 'lib/falsify/models/order/order.rb', line 95 def gateway @gateway end |
#landing_site ⇒ String (readonly)
The URL for the page where the buyer landed when they entered the shop.
102 103 104 |
# File 'lib/falsify/models/order/order.rb', line 102 def landing_site @landing_site end |
#line_items ⇒ Array<LineItem>
A list of line item objects, each containing information about an item in the order.
105 106 107 |
# File 'lib/falsify/models/order/order.rb', line 105 def line_items @line_items end |
#location_id ⇒ String
The ID of the physical location where the order was processed.
108 109 110 |
# File 'lib/falsify/models/order/order.rb', line 108 def location_id @location_id end |
#name ⇒ String (readonly)
The order name as represented by a number.
Must start with #
.
112 113 114 |
# File 'lib/falsify/models/order/order.rb', line 112 def name @name end |
#note ⇒ String
An optional note that a shop owner can attach to the order.
115 116 117 |
# File 'lib/falsify/models/order/order.rb', line 115 def note @note end |
#note_attributes ⇒ Array<Hash>
Extra information that is added to the order.
Appears in the Additional details section of an order details page.
Each array entry must contain a hash with name
and value
keys.
120 121 122 |
# File 'lib/falsify/models/order/order.rb', line 120 def note_attributes @note_attributes end |
#number ⇒ String (readonly)
For internal use only. An ID unique to the shop. Numbers are sequential and start at 1000.
125 126 127 |
# File 'lib/falsify/models/order/order.rb', line 125 def number @number end |
#order_number ⇒ String (readonly)
The ID of the order used by the shop owner and customer.
This is different from the shopify_id
property, which is the ID of the order used by the API.
129 130 131 |
# File 'lib/falsify/models/order/order.rb', line 129 def order_number @order_number end |
#order_status_url ⇒ String (readonly)
The URL pointing to the order status web page, if applicable.
246 247 248 |
# File 'lib/falsify/models/order/order.rb', line 246 def order_status_url @order_status_url end |
#payment_details ⇒ String (readonly)
Use the Transaction resource instead.
An object containing information about the payment.
133 134 135 |
# File 'lib/falsify/models/order/order.rb', line 133 def payment_details @payment_details end |
#payment_gateway_names ⇒ Array<String> (readonly)
The list of payment gateways used for the order.
136 137 138 |
# File 'lib/falsify/models/order/order.rb', line 136 def payment_gateway_names @payment_gateway_names end |
#phone ⇒ String
The customer's phone number for receiving SMS notifications.
139 140 141 |
# File 'lib/falsify/models/order/order.rb', line 139 def phone @phone end |
#presentment_currency ⇒ String
The presentment currency that was used to display prices to the customer.
142 143 144 |
# File 'lib/falsify/models/order/order.rb', line 142 def presentment_currency @presentment_currency end |
#processed_at ⇒ String
The date and time (ISO 8601 format) when an order was processed.
This value is the date that appears on your orders and that's used in the analytic reports.
By default, it matches the created_at
value.
If you're importing orders from an app or another platform, then you can set processed_at
to a date and time in the past to match when the original order was created.
148 149 150 |
# File 'lib/falsify/models/order/order.rb', line 148 def processed_at @processed_at end |
#processing_method ⇒ :checkout, ... (readonly)
How the payment was processed.
:checkout
- The order was processed using the Shopify checkout.:direct
- The order was processed using a direct payment provider.:manual
- The order was processed using a manual payment method.:offsite
- The order was processed by an external payment provider to the Shopify checkout.:express
- The order was processed using PayPal Express Checkout.:free
- The order was processed as a free order using a discount code.
159 |
# File 'lib/falsify/models/order/order.rb', line 159 enumerize :processing_method, in: [:checkout, :direct, :manual, :offsite, :express, :free] |
#referring_site ⇒ String
The website where the customer clicked a link to the shop.
162 163 164 |
# File 'lib/falsify/models/order/order.rb', line 162 def referring_site @referring_site end |
#refunds ⇒ Array<Refund> (readonly)
A list of refunds applied to the order. For more information, see the Refund API.
166 167 168 |
# File 'lib/falsify/models/order/order.rb', line 166 def refunds @refunds end |
#shipping_address ⇒ Address
The mailing address to where the order will be shipped. This address is optional and will not be available on orders that do not require shipping.
170 171 172 |
# File 'lib/falsify/models/order/order.rb', line 170 def shipping_address @shipping_address end |
#shipping_lines ⇒ Array<ShippingLine>
An array of objects, each of which details a shipping method used.
173 174 175 |
# File 'lib/falsify/models/order/order.rb', line 173 def shipping_lines @shipping_lines end |
#shopify_id ⇒ String (readonly)
The ID of the order, used for API purposes.
This is different from the order_number
property, which is the ID used by the shop owner and customer.
99 100 101 |
# File 'lib/falsify/models/order/order.rb', line 99 def shopify_id @shopify_id end |
#source_name ⇒ String
Where the order originated.
Can be set only during order creation, and is not writeable afterwards.
Values for Shopify channels are protected and cannot be assigned by other API clients: web
, pos
, shopify_draft_order
, iphone
, and android
.
Orders created via the API can be assigned any other string of your choice.
If unspecified, then new orders are assigned the value of your app's ID.
180 181 182 |
# File 'lib/falsify/models/order/order.rb', line 180 def source_name @source_name end |
#subtotal_price ⇒ String
The price of the order in the shop currency after discounts but before shipping, taxes, and tips.
183 184 185 |
# File 'lib/falsify/models/order/order.rb', line 183 def subtotal_price @subtotal_price end |
#subtotal_price_set ⇒ PriceSet
The subtotal of the order in shop and presentment currencies.
186 187 188 |
# File 'lib/falsify/models/order/order.rb', line 186 def subtotal_price_set @subtotal_price_set end |
#tags ⇒ String
Tags attached to the order, formatted as a string of comma-separated values. Tags are additional short descriptors, commonly used for filtering and searching. Each individual tag is limited to 40 characters in length.
191 192 193 |
# File 'lib/falsify/models/order/order.rb', line 191 def @tags end |
#tax_lines ⇒ Array<TaxLine>
An array of tax line objects, each of which details a tax applicable to the order.
194 195 196 |
# File 'lib/falsify/models/order/order.rb', line 194 def tax_lines @tax_lines end |
#taxes_included ⇒ Boolean
Whether taxes are included in the order subtotal.
197 198 199 |
# File 'lib/falsify/models/order/order.rb', line 197 def taxes_included @taxes_included end |
#test ⇒ Boolean
Whether this is a test order.
200 201 202 |
# File 'lib/falsify/models/order/order.rb', line 200 def test @test end |
#token ⇒ String (readonly)
A unique token for the order.
203 204 205 |
# File 'lib/falsify/models/order/order.rb', line 203 def token @token end |
#total_discounts ⇒ String
The total discounts applied to the price of the order in the shop currency.
206 207 208 |
# File 'lib/falsify/models/order/order.rb', line 206 def total_discounts @total_discounts end |
#total_discounts_set ⇒ PriceSet
The total discounts applied to the price of the order in shop and presentment currencies.
209 210 211 |
# File 'lib/falsify/models/order/order.rb', line 209 def total_discounts_set @total_discounts_set end |
#total_line_items_price ⇒ String
The sum of all line item prices in the shop currency.
212 213 214 |
# File 'lib/falsify/models/order/order.rb', line 212 def total_line_items_price @total_line_items_price end |
#total_line_items_price_set ⇒ String
The total of all line item prices in shop and presentment currencies.
215 216 217 |
# File 'lib/falsify/models/order/order.rb', line 215 def total_line_items_price_set @total_line_items_price_set end |
#total_price ⇒ String
The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency. Must be positive.
219 220 221 |
# File 'lib/falsify/models/order/order.rb', line 219 def total_price @total_price end |
#total_price_set ⇒ PriceSet
The total price of the order in shop and presentment currencies.
222 223 224 |
# File 'lib/falsify/models/order/order.rb', line 222 def total_price_set @total_price_set end |
#total_tax ⇒ String
The sum of all the taxes applied to the order in the shop currency. Must be positive.
226 227 228 |
# File 'lib/falsify/models/order/order.rb', line 226 def total_tax @total_tax end |
#total_tax_set ⇒ PriceSet
The total tax applied to the order in shop and presentment currencies.
229 230 231 |
# File 'lib/falsify/models/order/order.rb', line 229 def total_tax_set @total_tax_set end |
#total_tip_received ⇒ String
The sum of all the tips in the order in the shop currency.
232 233 234 |
# File 'lib/falsify/models/order/order.rb', line 232 def total_tip_received @total_tip_received end |
#total_weight ⇒ String
The sum of all line item weights in grams.
235 236 237 |
# File 'lib/falsify/models/order/order.rb', line 235 def total_weight @total_weight end |
#updated_at ⇒ String (readonly)
240 241 242 |
# File 'lib/falsify/models/order/order.rb', line 240 def updated_at @updated_at end |
#user_id ⇒ String
The ID of the user logged into Shopify POS who processed the order, if applicable.
243 244 245 |
# File 'lib/falsify/models/order/order.rb', line 243 def user_id @user_id end |
Instance Method Details
#financial_status ⇒ :pending, ...
The status of payments associated with the order. Can only be set when the order is created.
:pending
- The payments are pending. Payment might fail in this state. Check again to confirm whether the payments have been paid successfully.:authorized
- The payments have been authorized.:partially_paid
- The order have been partially paid.:paid
- The payments have been paid.:partially_refunded
- The payments have been partially refunded.:refunded
- The payments have been refunded.:voided
- The payments have been voided.
78 |
# File 'lib/falsify/models/order/order.rb', line 78 enumerize :financial_status, in: [:pending, :authorized, :partially_paid, :paid, :partially_refunded, :refunded, :voided] |