falsify 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rubocop.yml +123 -0
- data/.travis.yml +7 -0
- data/.yardopts +2 -0
- data/CHANGELOG.md +31 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +75 -0
- data/LICENSE.txt +21 -0
- data/README.md +44 -0
- data/Rakefile +10 -0
- data/bin/console +10 -0
- data/bin/docs +3 -0
- data/bin/setup +8 -0
- data/falsify.gemspec +39 -0
- data/lib/falsify.rb +4 -0
- data/lib/falsify/error.rb +5 -0
- data/lib/falsify/models/address.rb +54 -0
- data/lib/falsify/models/customer/customer.rb +114 -0
- data/lib/falsify/models/customer/metafield.rb +36 -0
- data/lib/falsify/models/fulfillment/fulfillment.rb +96 -0
- data/lib/falsify/models/fulfillment/fulfillment_event.rb +75 -0
- data/lib/falsify/models/fulfillment/fulfillment_line_item.rb +75 -0
- data/lib/falsify/models/fulfillment/supported_tracking_companies.rb +51 -0
- data/lib/falsify/models/order/client_details.rb +36 -0
- data/lib/falsify/models/order/discount_allocation.rb +15 -0
- data/lib/falsify/models/order/discount_application.rb +62 -0
- data/lib/falsify/models/order/discount_code.rb +26 -0
- data/lib/falsify/models/order/order.rb +248 -0
- data/lib/falsify/models/order/order_line_item.rb +102 -0
- data/lib/falsify/models/order/price_set.rb +52 -0
- data/lib/falsify/models/order/refund/refund.rb +72 -0
- data/lib/falsify/models/order/refund/refund_line_item.rb +0 -0
- data/lib/falsify/models/order/shipping_line.rb +39 -0
- data/lib/falsify/models/order/tax_line.rb +14 -0
- data/lib/falsify/models/product/collection/collect.rb +29 -0
- data/lib/falsify/models/product/collection/custom_collection.rb +72 -0
- data/lib/falsify/models/product/collection/smart_collection.rb +181 -0
- data/lib/falsify/models/product/product.rb +83 -0
- data/lib/falsify/models/product/product_image.rb +39 -0
- data/lib/falsify/models/product/product_variant.rb +111 -0
- data/lib/falsify/version.rb +3 -0
- metadata +214 -0
@@ -0,0 +1,36 @@
|
|
1
|
+
module Falsify
|
2
|
+
# Information about the browser that the customer used when they placed their order.
|
3
|
+
class ClientDetails
|
4
|
+
# The languages and locales that the browser understands.
|
5
|
+
# @return [String]
|
6
|
+
attr_accessor :accept_language
|
7
|
+
# The browser screen height in pixels, if available.
|
8
|
+
# @return [Integer]
|
9
|
+
attr_accessor :browser_height
|
10
|
+
# The browser IP address.
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :browser_ip
|
13
|
+
# The browser screen width in pixels, if available.
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :browser_width
|
16
|
+
# A hash of the session.
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :session_hash
|
19
|
+
# Details of the browsing client, including software and operating versions.
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :user_agent
|
22
|
+
|
23
|
+
# @param hash [Hash]
|
24
|
+
# @return [ClientDetails]
|
25
|
+
def create_from_hash(hash)
|
26
|
+
cd = ClientDetails.new
|
27
|
+
cd.accept_language = hash[:accept_language]
|
28
|
+
cd.browser_height = hash[:browser_height]
|
29
|
+
cd.browser_ip = hash[:browser_ip]
|
30
|
+
cd.browser_width = hash[:browser_width]
|
31
|
+
cd.session_hash = hash[:session_hash]
|
32
|
+
cd.user_agent = hash[:user_agent]
|
33
|
+
return cd
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Falsify
|
2
|
+
# An amount allocated by discount applications.
|
3
|
+
# Each discount allocation is associated to a particular discount application.
|
4
|
+
class DiscountAllocation
|
5
|
+
# The discount amount allocated to the line in the shop currency.
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :amount
|
8
|
+
# The index of the associated discount application in the order's discount_applications list.
|
9
|
+
# @return [String]
|
10
|
+
attr_accessor :discount_application_index
|
11
|
+
# The discount amount allocated to the line item in shop and presentment currencies.
|
12
|
+
# @return [PriceSet]
|
13
|
+
attr_accessor :amount_set
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require "enumerize"
|
2
|
+
|
3
|
+
module Falsify
|
4
|
+
# An ordered list of stacked discount applications.
|
5
|
+
# The `discount_applications` property includes 3 types: `discount_code`, `manual`, and `script`.
|
6
|
+
# All 3 types share a common structure and have some type specific attributes.
|
7
|
+
class DiscountApplication
|
8
|
+
extend Enumerize
|
9
|
+
# @!attribute allocation_method [rw]
|
10
|
+
# The method by which the discount application value has been allocated to entitled lines.
|
11
|
+
# - `across`: The value is spread across all entitled lines.
|
12
|
+
# - `each`: The value is applied onto every entitled line.
|
13
|
+
# - `one`: The value is applied onto a single line.
|
14
|
+
# @return [:across, :each, :one]
|
15
|
+
enumerize :allocation_method, in: [:across, :each, :one]
|
16
|
+
# The discount code that was used to apply the discount.
|
17
|
+
# Available only for discount code applications.
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :code
|
20
|
+
# The description of the discount application, as defined by the merchant or the Shopify Script.
|
21
|
+
# Available only for manual and script discount applications.
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :description
|
24
|
+
# @!attribute target_selection [rw]
|
25
|
+
# The lines on the order, of the type defined by `target_type`, that the discount is allocated over.
|
26
|
+
# - `all`: The discount is allocated onto all lines,
|
27
|
+
# - `entitled`: The discount is allocated only onto lines it is entitled for.
|
28
|
+
# - `explicit`: The discount is allocated onto explicitly selected lines.
|
29
|
+
# @return [:all, :entitled, :explicit]
|
30
|
+
enumerize :target_selection, in: [:all, :entitled, :explicit]
|
31
|
+
# @!attribute target_type [rw]
|
32
|
+
# The type of line on the order that the discount is applicable on.
|
33
|
+
# Valid values:
|
34
|
+
# - `line_item`: The discount applies to line items.
|
35
|
+
# - `shipping_line`: The discount applies to shipping lines.
|
36
|
+
# @return [:line_item, :shipping_line]
|
37
|
+
enumerize :target_selection, in: [:line_item, :shipping_line]
|
38
|
+
# The title of the discount application, as defined by the merchant.
|
39
|
+
# Available only for manual discount applications.
|
40
|
+
# @return [String]
|
41
|
+
attr_accessor :title
|
42
|
+
# @!attribute type [rw]
|
43
|
+
# The discount application type.
|
44
|
+
# - `manual`: The discount was manually applied by the merchant (for example, by using an app or creating a draft order).
|
45
|
+
# - `script`: The discount was applied by a Shopify Script.
|
46
|
+
# - `discount_code`: The discount was applied by a discount code.
|
47
|
+
# @return [:manual, :script, :discount_code]
|
48
|
+
enumerize :type, in: [:manual, :script, :discount_code]
|
49
|
+
# The value of the discount application as a decimal.
|
50
|
+
# This represents the intention of the discount application.
|
51
|
+
# For example, if the intent was to apply a 20% discount, then the value will be `20.0`.
|
52
|
+
# If the intent was to apply a $15 discount, then the value will be `15.0`.
|
53
|
+
# @return [String]
|
54
|
+
attr_accessor :value
|
55
|
+
# @!attribute value_type [rw]
|
56
|
+
# The type of the value.
|
57
|
+
# - `fixed_amount`: A fixed amount discount value in the currency of the order.
|
58
|
+
# - `percentage`: A percentage discount value.
|
59
|
+
# @return [:fixed_amount, :percentage]
|
60
|
+
enumerize :value_type, in: [:fixed_amount, :percentage]
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "enumerize"
|
2
|
+
|
3
|
+
module Falsify
|
4
|
+
# Discount codes to be applied to an order.
|
5
|
+
class DiscountCode
|
6
|
+
extend Enumerize
|
7
|
+
# The value of the discount to be deducted from the order total.
|
8
|
+
# The `type` field determines how this value is calculated.
|
9
|
+
# After an order is created, this field returns the calculated amount.
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :amount
|
12
|
+
# The discount code.
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :code
|
15
|
+
# @!attribute type [rw]
|
16
|
+
# The type of discount.
|
17
|
+
# Default value: `fixed_amount`.
|
18
|
+
# Valid values:
|
19
|
+
# - `fixed_amount`: Applies `amount ` as a unit of the store's currency. For example, if `amount` is 30 and the store's currency is USD, then 30 USD is deducted from the order total when the discount is applied.
|
20
|
+
# - `percentage`: Applies a discount of `amount` as a percentage of the order total.
|
21
|
+
# - `shipping`: Applies a free shipping discount on orders that have a shipping rate less than or equal to `amount`. For example, if `amount` is 30, then the discount will give the customer free shipping for any shipping rate that is less than or equal to $30.
|
22
|
+
#
|
23
|
+
# @return [:fixed_amount, :percentage, :shipping]
|
24
|
+
enumerize :status, in: [:fixed_amount, :percentage, :shipping]
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,248 @@
|
|
1
|
+
require "enumerize"
|
2
|
+
|
3
|
+
module Falsify
|
4
|
+
# An order is a customer's completed request to purchase one or more products from a shop.
|
5
|
+
# See the [API documentation](https://help.shopify.com/en/api/reference/orders/order).
|
6
|
+
# Required Fields:
|
7
|
+
# - line_items
|
8
|
+
class Order
|
9
|
+
extend Enumerize
|
10
|
+
# The ID of the app that created the order.
|
11
|
+
# @return [String]
|
12
|
+
attr_reader :app_id
|
13
|
+
# The mailing address associated with the payment method.
|
14
|
+
# This address is an optional field that won't be available on orders that do not require a payment method.
|
15
|
+
# @return [Address]
|
16
|
+
attr_accessor :billing_address
|
17
|
+
# The IP address of the browser used by the customer when they placed the order.
|
18
|
+
# @return [String]
|
19
|
+
attr_reader :browser_ip
|
20
|
+
# Whether the customer consented to receive email updates from the shop.
|
21
|
+
# @return [Boolean]
|
22
|
+
attr_accessor :buyer_accepts_marketing
|
23
|
+
# @!attribute cancel_reason [rw]
|
24
|
+
# The reason why the order was canceled.
|
25
|
+
# - `:customer` - The customer canceled the order.
|
26
|
+
# - `:fraud` - The order was fraudulent.
|
27
|
+
# - `:inventory` - Items in the order were not in inventory.
|
28
|
+
# - `:declined` - The payment was declined.
|
29
|
+
# - `:other` - A reason not in this list.
|
30
|
+
#
|
31
|
+
# @return [:customer, :fraud, :inventory, :declined, :other]
|
32
|
+
enumerize :cancel_reason, in: [:customer, :fraud, :inventory, :declined, :other]
|
33
|
+
# The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the order was canceled.
|
34
|
+
# @return [String]
|
35
|
+
attr_reader :cancelled_at
|
36
|
+
# The ID of the cart that's associated with the order.
|
37
|
+
# @return [String]
|
38
|
+
attr_reader :cart_token
|
39
|
+
# Information about the browser that the customer used when they placed their order:
|
40
|
+
# @return [ClientDetails]
|
41
|
+
attr_reader :client_details
|
42
|
+
# The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the order was closed.
|
43
|
+
# @return [String]
|
44
|
+
attr_reader :closed_at
|
45
|
+
# The autogenerated date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the order was created in Shopify.
|
46
|
+
# The value for this property cannot be changed.
|
47
|
+
# @return [String]
|
48
|
+
attr_reader :created_at
|
49
|
+
# The three-letter code ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format) for the shop currency.
|
50
|
+
# @return [String]
|
51
|
+
attr_accessor :currency
|
52
|
+
# Information about the customer.
|
53
|
+
# The order might not have a customer and apps should not depend on the existence of a `customer` object.
|
54
|
+
# This value might be `null` if the order was created through Shopify POS.
|
55
|
+
# For more information about the `customer` object, see the [Customer resource](https://help.shopify.com/en/api/reference/customers/customer).
|
56
|
+
# @return [Customer,nil]
|
57
|
+
attr_accessor :customer
|
58
|
+
# The two or three-letter language code, optionally followed by a region modifier.
|
59
|
+
# @return [String]
|
60
|
+
attr_reader :customer_locale
|
61
|
+
# @return [Array<DiscountApplication>]
|
62
|
+
attr_accessor :discount_applications
|
63
|
+
# @return [Array<DiscountCode>]
|
64
|
+
attr_accessor :discount_codes
|
65
|
+
# The customer's email address.
|
66
|
+
# @return [String]
|
67
|
+
attr_accessor :email
|
68
|
+
# The status of payments associated with the order.
|
69
|
+
# Can only be set when the order is created.
|
70
|
+
# - `:pending` - The payments are pending. Payment might fail in this state. Check again to confirm whether the payments have been paid successfully.
|
71
|
+
# - `:authorized` - The payments have been authorized.
|
72
|
+
# - `:partially_paid` - The order have been partially paid.
|
73
|
+
# - `:paid` - The payments have been paid.
|
74
|
+
# - `:partially_refunded` - The payments have been partially refunded.
|
75
|
+
# - `:refunded` - The payments have been refunded.
|
76
|
+
# - `:voided` - The payments have been voided.
|
77
|
+
# @return [:pending, :authorized, :partially_paid, :paid, :partially_refunded, :refunded, :voided]
|
78
|
+
enumerize :financial_status, in: [:pending, :authorized, :partially_paid, :paid, :partially_refunded, :refunded, :voided]
|
79
|
+
# A list of fulfillments associated with the order.
|
80
|
+
# For more information, see the [Fulfillment API](https://help.shopify.com/en/api/reference/shipping-and-fulfillment/fulfillment).
|
81
|
+
# @return [Array<Fulfillment>]
|
82
|
+
attr_accessor :fulfillments
|
83
|
+
# @!attribute fulfillment_status [rw]
|
84
|
+
# The order's status in terms of fulfilled line items.
|
85
|
+
# - `:fulfilled` - Every line item in the order has been fulfilled.
|
86
|
+
# - `:null` - None of the line items in the order have been fulfilled.
|
87
|
+
# - `:partial` - At least one line item in the order has been fulfilled.
|
88
|
+
# - `:restocked` - Every line item in the order has been restocked and the order canceled.
|
89
|
+
#
|
90
|
+
# @return [:null, :fulfilled, :partial, :restocked]
|
91
|
+
enumerize :fulfillment_status, in: [:null, :fulfilled, :partial, :restocked]
|
92
|
+
# The payment gateway used.
|
93
|
+
# @deprecated Use the [Transaction resource](https://help.shopify.com/en/api/reference/orders/transaction) instead.
|
94
|
+
# @return [String]
|
95
|
+
attr_reader :gateway
|
96
|
+
# The ID of the order, used for API purposes.
|
97
|
+
# This is different from the `order_number` property, which is the ID used by the shop owner and customer.
|
98
|
+
# @return [String]
|
99
|
+
attr_reader :shopify_id
|
100
|
+
# The URL for the page where the buyer landed when they entered the shop.
|
101
|
+
# @return [String]
|
102
|
+
attr_reader :landing_site
|
103
|
+
# A list of line item objects, each containing information about an item in the order.
|
104
|
+
# @return [Array<LineItem>]
|
105
|
+
attr_accessor :line_items
|
106
|
+
# The ID of the physical location where the order was processed.
|
107
|
+
# @return [String]
|
108
|
+
attr_accessor :location_id
|
109
|
+
# The order name as represented by a number.
|
110
|
+
# Must start with `#`.
|
111
|
+
# @return [String]
|
112
|
+
attr_reader :name
|
113
|
+
# An optional note that a shop owner can attach to the order.
|
114
|
+
# @return [String]
|
115
|
+
attr_accessor :note
|
116
|
+
# Extra information that is added to the order.
|
117
|
+
# Appears in the **Additional details** section of an order details page.
|
118
|
+
# Each array entry must contain a hash with `name` and `value` keys.
|
119
|
+
# @return [Array<Hash>]
|
120
|
+
attr_accessor :note_attributes
|
121
|
+
# For internal use only.
|
122
|
+
# An ID unique to the shop.
|
123
|
+
# Numbers are sequential and start at 1000.
|
124
|
+
# @return [String]
|
125
|
+
attr_reader :number
|
126
|
+
# The ID of the order used by the shop owner and customer.
|
127
|
+
# This is different from the `shopify_id` property, which is the ID of the order used by the API.
|
128
|
+
# @return [String]
|
129
|
+
attr_reader :order_number
|
130
|
+
# An object containing information about the payment.
|
131
|
+
# @deprecated Use the [Transaction resource](https://help.shopify.com/en/api/reference/orders/transaction) instead.
|
132
|
+
# @return [String]
|
133
|
+
attr_reader :payment_details
|
134
|
+
# The list of payment gateways used for the order.
|
135
|
+
# @return [Array<String>]
|
136
|
+
attr_reader :payment_gateway_names
|
137
|
+
# The customer's phone number for receiving SMS notifications.
|
138
|
+
# @return [String]
|
139
|
+
attr_accessor :phone
|
140
|
+
# The presentment currency that was used to display prices to the customer.
|
141
|
+
# @return [String]
|
142
|
+
attr_accessor :presentment_currency
|
143
|
+
# The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when an order was processed.
|
144
|
+
# This value is the date that appears on your orders and that's used in the analytic reports.
|
145
|
+
# By default, it matches the `created_at` value.
|
146
|
+
# 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.
|
147
|
+
# @return [String]
|
148
|
+
attr_accessor :processed_at
|
149
|
+
# @!attribute processing_method [r]
|
150
|
+
# How the payment was processed.
|
151
|
+
# - `:checkout` - The order was processed using the Shopify checkout.
|
152
|
+
# - `:direct` - The order was processed using a [direct payment provider](/en/manual/payments/third-party-providers/direct-and-external-providers).
|
153
|
+
# - `:manual` - The order was processed using a [manual payment method](/en/manual/payments/manual-payments).
|
154
|
+
# - `:offsite` - The order was processed by an [external payment provider](/en/manual/payments/third-party-providers/direct-and-external-providers) to the Shopify checkout.
|
155
|
+
# - `:express` - The order was processed using [PayPal Express Checkout](/en/manual/payments/paypal).
|
156
|
+
# - `:free` - The order was processed as a free order using a discount code.
|
157
|
+
#
|
158
|
+
# @return [:checkout, :direct, :manual, :offsite, :express, :free]
|
159
|
+
enumerize :processing_method, in: [:checkout, :direct, :manual, :offsite, :express, :free]
|
160
|
+
# The website where the customer clicked a link to the shop.
|
161
|
+
# @return [String]
|
162
|
+
attr_accessor :referring_site
|
163
|
+
# A list of refunds applied to the order.
|
164
|
+
# For more information, see the [Refund API](https://help.shopify.com/en/api/reference/orders/refund).
|
165
|
+
# @return [Array<Refund>]
|
166
|
+
attr_reader :refunds
|
167
|
+
# The mailing address to where the order will be shipped.
|
168
|
+
# This address is optional and will not be available on orders that do not require shipping.
|
169
|
+
# @return [Address]
|
170
|
+
attr_accessor :shipping_address
|
171
|
+
# An array of objects, each of which details a shipping method used.
|
172
|
+
# @return [Array<ShippingLine>]
|
173
|
+
attr_accessor :shipping_lines
|
174
|
+
# Where the order originated.
|
175
|
+
# Can be set only during order creation, and is not writeable afterwards.
|
176
|
+
# Values for Shopify channels are protected and cannot be assigned by other API clients: `web`, `pos`, `shopify_draft_order`, `iphone`, and `android`.
|
177
|
+
# Orders created via the API can be assigned any other string of your choice.
|
178
|
+
# If unspecified, then new orders are assigned the value of your app's ID.
|
179
|
+
# @return [String]
|
180
|
+
attr_accessor :source_name
|
181
|
+
# The price of the order in the shop currency after discounts but before shipping, taxes, and tips.
|
182
|
+
# @return [String]
|
183
|
+
attr_accessor :subtotal_price
|
184
|
+
# The subtotal of the order in shop and presentment currencies.
|
185
|
+
# @return [PriceSet]
|
186
|
+
attr_accessor :subtotal_price_set
|
187
|
+
# Tags attached to the order, formatted as a string of comma-separated values.
|
188
|
+
# Tags are additional short descriptors, commonly used for filtering and searching.
|
189
|
+
# Each individual tag is limited to 40 characters in length.
|
190
|
+
# @return [String]
|
191
|
+
attr_accessor :tags
|
192
|
+
# An array of tax line objects, each of which details a tax applicable to the order.
|
193
|
+
# @return [Array<TaxLine>]
|
194
|
+
attr_accessor :tax_lines
|
195
|
+
# Whether taxes are included in the order subtotal.
|
196
|
+
# @return [Boolean]
|
197
|
+
attr_accessor :taxes_included
|
198
|
+
# Whether this is a test order.
|
199
|
+
# @return [Boolean]
|
200
|
+
attr_accessor :test
|
201
|
+
# A unique token for the order.
|
202
|
+
# @return [String]
|
203
|
+
attr_reader :token
|
204
|
+
# The total discounts applied to the price of the order in the shop currency.
|
205
|
+
# @return [String]
|
206
|
+
attr_accessor :total_discounts
|
207
|
+
# The total discounts applied to the price of the order in shop and presentment currencies.
|
208
|
+
# @return [PriceSet]
|
209
|
+
attr_accessor :total_discounts_set
|
210
|
+
# The sum of all line item prices in the shop currency.
|
211
|
+
# @return [String]
|
212
|
+
attr_accessor :total_line_items_price
|
213
|
+
# The total of all line item prices in shop and presentment currencies.
|
214
|
+
# @return [String]
|
215
|
+
attr_accessor :total_line_items_price_set
|
216
|
+
# The sum of all line item prices, discounts, shipping, taxes, and tips in the shop currency.
|
217
|
+
# Must be positive.
|
218
|
+
# @return [String]
|
219
|
+
attr_accessor :total_price
|
220
|
+
# The total price of the order in shop and presentment currencies.
|
221
|
+
# @return [PriceSet]
|
222
|
+
attr_accessor :total_price_set
|
223
|
+
# The sum of all the taxes applied to the order in the shop currency.
|
224
|
+
# Must be positive.
|
225
|
+
# @return [String]
|
226
|
+
attr_accessor :total_tax
|
227
|
+
# The total tax applied to the order in shop and presentment currencies.
|
228
|
+
# @return [PriceSet]
|
229
|
+
attr_accessor :total_tax_set
|
230
|
+
# The sum of all the tips in the order in the shop currency.
|
231
|
+
# @return [String]
|
232
|
+
attr_accessor :total_tip_received
|
233
|
+
# The sum of all line item weights in grams.
|
234
|
+
# @return [String]
|
235
|
+
attr_accessor :total_weight
|
236
|
+
# The date and time ([ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format) when the order was last modified.
|
237
|
+
# Filtering orders by `updated_at` is not an effective method for fetching orders because its value can change when no visible fields of an order have been updated.
|
238
|
+
# Use the [Webhook](https://help.shopify.com/en/api/reference/events/webhook) and [Event](https://help.shopify.com/en/api/reference/events/event) APIs to subscribe to order events instead.
|
239
|
+
# @return [String]
|
240
|
+
attr_reader :updated_at
|
241
|
+
# The ID of the user logged into Shopify POS who processed the order, if applicable.
|
242
|
+
# @return [String]
|
243
|
+
attr_accessor :user_id
|
244
|
+
# The URL pointing to the [order status web page](https://help.shopify.com/manual/orders/status-tracking), if applicable.
|
245
|
+
# @return [String]
|
246
|
+
attr_reader :order_status_url
|
247
|
+
end
|
248
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require "enumerize"
|
2
|
+
|
3
|
+
module Falsify
|
4
|
+
# An individual item in an Order.
|
5
|
+
#
|
6
|
+
# Required Fields:
|
7
|
+
# - variant_id
|
8
|
+
# - quantity
|
9
|
+
class OrderLineItem
|
10
|
+
extend Enumerize
|
11
|
+
# The amount available to fulfill, calculated as follows:
|
12
|
+
# `quantity - max(refunded_quantity, fulfilled_quantity) - pending_fulfilled_quantity - open_fulfilled_quantity`.
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :fulfillable_quantity
|
15
|
+
# The service provider that's fulfilling the item.
|
16
|
+
# Valid values: "manual", or the name of the provider, such as "amazon" or "shipwire".
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :fulfillment_service
|
19
|
+
# @!attribute fulfillment_status [rw]
|
20
|
+
# How far along an order is in terms line items fulfilled.
|
21
|
+
# - `:fulfilled` - Every line item in the order has been fulfilled.
|
22
|
+
# - `:null` - None of the line items in the order have been fulfilled.
|
23
|
+
# - `:partial` - At least one line item in the order has been fulfilled.
|
24
|
+
# - `:restocked` - Every line item in the order has been restocked and the order canceled.
|
25
|
+
# @return [:null, :fulfilled, :partial, :not_eligible]
|
26
|
+
enumerize :fulfillment_status, in: [:null, :fulfilled, :partial, :not_eligible], default: :null
|
27
|
+
# The weight of the item in grams.
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :grams
|
30
|
+
# The ID of the line item.
|
31
|
+
# @return [String]
|
32
|
+
attr_accessor :shopify_id
|
33
|
+
# The price of the item before discounts have been applied in the shop currency.
|
34
|
+
# @return [String]
|
35
|
+
attr_accessor :price
|
36
|
+
# The price of the line item in shop and presentment currencies.
|
37
|
+
# @return [PriceSet]
|
38
|
+
attr_accessor :price_set
|
39
|
+
# The ID of the product that the line item belongs to.
|
40
|
+
# Can be null if the original product associated with the order is deleted at a later date.
|
41
|
+
# @return [String]
|
42
|
+
attr_accessor :product_id
|
43
|
+
# The number of items that were purchased.
|
44
|
+
# @return [Integer]
|
45
|
+
attr_accessor :quantity
|
46
|
+
# Whether the item requires shipping.
|
47
|
+
# @return [Boolean]
|
48
|
+
attr_accessor :requires_shipping
|
49
|
+
# The item's SKU (stock keeping unit).
|
50
|
+
# @return [String]
|
51
|
+
attr_accessor :sku
|
52
|
+
# The title of the product.
|
53
|
+
# @return [String]
|
54
|
+
attr_accessor :title
|
55
|
+
# The ID of the product variant.
|
56
|
+
# @return [String]
|
57
|
+
attr_accessor :variant_id
|
58
|
+
# The title of the product variant.
|
59
|
+
# @return [String]
|
60
|
+
attr_accessor :variant_title
|
61
|
+
# The name of the item's supplier.
|
62
|
+
# @return [String]
|
63
|
+
attr_accessor :vendor
|
64
|
+
# The name of the product variant.
|
65
|
+
# @return [String]
|
66
|
+
attr_accessor :name
|
67
|
+
# Whether the item is a gift card.
|
68
|
+
# If true, then the item is not taxed or considered for shipping charges.
|
69
|
+
# @return [Boolean]
|
70
|
+
attr_accessor :gift_card
|
71
|
+
# An array of custom information for the item that has been added to the cart.
|
72
|
+
# Often used to provide product customization options.
|
73
|
+
# For more information, see [Get customization information for products with line item properties](https://help.shopify.com/en/themes/customization/products/features/get-customization-information-for-products).
|
74
|
+
# @return [Array<Hash>]
|
75
|
+
attr_accessor :properties
|
76
|
+
# Whether the item was taxable.
|
77
|
+
# @return [Boolean]
|
78
|
+
attr_accessor :taxable
|
79
|
+
# A list of tax line objects, each of which details a tax applied to the item.
|
80
|
+
# @return [Array<TaxLine>]
|
81
|
+
attr_accessor :tax_lines
|
82
|
+
# The payment gateway used to tender the tip, such as shopify_payments.
|
83
|
+
# Present only on tips.
|
84
|
+
# @return [String]
|
85
|
+
attr_accessor :tip_payment_gateway
|
86
|
+
# The payment method used to tender the tip, such as Visa.
|
87
|
+
# Present only on tips.
|
88
|
+
# @return [String]
|
89
|
+
attr_accessor :tip_payment_method
|
90
|
+
# The total discount amount applied to this line item in the shop currency.
|
91
|
+
# This value is not subtracted in the line item price.
|
92
|
+
# @return [String]
|
93
|
+
attr_accessor :total_discount
|
94
|
+
# The total discount applied to the line item in shop and presentment currencies.
|
95
|
+
# @return [PriceSet]
|
96
|
+
attr_accessor :total_discount_set
|
97
|
+
# An ordered list of amounts allocated by discount applications.
|
98
|
+
# Each discount allocation is associated to a particular discount application.
|
99
|
+
# @return [Array<DiscountAllocation>]
|
100
|
+
attr_accessor :discount_allocations
|
101
|
+
end
|
102
|
+
end
|