Class: Falsify::Customer
- Inherits:
-
Object
- Object
- Falsify::Customer
- Extended by:
- Enumerize
- Defined in:
- lib/falsify/models/customer/customer.rb
Overview
See the API documentation.
Instance Attribute Summary collapse
-
#accepts_marketing ⇒ Boolean
Whether the customer has consented to receive marketing material via email.
-
#accepts_marketing_updated_at ⇒ String
The date and time (ISO 8601 format) when the customer consented or objected to receiving marketing material by email.
-
#addresses ⇒ Array<Address>
A list of the ten most recently updated addresses for the customer.
-
#created_at ⇒ String
readonly
The date and time (ISO 8601 format) when the customer was created.
-
#currency ⇒ String
readonly
The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order.
-
#default_address ⇒ Address
readonly
The default address for the customer.
-
#email ⇒ String
The unique email address of the customer.
-
#first_name ⇒ String
The customer's first name.
-
#id ⇒ String
A unique identifier for the customer.
-
#last_name ⇒ String
The customer's last name.
-
#last_order_id ⇒ String
readonly
The ID of the customer's last order.
-
#last_order_name ⇒ String
readonly
The name of the customer's last order.
-
#marketing_opt_in_level ⇒ :single_opt_in, ...
readonly
The marketing subscription opt-in level (as described by the M3AAWG best practices guideline) that the customer gave when they consented to receive marketing material by email.
-
#metafield ⇒ Metafield
Attaches additional metadata to a shop's resources.
-
#multipass_identifier ⇒ String
A unique identifier for the customer that's used with Multipass login.
-
#note ⇒ String
A note about the customer.
-
#orders_count ⇒ String
readonly
The number of orders associated with this customer.
-
#phone ⇒ String
The unique phone number (E.164 format) for this customer.
-
#state ⇒ String
readonly
The state of the customer's account with a shop.
-
#tags ⇒ String
Tags that the shop owner has attached to the customer, formatted as a string of comma-separated values.
-
#tax_exempt ⇒ Boolean
Whether the customer is exempt from paying taxes on their order.
-
#tax_exemptions ⇒ String
Whether the customer is exempt from paying specific taxes on their order.
-
#total_spent ⇒ String
readonly
The total amount of money that the customer has spent across their order history.
-
#updated_at ⇒ String
readonly
The date and time (ISO 8601 format) when the customer information was last updated.
-
#verified_email ⇒ Boolean
readonly
Whether the customer has verified their email address.
Instance Attribute Details
#accepts_marketing ⇒ Boolean
Whether the customer has consented to receive marketing material via email.
9 10 11 |
# File 'lib/falsify/models/customer/customer.rb', line 9 def accepts_marketing @accepts_marketing end |
#accepts_marketing_updated_at ⇒ String
The date and time (ISO 8601 format) when the customer consented or objected to receiving marketing material by email. Set this value whenever the customer consents or objects to marketing materials.
13 14 15 |
# File 'lib/falsify/models/customer/customer.rb', line 13 def accepts_marketing_updated_at @accepts_marketing_updated_at end |
#addresses ⇒ Array<Address>
A list of the ten most recently updated addresses for the customer.
16 17 18 |
# File 'lib/falsify/models/customer/customer.rb', line 16 def addresses @addresses end |
#created_at ⇒ String (readonly)
The date and time (ISO 8601 format) when the customer was created.
24 25 26 |
# File 'lib/falsify/models/customer/customer.rb', line 24 def created_at @created_at end |
#currency ⇒ String (readonly)
The three-letter code (ISO 4217 format) for the currency that the customer used when they paid for their last order. Defaults to the shop currency. Returns the shop currency for test orders.
21 22 23 |
# File 'lib/falsify/models/customer/customer.rb', line 21 def currency @currency end |
#default_address ⇒ Address (readonly)
The default address for the customer. The default address has the following properties:
28 29 30 |
# File 'lib/falsify/models/customer/customer.rb', line 28 def default_address @default_address end |
#email ⇒ String
The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.
32 33 34 |
# File 'lib/falsify/models/customer/customer.rb', line 32 def email @email end |
#first_name ⇒ String
The customer's first name.
35 36 37 |
# File 'lib/falsify/models/customer/customer.rb', line 35 def first_name @first_name end |
#id ⇒ String
A unique identifier for the customer.
38 39 40 |
# File 'lib/falsify/models/customer/customer.rb', line 38 def id @id end |
#last_name ⇒ String
The customer's last name.
41 42 43 |
# File 'lib/falsify/models/customer/customer.rb', line 41 def last_name @last_name end |
#last_order_id ⇒ String (readonly)
The ID of the customer's last order.
44 45 46 |
# File 'lib/falsify/models/customer/customer.rb', line 44 def last_order_id @last_order_id end |
#last_order_name ⇒ String (readonly)
The name of the customer's last order.
This is directly related to the name
field on the Order resource.
48 49 50 |
# File 'lib/falsify/models/customer/customer.rb', line 48 def last_order_name @last_order_name end |
#marketing_opt_in_level ⇒ :single_opt_in, ... (readonly)
The marketing subscription opt-in level (as described by the M3AAWG best practices guideline) that the customer gave when they consented to receive marketing material by email.
If the customer does not accept email marketing, then this property will be set to null
.
Valid values:
single_opt_in
confirmed_opt_in
unknown
60 |
# File 'lib/falsify/models/customer/customer.rb', line 60 enumerize :marketing_opt_in_level, in: [:single_opt_in, :confirmed_opt_in, :unknown] |
#metafield ⇒ Metafield
Attaches additional metadata to a shop's resources.
51 52 53 |
# File 'lib/falsify/models/customer/customer.rb', line 51 def @metafield end |
#multipass_identifier ⇒ String
A unique identifier for the customer that's used with Multipass login.
63 64 65 |
# File 'lib/falsify/models/customer/customer.rb', line 63 def multipass_identifier @multipass_identifier end |
#note ⇒ String
A note about the customer.
66 67 68 |
# File 'lib/falsify/models/customer/customer.rb', line 66 def note @note end |
#orders_count ⇒ String (readonly)
The number of orders associated with this customer.
69 70 71 |
# File 'lib/falsify/models/customer/customer.rb', line 69 def orders_count @orders_count end |
#phone ⇒ String
The unique phone number (E.164 format) for this customer. Attempting to assign the same phone number to multiple customers returns an error. The property can be set using different formats, but each format must represent a number that can be dialed from anywhere in the world. The following formats are all valid:
- 6135551212
- +16135551212
- (613)555-1212
- +1 613-555-1212
79 80 81 |
# File 'lib/falsify/models/customer/customer.rb', line 79 def phone @phone end |
#state ⇒ String (readonly)
The state of the customer's account with a shop.
Default value: disabled
.
Valid values:
disabled
- The customer doesn't have an active account. Customer accounts can be disabled from the Shopify admin at any time.invited
- The customer has received an email invite to create an account.enabled
- The customer has created an account.declined
- The customer declined the email invite to create an account.
89 |
# File 'lib/falsify/models/customer/customer.rb', line 89 enumerize :state, in: [:disabled, :invited, :enabled, :declined], default: :disabled |
#tags ⇒ String
Tags that the shop owner has attached to the customer, formatted as a string of comma-separated values. A customer can have up to 250 tags. Each tag can have up to 255 characters.
94 95 96 |
# File 'lib/falsify/models/customer/customer.rb', line 94 def @tags end |
#tax_exempt ⇒ Boolean
Whether the customer is exempt from paying taxes on their order.
If true
, then taxes won't be applied to an order at checkout.
If false
, then taxes will be applied at checkout.
99 100 101 |
# File 'lib/falsify/models/customer/customer.rb', line 99 def tax_exempt @tax_exempt end |
#tax_exemptions ⇒ String
Whether the customer is exempt from paying specific taxes on their order. Canadian taxes only.
103 104 105 |
# File 'lib/falsify/models/customer/customer.rb', line 103 def tax_exemptions @tax_exemptions end |
#total_spent ⇒ String (readonly)
The total amount of money that the customer has spent across their order history.
106 107 108 |
# File 'lib/falsify/models/customer/customer.rb', line 106 def total_spent @total_spent end |
#updated_at ⇒ String (readonly)
The date and time (ISO 8601 format) when the customer information was last updated.
109 110 111 |
# File 'lib/falsify/models/customer/customer.rb', line 109 def updated_at @updated_at end |
#verified_email ⇒ Boolean (readonly)
Whether the customer has verified their email address.
112 113 114 |
# File 'lib/falsify/models/customer/customer.rb', line 112 def verified_email @verified_email end |