Class: Falsify::Customer

Inherits:
Object
  • Object
show all
Extended by:
Enumerize
Defined in:
lib/falsify/models/customer/customer.rb

Overview

Instance Attribute Summary collapse

Instance Attribute Details

#accepts_marketingBoolean

Whether the customer has consented to receive marketing material via email.

Returns:

  • (Boolean)


9
10
11
# File 'lib/falsify/models/customer/customer.rb', line 9

def accepts_marketing
  @accepts_marketing
end

#accepts_marketing_updated_atString

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.

Returns:

  • (String)


13
14
15
# File 'lib/falsify/models/customer/customer.rb', line 13

def accepts_marketing_updated_at
  @accepts_marketing_updated_at
end

#addressesArray<Address>

A list of the ten most recently updated addresses for the customer.

Returns:



16
17
18
# File 'lib/falsify/models/customer/customer.rb', line 16

def addresses
  @addresses
end

#created_atString (readonly)

The date and time (ISO 8601 format) when the customer was created.

Returns:

  • (String)


24
25
26
# File 'lib/falsify/models/customer/customer.rb', line 24

def created_at
  @created_at
end

#currencyString (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.

Returns:

  • (String)


21
22
23
# File 'lib/falsify/models/customer/customer.rb', line 21

def currency
  @currency
end

#default_addressAddress (readonly)

The default address for the customer. The default address has the following properties:

Returns:



28
29
30
# File 'lib/falsify/models/customer/customer.rb', line 28

def default_address
  @default_address
end

#emailString

The unique email address of the customer. Attempting to assign the same email address to multiple customers returns an error.

Returns:

  • (String)


32
33
34
# File 'lib/falsify/models/customer/customer.rb', line 32

def email
  @email
end

#first_nameString

The customer's first name.

Returns:

  • (String)


35
36
37
# File 'lib/falsify/models/customer/customer.rb', line 35

def first_name
  @first_name
end

#idString

A unique identifier for the customer.

Returns:

  • (String)


38
39
40
# File 'lib/falsify/models/customer/customer.rb', line 38

def id
  @id
end

#last_nameString

The customer's last name.

Returns:

  • (String)


41
42
43
# File 'lib/falsify/models/customer/customer.rb', line 41

def last_name
  @last_name
end

#last_order_idString (readonly)

The ID of the customer's last order.

Returns:

  • (String)


44
45
46
# File 'lib/falsify/models/customer/customer.rb', line 44

def last_order_id
  @last_order_id
end

#last_order_nameString (readonly)

The name of the customer's last order. This is directly related to the name field on the Order resource.

Returns:

  • (String)


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

Returns:

  • (:single_opt_in, :confirmed_opt_in, :unknown, nil)


60
# File 'lib/falsify/models/customer/customer.rb', line 60

enumerize :marketing_opt_in_level, in: [:single_opt_in, :confirmed_opt_in, :unknown]

#metafieldMetafield

Attaches additional metadata to a shop's resources.

Returns:



51
52
53
# File 'lib/falsify/models/customer/customer.rb', line 51

def metafield
  @metafield
end

#multipass_identifierString

A unique identifier for the customer that's used with Multipass login.

Returns:

  • (String)


63
64
65
# File 'lib/falsify/models/customer/customer.rb', line 63

def multipass_identifier
  @multipass_identifier
end

#noteString

A note about the customer.

Returns:

  • (String)


66
67
68
# File 'lib/falsify/models/customer/customer.rb', line 66

def note
  @note
end

#orders_countString (readonly)

The number of orders associated with this customer.

Returns:

  • (String)


69
70
71
# File 'lib/falsify/models/customer/customer.rb', line 69

def orders_count
  @orders_count
end

#phoneString

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

Returns:

  • (String)


79
80
81
# File 'lib/falsify/models/customer/customer.rb', line 79

def phone
  @phone
end

#stateString (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.

Returns:

  • (String)


89
# File 'lib/falsify/models/customer/customer.rb', line 89

enumerize :state, in: [:disabled, :invited, :enabled, :declined], default: :disabled

#tagsString

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.

Returns:

  • (String)


94
95
96
# File 'lib/falsify/models/customer/customer.rb', line 94

def tags
  @tags
end

#tax_exemptBoolean

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.

Returns:

  • (Boolean)


99
100
101
# File 'lib/falsify/models/customer/customer.rb', line 99

def tax_exempt
  @tax_exempt
end

#tax_exemptionsString

Whether the customer is exempt from paying specific taxes on their order. Canadian taxes only.

Returns:

  • (String)


103
104
105
# File 'lib/falsify/models/customer/customer.rb', line 103

def tax_exemptions
  @tax_exemptions
end

#total_spentString (readonly)

The total amount of money that the customer has spent across their order history.

Returns:

  • (String)


106
107
108
# File 'lib/falsify/models/customer/customer.rb', line 106

def total_spent
  @total_spent
end

#updated_atString (readonly)

The date and time (ISO 8601 format) when the customer information was last updated.

Returns:

  • (String)


109
110
111
# File 'lib/falsify/models/customer/customer.rb', line 109

def updated_at
  @updated_at
end

#verified_emailBoolean (readonly)

Whether the customer has verified their email address.

Returns:

  • (Boolean)


112
113
114
# File 'lib/falsify/models/customer/customer.rb', line 112

def verified_email
  @verified_email
end