class

Stripe::Customer

Inherits OpenApi::Json < OpenApi::Validatable < JSON::Serializable::Unmapped < JSON::Serializable < Reference < Object

This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer. Related guide: Save a card during payment

Constants

ERROR_MESSAGE_FOR_OBJECT = "invalid value for \"object\", must be one of [customer]."
ERROR_MESSAGE_FOR_TAX_EXEMPT = "invalid value for \"tax_exempt\", must be one of [exempt, none, reverse]."
MAX_LENGTH_FOR_CURRENCY = 5000
MAX_LENGTH_FOR_DESCRIPTION = 5000
MAX_LENGTH_FOR_EMAIL = 5000
MAX_LENGTH_FOR_ID = 5000
MAX_LENGTH_FOR_INVOICE_PREFIX = 5000
MAX_LENGTH_FOR_NAME = 5000
MAX_LENGTH_FOR_PHONE = 5000
VALID_VALUES_FOR_OBJECT = String.static_array("customer")
VALID_VALUES_FOR_TAX_EXEMPT = String.static_array("exempt", "none", "reverse")

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
new(*, created : Int64 | Nil = nil, default_source : Stripe::CustomerDefaultSource | Nil = nil, description : String | Nil = nil, email : String | Nil = nil, id : String | Nil = nil, livemode : Bool | Nil = nil, object : String | Nil = nil, shipping : Stripe::CustomerShipping1 | Nil = nil, address : Stripe::CustomerAddress | Nil = nil, balance : Int64 | Nil = nil, cash_balance : Stripe::CustomerCashBalance | Nil = nil, currency : String | Nil = nil, delinquent : Bool | Nil = nil, discount : Stripe::CustomerDiscount | Nil = nil, invoice_credit_balance : Hash(String, Int32) | Nil = nil, invoice_prefix : String | Nil = nil, invoice_settings : Stripe::InvoiceSettingCustomerSetting | Nil = nil, metadata : Hash(String, String) | Nil = nil, name : String | Nil = nil, next_invoice_sequence : Int64 | Nil = nil, phone : String | Nil = nil, preferred_locales : Array(String) | Nil = nil, sources : Stripe::ApmsSourcesSourceList | Nil = nil, subscriptions : Stripe::SubscriptionList | Nil = nil, tax : Stripe::CustomerTax | Nil = nil, tax_exempt : String | Nil = nil, tax_ids : Stripe::TaxIDsList | Nil = nil, test_clock : Stripe::CustomerTestClock | Nil = nil)

Initializes the object @param [Hash] attributes Model attributes in the form of hash

Source

Instance methods

==(other : self)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

address
Source
address=(new_value : Stripe::CustomerAddress | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] address Object to be assigned

Source
address_present=(address_present : Bool)
Source
address_present?
Source
balance

The current balance, if any, that's stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize.

Source
balance=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] balance Object to be assigned

Source
cash_balance
Source
cash_balance=(new_value : Stripe::CustomerCashBalance | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] cash_balance Object to be assigned

Source
cash_balance_present=(cash_balance_present : Bool)
Source
cash_balance_present?
Source
created

Time at which the object was created. Measured in seconds since the Unix epoch.

Source
created=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] created Object to be assigned

Source
currency

Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes.

Source
currency=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] currency Object to be assigned

Source
currency_present=(currency_present : Bool)
Source
currency_present?
Source
default_source
Source
default_source=(new_value : Stripe::CustomerDefaultSource | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] default_source Object to be assigned

Source
delinquent

Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the invoice.due_date will set this field to true. If an invoice becomes uncollectible by dunning, delinquent doesn't reset to false. If you care whether the customer has paid their most recent subscription invoice, use subscription.status instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to false.

Source
delinquent=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] delinquent Object to be assigned

Source
delinquent_present=(delinquent_present : Bool)
Source
delinquent_present?
Source
description

An arbitrary string attached to the object. Often useful for displaying to users.

Source
description=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] description Object to be assigned

Source
discount
Source
discount=(new_value : Stripe::CustomerDiscount | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] discount Object to be assigned

Source
discount_present=(discount_present : Bool)
Source
discount_present?
Source
email

The customer's email address.

Source
email=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] email Object to be assigned

Source
hash(hasher)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

id

Unique identifier for the object.

Source
id=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] id Object to be assigned

Source
invoice_credit_balance
Source
invoice_credit_balance=(new_value : Hash(String, Int32) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] invoice_credit_balance Object to be assigned

Source
invoice_prefix

The prefix for the customer used to generate unique invoice numbers.

Source
invoice_prefix=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] invoice_prefix Object to be assigned

Source
invoice_prefix_present=(invoice_prefix_present : Bool)
Source
invoice_prefix_present?
Source
invoice_settings
Source
invoice_settings=(new_value : Stripe::InvoiceSettingCustomerSetting | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] invoice_settings Object to be assigned

Source
list_invalid_properties

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

Source
livemode

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

Source
livemode=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] livemode Object to be assigned

Source
metadata
Source
metadata=(new_value : Hash(String, String) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] metadata Object to be assigned

Source
name

The customer's full name or business name.

Source
name=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] name Object to be assigned

Source
name_present=(name_present : Bool)
Source
name_present?
Source
next_invoice_sequence

The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses.

Source
next_invoice_sequence=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] next_invoice_sequence Object to be assigned

Source
object

String representing the object's type. Objects of the same type share the same value.

Source
object=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] object Object to be assigned

Source
phone

The customer's phone number.

Source
phone=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] phone Object to be assigned

Source
phone_present=(phone_present : Bool)
Source
phone_present?
Source
preferred_locales

The customer's preferred locales (languages), ordered by preference.

Source
preferred_locales=(new_value : Array(String) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] preferred_locales Object to be assigned

Source
preferred_locales_present=(preferred_locales_present : Bool)
Source
preferred_locales_present?
Source
shipping
Source
shipping=(new_value : Stripe::CustomerShipping1 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] shipping Object to be assigned

Source
sources
Source
sources=(new_value : Stripe::ApmsSourcesSourceList | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] sources Object to be assigned

Source
subscriptions
Source
subscriptions=(new_value : Stripe::SubscriptionList | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] subscriptions Object to be assigned

Source
tax=(new_value : Stripe::CustomerTax | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] tax Object to be assigned

Source
tax_exempt

Describes the customer's tax exemption status, which is none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the following text: "Reverse charge".

Source
tax_exempt=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] tax_exempt Object to be assigned

Source
tax_exempt_present=(tax_exempt_present : Bool)
Source
tax_exempt_present?
Source
tax_ids
Source
tax_ids=(new_value : Stripe::TaxIDsList | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] tax_ids Object to be assigned

Source
test_clock
Source
test_clock=(new_value : Stripe::CustomerTestClock | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] test_clock Object to be assigned

Source
test_clock_present=(test_clock_present : Bool)
Source
test_clock_present?
Source
valid?

Check to see if the all the properties in the model are valid @return true if the model is valid

Source