# Customers

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


Represents a customer, which can be an individual or organization that subscribes to your products or services. The customer resource associates with [subscriptions](/docs/api/subscriptions/subscription-object), [card information](/docs/api/cards/card-object), and billing addresses. The customer details include their ID, name, contact information, and any [custom attributes](/docs/api/advanced-features) you'd like to associate with them.

**Breaking Change**:

-   [**Sites**](https://www.chargebee.com/docs/2.0/sites-intro.html) **created before March 1, 2014**: [updating the card](/docs/api/cards/update-card-for-a-customer) deletes the customer's `billing_address` and `vat_number` and replaces them with values from the request.
-   **Sites created on or after March 1, 2014**: updating the card doesn't change the `billing_address` and `vat_number`.

## Sample Customer

```json
{
  "allow_direct_debit": false,
  "auto_collection": "on",
  "billing_address": {
    "city": "Walnut",
    "country": "US",
    "first_name": "John",
    "last_name": "Doe",
    "line1": "PO Box 9999",
    "object": "billing_address",
    "state": "California",
    "state_code": "CA",
    "validation_status": "not_validated",
    "zip": "91789"
  },
  "card_status": "no_card",
  "created_at": 1517505731,
  "deleted": false,
  "email": "john@test.com",
  "excess_payments": 0,
  "first_name": "John",
  "id": "__test__KyVnHhSBWl7eY2bl",
  "last_name": "Doe",
  "locale": "fr-CA",
  "net_term_days": 0,
  "object": "customer",
  "pii_cleared": "active",
  "preferred_currency_code": "USD",
  "promotional_credits": 0,
  "refundable_credits": 0,
  "resource_version": 1517505731000,
  "taxability": "taxable",
  "unbilled_charges": 0,
  "updated_at": 1517505731
}
```

## Customers attributes

## Input Parameters

- `id` (required, string, max chars=50)
  The unique identifier of the `customer` resource. You have the option to specify this value when creating a customer. If not specified, Chargebee automatically generates a unique identifier.
  
  **Tip** When the `customer` resource is [transferred](/docs/api/business_entities/transfer-resources-to-another-business-entity) to a different `[business_entity](/docs/api/business_entities)`, Chargebee assigns a new random identifier to the `id` attribute. The original identifier is preserved for the transferred copy of the `customer` resource. (See also: [Mechanics of business entity transfer](/docs/api/business_entities).)

- `first_name` (optional, string, max chars=150)
  First name of the customer

- `last_name` (optional, string, max chars=150)
  Last name of the customer

- `email` (optional, string, max chars=70)
  Email of the customer. Configured email notifications will be sent to this email.

- `phone` (optional, string, max chars=50)
  Phone number of the customer

- `company` (optional, string, max chars=250)
  Company name of the customer.

- `vat_number` (optional, string, max chars=20)
  The VAT/tax registration number for the customer. For customers with `[billing_address](/docs/api/customers/customer-object#billing_address)`
  
  `country` as `XI` (which is **United Kingdom - Northern Ireland** ), the first two characters of the [full VAT number](https://en.wikipedia.org/wiki/VAT_identification_number) can be overridden by setting `[vat_number_prefix](/docs/api/customers/customer-object#vat_number_prefix)` .

- `auto_collection` (required, enumerated string, default=on)
  When the customer has a `[payment_method](/docs/api/customers/customer-object#payment_method)` of `type` `card` , this attribute determines whether to automatically charge the card whenever an invoice `[status](/docs/api/invoices/invoice-object#status)` is `payment_due` .
  
  **Note** This setting can be [overridden](/docs/api/subscriptions/create-subscription-for-items#auto_collection) for individual subscriptions of the customer.
  Possible enum values:
    - `on`
      Chargebee automatically charges the card for invoices that enter `payment_due` `status` .
    - `off`
      Automatic charging is disabled; manual payment is required for due invoices.

- `offline_payment_method` (optional, enumerated string)
  The preferred offline payment method for the customer.
  Possible enum values:
    - `no_preference`
      No Preference
    - `cash`
      Cash
    - `check`
      Check
    - `bank_transfer`
      Bank Transfer
    - `ach_credit`
      ACH Credit
    - `sepa_credit`
      SEPA Credit
    - `boleto`
      Boleto
    - `us_automated_bank_transfer`
      US Automated Bank Transfer
    - `eu_automated_bank_transfer`
      EU Automated Bank Transfer
    - `uk_automated_bank_transfer`
      UK Automated Bank Transfer
    - `jp_automated_bank_transfer`
      JP Automated Bank Transfer
    - `mx_automated_bank_transfer`
      MX Automated Bank Transfer
    - `custom`
      Custom

- `net_term_days` (required, integer, default=0)
  The number of days from [`invoice.date`](/docs/api/invoices/invoice-object#date) until payment for the invoice is due.

- `vat_number_validated_time` (optional, timestamp(UTC) in seconds)
  Returns the recent VAT number validation time.

- `vat_number_status` (optional, enumerated string)
  Represents the VAT validation status. This is applicable if you have configured EU, UK or Australian taxes and the [VAT number validation](https://www.chargebee.com/docs/2.0/uk-vat.html#uk-vat-validation) is enabled.
  Possible enum values:
    - `valid`
      If the given VAT number is valid.
    - `invalid`
      If the given VAT number is invalid.
    - `not_validated`
      This status is only applicable for countries in European Zone. This is applicable when both the customer's billing address and the organization's address should be of the same European Zone and EU tax should be configured with the "Also validate VAT Number for Country of Business" option in the disabled status.
    - `undetermined`
      When Chargebee is not able to validate the VAT number it is stored as 'undetermined'. This can occur due to reasons like service outage etc. VAT numbers with 'undetermined' status will be in queue for validation on daily basis.

- `allow_direct_debit` (required, boolean, default=false)
  Whether the customer can pay via Direct Debit

- `is_location_valid` (optional, boolean)
  **Note** Applicable only when the customer's `billing_address.country` is New Zealand, Australia, or in the EU.
  
  When the customer uses a [card](/docs/api/payment_sources/payment_source-object#type) [payment source](/docs/api/customers/customer-object#primary_payment_source_id), this attribute specifies whether the country of the customer and the card issuer are the same. The following three location indicators are compared:
  
  -   The card issuer's country.
  -   The `billing_address.country`.
  -   The country to which `created_from_ip` belongs.
  -   When all three are the same, this attribute is set to true, otherwise it is set to false. When all three are the same, this attribute is set to `true`, otherwise it is set to `false`.

- `created_at` (required, timestamp(UTC) in seconds)
  Timestamp indicating when this customer resource is created.

- `created_from_ip` (optional, string, max chars=50)
  The IP address of the customer when this customer record was created. It's mainly used for [referral integrations](https://www.chargebee.com/docs/marketing-integration-index.html) and validating VAT if the customer is in the EU or UK. Depending on the method used to create the customer record, the field is set as follows:
  
  -   **API**: When creating the `customer` resource through the API, you must include the customer's IP address in a [custom HTTP request header](/docs/api/advanced-features) (`chargebee-request-origin-ip`) for Chargebee to capture it.
  -   **Checkout**: For `customer` resources created through [Chargebee Checkout](https://www.chargebee.com/docs/2.0/hosted-checkout.html), Chargebee automatically captures the IP address of the customer.
  -   **UI**: When [creating a `customer`](https://www.chargebee.com/docs/2.0/customers.html#creating-a-new-customer) resource via the Chargebee Billing UI, this field is not relevant and the value must be ignored.

- `exemption_details` (optional)
  Indicates the exemption information. You can customize customer exemption based on specific Location, Tax level (Federal, State, County and Local), Category of Tax or specific Tax Name. This is applicable only if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. To know more about what values you need to provide, refer to this [Avalara's API document](https://developer.avalara.com/communications/dev-guide_rest_v2/customizing-transactions/sample-transactions/exemption/) .

- `taxability` (optional, enumerated string, default=taxable)
  Specifies if the customer is liable for tax
  Possible enum values:
    - `taxable`
      Computes tax for the customer based on the [site configuration](https://www.chargebee.com/docs/tax.html). In some cases, depending on the region, shipping\_address is needed. If not provided, then billing\_address is used to compute tax. If that's not available either, the tax is taken as zero.
    - `exempt`
      -   Customer is exempted from tax. When using Chargebee's native [Taxes](https://www.chargebee.com/docs/tax.html) feature or when using the [TaxJar integration](https://www.chargebee.com/docs/taxjar.html), no other action is needed.
      -   However, when using our [Avalara integration](https://www.chargebee.com/docs/avalara.html), optionally, specify `entity_code` or `exempt_number` attributes if you use Chargebee's [AvaTax for Sales](https://www.chargebee.com/docs/avalara.html#configuring-tax-exemption) or specify `exemption_details` attribute if you use [Chargebee's AvaTax for Communications](https://www.chargebee.com/docs/avatax-for-communication.html) integration. Tax may still be applied by Avalara for certain values of `entity_code`/`exempt_number`/`exemption_details` based on the state/region/province of the taxable address.

- `entity_code` (optional, enumerated string)
  The exemption category of the customer, for USA and Canada. Applicable if you use Chargebee's [AvaTax for Sales integration](https://www.chargebee.com/docs/avalara.html#configuring-tax-exemption) .
  Possible enum values:
    - `a`
      Federal government
    - `b`
      State government
    - `c`
      Tribe/Status Indian/Indian Band
    - `d`
      Foreign diplomat
    - `e`
      Charitable or benevolent organization
    - `f`
      Religious organization
    - `g`
      Resale
    - `h`
      Commercial agricultural production
    - `i`
      Industrial production/manufacturer
    - `j`
      Direct pay permit
    - `k`
      Direct mail
    - `l`
      Other or custom
    - `m`
      Educational organization
    - `n`
      Local government
    - `p`
      Commercial aquaculture
    - `q`
      Commercial Fishery
    - `r`
      Non-resident
    - `med1`
      US Medical Device Excise Tax with exempt sales tax
    - `med2`
      US Medical Device Excise Tax with taxable sales tax

- `exempt_number` (optional, string, max chars=100)
  Any string value that will cause the sale to be exempted. Use this if your finance team manually verifies and tracks exemption certificates. Applicable if you use Chargebee's [AvaTax for Sales integration](https://www.chargebee.com/docs/avalara.html#configuring-tax-exemption) .

- `resource_version` (optional, long)
  Version number of this resource. The `resource_version` is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.

- `updated_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when this customer was last updated. This attribute will be present only if the resource has been updated after 2016-09-28.

- `locale` (optional, string, max chars=50)
  Determines which region-specific language Chargebee uses to communicate with the customer. In the absence of the locale attribute, Chargebee will use your site's default language for customer communication.

- `billing_date` (optional, integer, min=1, max=31)
  **Note** Applicable only when [Calendar Billing](https://www.chargebee.com/docs/billing/2.0/subscriptions/calendar-billing) with support for customer-specific billing date is enabled and `billing_date_mode` is `manually_set`.
  
  Specifies the day of the month for subscription renewals on month-based or year-based plans. Month-based and year-based plans are `item_price` resources where the `item_type` is set to `plan` and `period_unit` is set to `month` and `year` respectively.
  
  **Example**
  
  -   **Month-based subscriptions**: If `billing_date` is set to `15`, month-based renewals occur on the 15th of the month. It's important to note that if the value is set to `31`, renewals align with the last day of the month. Additionally, in February, a `billing_date` of `29`, `30`, or `31` aligns renewals for the last day of February.
  -   **Year-based subscriptions**: A `billing_date` of `15` and a `billing_month` of `7` schedules the renewal on the 15th of July.

- `billing_month` (optional, integer, min=1, max=12)
  **Note** Applicable only when [Calendar Billing](https://www.chargebee.com/docs/billing/2.0/subscriptions/calendar-billing) with support for customer-specific billing date is enabled and `billing_date_mode` is `manually_set`.
  
  Specifies the renewal month for subscriptions on year-based plans. Year-based plans are `item_price` resources where `item_type` is set to `plan` and `period_unit` is set to `year`.
  
  **Example** The renewal date is 15th July when `billing_date` is `15` and `billing_month` is `7`.

- `billing_date_mode` (optional, enumerated string)
  **Note** Applicable only when [Calendar Billing](https://www.chargebee.com/docs/billing/2.0/subscriptions/calendar-billing) with support for customer-specific billing date is enabled and `billing_date_mode` is `manually_set`.
  
  Indicates whether this customer's `billing_date` and `billing_month` values can be changed via the [Change billing date API](/docs/api/customers/change-billing-date) .
  Possible enum values:
    - `using_defaults`
      `billing_date` and `billing_month` are fixed as per Chargebee [site settings](https://www.chargebee.com/docs/2.0/calendar-billing-config.html#configuring-calendar-billing_configuring-site-wide-billing) and not modifiable via API.
    - `manually_set`
      `billing_date` and `billing_month` can be adjusted via API.

- `billing_day_of_week` (optional, enumerated string)
  Applicable when _calendar billing_ (with customer specific billing date support) is enabled. When set, renewals of all the weekly subscriptions of this customer will be aligned to this week day.
  Possible enum values:
    - `sunday`
      Sunday
    - `monday`
      Monday
    - `tuesday`
      Tuesday
    - `wednesday`
      Wednesday
    - `thursday`
      Thursday
    - `friday`
      Friday
    - `saturday`
      Saturday

- `billing_day_of_week_mode` (optional, enumerated string)
  Indicates whether this customer's _billing\_day\_of\_week_ value is derived as per configurations or its specifically set (overriden). When specifically set, the _billing\_day\_of\_week_ will not be reset even when all of the weekly subscriptions are cancelled.
  Possible enum values:
    - `using_defaults`
      Billing date is set based on defaults configured.
    - `manually_set`
      Billing date is specifically set (default configuration is overridden)

- `pii_cleared` (optional, enumerated string, default=active)
  Indicates whether this customer's personal information has been cleared
  Possible enum values:
    - `active`
      Active
    - `scheduled_for_clear`
      Scheduled For Clear
    - `cleared`
      Cleared

- `auto_close_invoices` (optional, boolean)
  Override for this customer, the [site-level setting](https://www.chargebee.com/docs/billing/2.0/usage-based-billing/metered_billing#configuring-metered-billing) for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute is also available at the [subscription level](/docs/api/subscriptions/subscription-object#auto_close_invoices) which takes precedence.

- `channel` (optional, enumerated string)
  The subscription channel this object originated from and is maintained in.
  Possible enum values:
    - `web`
      The object was created (and is maintained) for the web channel directly in Chargebee via API or UI.
    - `app_store`
      The object data is synchronized with data from [in-app subscription(s)](/docs/api/in_app_subscriptions) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.
    - `play_store`
      The object data is synchronized with data from [in-app subscription(s)](/docs/api/in_app_subscriptions) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
      
      In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](mailto:eap@chargebee.com) for more information.

- `active_id` (optional, string, max chars=50)
  **Note**: Present only when the `customer` has been [transferred](/docs/api/business_entities/transfer-resources-to-another-business-entity) between business entities.
  
  Represents the `id` of the active version of the `customer` resource.
  
  **Tip**: If the `id` and `active_id` of a `customer` resource are the same, this indicates that you are working with the active version of that customer resource.

- `fraud_flag` (optional, enumerated string)
  Indicates whether or not the customer has been [identified as fraudulent](https://www.chargebee.com/docs/payments/2.0/fraud-management/chargebee-fraud-management).
  Possible enum values:
    - `safe`
      The customer has been marked as safe
    - `suspicious`
      The customer has been identified as potentially fraudulent by the gateway
    - `fraudulent`
      The customer has been marked as fraudulent

- `primary_payment_source_id` (optional, string, max chars=40)
  The [identifier](/docs/api/payment_sources/payment_source-object#id) of the customer's [primary payment source](https://www.chargebee.com/docs/2.0/payment-method-overview.html#primary-and-backup-payment-methods)

- `backup_payment_source_id` (optional, string, max chars=40)
  The [identifier](/docs/api/payment_sources/payment_source-object#id) of the customer's [backup payment source](https://www.chargebee.com/docs/2.0/payment-method-overview.html#primary-and-backup-payment-methods) .

- `invoice_notes` (optional, string, max chars=2000)
  A note for the customer that appears on all their invoice PDFs. This is one of [several notes](/docs/api/invoices/invoice-object#notes) displayed on the invoice PDF.

- `business_entity_id` (optional, string, max chars=50)
  The unique ID of the [business entity](/docs/api/advanced-features) of this subscription. This is always the same as the [business entity](/docs/api/subscriptions/subscription-object#customer_id) of the customer.

- `preferred_currency_code` (optional, string, max chars=3)
  **Note** Applicable only when the [Multi-Currency](https://www.chargebee.com/docs/2.0/multi-currency-pricing.html) feature is enabled.
  
  Specifies the customer's preferred currency in [ISO 4217](https://www.chargebee.com/docs/supported-currencies.html) format.

- `promotional_credits` (required, in cents, min=0)
  The balance of [promotional credits](/docs/api/promotional_credits) available to the customer.

- `unbilled_charges` (required, in cents, min=0)
  Total unbilled charges for this customer

- `refundable_credits` (required, in cents, min=0)
  Refundable credits balance of this customer

- `excess_payments` (required, in cents, min=0)
  Total unused payments associated with the customer. These are automatically applied to new invoices subject to [limits set at the site level](https://www.chargebee.com/docs/billing/2.0/invoices-credit-notes-and-quotes/credit-notes#credits-flexibility) which can be overridden for subscriptions via [`subscription.billing_override`](/docs/api/subscriptions/subscription-object#billing_override).
  
  **Constraints**
  
  -   When [multiple currencies](https://www.chargebee.com/docs/billing/2.0/site-configuration/multi-currency-pricing) are enabled, this value is the excess payments balance for the customer's preferred currency. In other words, this value is the same as `balances[i].excess_payments` where `balances[i].currency_code` is the same as the `preferred_currency_code`.

- `is_einvoice_enabled` (optional, boolean)
  Determines whether the customer is e-invoiced. When set to `true` or not set to any value, the customer is e-invoiced so long as e-invoicing is enabled for their country (`billing_address.country` ). When set to `false` , the customer is not e-invoiced even if e-invoicing is enabled for their country.
  
  **Tip:**
  
  It is possible to set a value for this flag even when E-Invoicing is disabled. However, it comes into effect only when E-Invoicing is enabled.

- `einvoicing_method` (optional, enumerated string)
  Determines whether to send e-invoice manually or automatic.
  Possible enum values:
    - `automatic`
      Use this value to send e-invoice every time an invoice or credit note is created.
    - `manual`
      When manual is selected the automatic e-invoice sending is disabled. Use this value to send e-invoice manually through UI or API.
    - `site_default`
      The default value of the site which can be overridden at the customer level.

- `meta_data` (optional, jsonobject)
  A collection of key-value pairs that provides extra information about the customer.
  
  **Note:** There's a character limit of 65,535.
  
  [Learn more](/docs/api/advanced-features) .

- `deleted` (required, boolean)
  Indicates that this resource has been deleted when the value is `true` .

- `registered_for_gst` (optional, boolean)
  Confirms that a customer is registered under GST. If set to `true` then the [Reverse Charge Mechanism](https://www.chargebee.com/docs/australian-gst.html#reverse-charge-mechanism) is applicable. This field is applicable only when Australian GST is configured for your site.

- `consolidated_invoicing` (optional, boolean)
  Indicates whether invoices raised on the same day for the `customer` are consolidated. When present, this value overrides the default configuration at the [site-level](https://www.chargebee.com/docs/consolidated-invoicing.html#configuring-consolidated-invoicing). This attribute is applicable only when [Consolidated Invoicing](https://www.chargebee.com/docs/consolidated-invoicing.html) is enabled.
  
  **Note:**
  
  Any invoices raised when a subscription activates from `in_trial` or `future` `status`, are not consolidated by default. [Contact Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support) to enable consolidation for such invoices.

- `customer_type` (optional, enumerated string)
  **Note** Applicable only when the [Chargebee's AvaTax for Communications integration](https://www.chargebee.com/docs/avatax-for-communication.html) is enabled.
  
  Indicates the [Avalara customer type](https://developer.avalara.com/communications-integration/design-considerations/customer-type/) .
  Possible enum values:
    - `residential`
      The customer is an individual user.
    - `business`
      The customer represents a business.
    - `senior_citizen`
      The customer is an individual that meets the jurisdiction requirements to be considered a senior citizen and qualifies for tax breaks.
    - `industrial`
      The customer is an industrial business.

- `business_customer_without_vat_number` (optional, boolean)
  Confirms that a customer is a valid business without an EU/UK VAT number.

- `client_profile_id` (optional, string, max chars=50)
  **Note** Applicable only when the [Chargebee's AvaTax for Communications integration](https://www.chargebee.com/docs/avatax-for-communication.html) is enabled.
  
  The [Avalara client profile ID](https://developer.avalara.com/communications/dev-guide_rest_v2/customizing-transactions/client-profiles/) assigned to the customer.

- `use_default_hierarchy_settings` (optional, boolean, default=true)
  Indicates whether the site-default settings are being used for controlling access to the customer's information. The level of access is for data falling into two categories: - **Self-Serve Portal data:** subscriptions and invoices of the customer.
  
  -   **Email Notifications:** subscription-, invoice- and payment-related notifications for the customer.

- `vat_number_prefix` (optional, string, max chars=10)
  An overridden value for the first two characters of the [full VAT number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with `[billing_address](/docs/api/customers/customer-object#billing_address)`
  
  `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
  
  When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting `[billing_address](/docs/api/customers/customer-object#billing_address)`
  
  `country` as `XI`. That's the code for **United Kingdom - Northern Ireland**. The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.

- `entity_identifier_scheme` (optional, string, max chars=50)
  The Peppol BIS scheme associated with the `[vat_number](/docs/api/customers/customer-object#vat_number)` of the customer. This helps identify the specific type of customer entity. For example, `DE:VAT` is used for a German business entity while `DE:LWID45` is used for a German government entity. The value must be from the list of possible values and must correspond to the country provided under `billing_address.country`. See [list of possible values](https://www.chargebee.com/docs/e-invoicing.html#supported-countries) .
  
  **Tip:**
  
  If there are additional entity identifiers for the customer not associated with the `vat_number`, they can be provided as the `entity_identifiers[]` array.

- `entity_identifier_standard` (optional, string, default=iso6523-actorid-upis, max chars=50)
  The standard used for specifying the `entity_identifier_scheme`. Currently only `iso6523-actorid-upis` is supported and is used by default when not provided.
  
  **Tip:**
  
  If there are additional entity identifiers for the customer not associated with the `vat_number`, they can be provided as the `entity_identifiers[]` array.

- `billing_address` (optional, billing_address)
  Billing address for a customer.
  - `first_name` (optional, string, max chars=150)
    The first name of the billing contact.
  - `last_name` (optional, string, max chars=150)
    The last name of the billing contact.
  - `email` (optional, string, max chars=70)
    The email address.
  - `company` (optional, string, max chars=250)
    The company name.
  - `phone` (optional, string, max chars=50)
    The phone number.
  - `line1` (optional, string, max chars=150)
    Address line 1
  - `line2` (optional, string, max chars=150)
    Address line 2
  - `line3` (optional, string, max chars=150)
    Address line 3
  - `city` (optional, string, max chars=50)
    The name of the city.
  - `state_code` (optional, string, max chars=50)
    The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada, India and UAE. For instance, for Arizona (USA), set `state_code` as `AZ` (not `US-AZ` ). For Tamil Nadu (India), set as `TN` (not `IN-TN` ). For British Columbia (Canada), set as `BC` (not `CA-BC` ). For Dubai (UAE), set as `DU` (not `AE-DU` ).
  - `state` (optional, string, max chars=50)
    State or Province
  - `country` (optional, string, max chars=50)
    The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html) .
    
    **Note**: If you enter an invalid country code, the system will return an error.
    
    **Brexit**
    
    If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom - Northern Ireland**) is available as an option.
  - `zip` (optional, string, max chars=20)
    Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address) .
  - `validation_status` (optional, enumerated string, default=not_validated)
    The address verification status.
    Possible enum values:
      - `not_validated`
        Address is not yet validated.
      - `valid`
        Address was validated successfully.
      - `partially_valid`
        The address is valid for taxability but has not been validated for shipping.
      - `invalid`
        Address is invalid.

- `referral_urls` (optional, list of referral_url)
  List of referral urls for the customer (if applicable)
  - `external_customer_id` (optional, string, max chars=100)
    External customer id in the referral system
  - `referral_sharing_url` (required, string, max chars=50)
    Referral sharing url for the customer
  - `created_at` (required, timestamp(UTC) in seconds)
    The referral url creation time
  - `updated_at` (required, timestamp(UTC) in seconds)
    The referral url updation time
  - `referral_campaign_id` (required, string, max chars=50)
    Referral campaign id
  - `referral_account_id` (required, string, max chars=50)
    Referral account id
  - `referral_external_campaign_id` (optional, string, max chars=50)
    Referral external campaign id
  - `referral_system` (required, enumerated string)
    Url for the referral system account
    Possible enum values:
      - `referral_candy`
        Referral Candy
      - `referral_saasquatch`
        Referral Saasquatch
      - `friendbuy`
        Friendbuy

- `contacts` (optional, list of contact)
  contacts
  - `id` (required, string, max chars=150)
    Unique reference ID provided for the contact.
  - `first_name` (optional, string, max chars=150)
    First name of the contact.
  - `last_name` (optional, string, max chars=150)
    Last name of the contact.
  - `email` (required, string, max chars=70)
    Email of the contact.
  - `phone` (optional, string, max chars=50)
    Phone number of the contact.
  - `label` (optional, string, max chars=50)
    Label/Tag provided for contact.
  - `enabled` (required, boolean, default=false)
    Contact enabled / disabled
  - `send_account_email` (required, boolean, default=false)
    Whether Account Emails option is enabled for the contact.
  - `send_billing_email` (required, boolean, default=false)
    Whether Billing Emails option is enabled for the contact.

- `payment_method` (optional, payment_method)
  Primary Payment Source of the customer.
  - `type` (required, enumerated string)
    Type of payment source
    Possible enum values:
      - `card`
        Card based payment including credit cards and debit cards. Details about the card can be obtained from the card resource.
      - `paypal_express_checkout`
        Payments made via PayPal Express Checkout.
      - `amazon_payments`
        Payments made via Amazon Payments.
      - `direct_debit`
        Represents bank account for which the direct debit or ACH agreement/mandate is created.
      - `generic`
        Payments made via Generic Payment Method.
      - `alipay`
        Payments made via Alipay.
        
        This payment source is deprecated.
      - `unionpay`
        Payments made via UnionPay.
      - `apple_pay`
        Payments made via Apple Pay.
      - `wechat_pay`
        Payments made via WeChat Pay.
        
        This payment source is deprecated.
      - `ideal`
        Payments made via iDEAL.
      - `google_pay`
        Payments made via Google Pay.
      - `sofort`
        Payments made via Sofort.
      - `bancontact`
        Payments made via Bancontact Card.
      - `giropay`
        Payments made via giropay.
      - `dotpay`
        Payments made via Dotpay.
      - `upi`
        UPI Payments.
      - `netbanking_emandates`
        Netbanking (eMandates) Payments.
      - `venmo`
        Payments made via Venmo
      - `pay_to`
        Payments made via PayTo
      - `faster_payments`
        Payments made via Faster Payments
      - `sepa_instant_transfer`
        Payments made via Sepa Instant Transfer
      - `automated_bank_transfer`
        Represents virtual bank account using which the payment will be done.
      - `klarna_pay_now`
        Payments made via Klarna Pay Now
      - `online_banking_poland`
        Payments made via Online Banking Poland
      - `payconiq_by_bancontact`
        Payments made via Payconiq by Bancontact.
      - `electronic_payment_standard`
        Electronic Payment Standard
      - `kbc_payment_button`
        KBC Payment Button
      - `pay_by_bank`
        Pay By Bank
      - `trustly`
        Trustly
      - `stablecoin`
        Payments made via Stablecoin.
      - `kakao_pay`
        Payments made via Kakao Pay.
      - `naver_pay`
        Payments made via Naver Pay.
      - `revolut_pay`
        Payments made via Revolut Pay.
      - `cash_app_pay`
        Payments made via Cash App Pay.
      - `twint`
        Payments made via Twint
      - `go_pay`
        Payments made via GoPay
      - `grab_pay`
        Payments made via GrabPay
      - `pay_co`
        Payments made via PayCo
      - `after_pay`
        Payments made via Afterpay
      - `swish`
        Payments made via Swish
      - `payme`
        Payments made via PayMe
      - `pix`
        Payments made via Pix
      - `klarna`
        Payments made via Klarna.
      - `alipay_hk`
        Payments made via Alipay HK.
      - `paypay`
        Payments made via PayPay
      - `gcash`
        Payments made via GCash.
      - `south_korean_cards`
        Payments made via South Korean Cards
      - `paynow`
      - `bizum`
      - `promptpay`
      - `dana`
        Payments made via Dana.
      - `touch_n_go`
        Payments made via Touch 'n Go.
      - `tamara`
        Payments made via Tamara.
      - `qpay`
        Payments made via Qpay.
      - `ovo`
      - `momo`
      - `mercado_pago`
      - `nequi`
      - `nupay`
      - `picpay`
      - `thai_qr`
      - `blik`
      - `fpx`
      - `wero`
      - `p24`
      - `affirm_pay`
      - `rakuten_pay`
  - `gateway` (required, enumerated string)
    Name of the gateway the payment method is associated with.
    Possible enum values:
      - `chargebee`
        Chargebee test gateway.
      - `chargebee_payments`
        Chargebee Payments gateway
      - `adyen`
        Adyen is a payment gateway.
      - `stripe`
        Stripe is a payment gateway.
      - `wepay`
        WePay is a payment gateway.
      - `braintree`
        Braintree is a payment gateway.
      - `authorize_net`
        Authorize.net is a payment gateway
      - `paypal_pro`
        PayPal Pro Account is a payment gateway.
      - `pin`
        Pin is a payment gateway
      - `eway`
        eWAY Account is a payment gateway.
      - `eway_rapid`
        eWAY Rapid is a payment gateway.
      - `worldpay`
        WorldPay is a payment gateway
      - `balanced_payments`
        Balanced is a payment gateway
      - `beanstream`
        Bambora(formerly known as Beanstream) is a payment gateway.
      - `bluepay`
        BluePay is a payment gateway.
      - `elavon`
        Elavon Virtual Merchant is a payment solution.
      - `first_data_global`
        First Data Global Gateway Virtual Terminal Account
      - `hdfc`
        HDFC Account is a payment gateway.
      - `migs`
        MasterCard Internet Gateway Service payment gateway.
      - `nmi`
        NMI is a payment gateway.
      - `ogone`
        Ingenico ePayments (formerly known as Ogone) is a payment gateway.
      - `paymill`
        PAYMILL is a payment gateway.
      - `paypal_payflow_pro`
        PayPal Payflow Pro is a payment gateway.
      - `sage_pay`
        Sage Pay is a payment gateway.
      - `tco`
        2Checkout is a payment gateway.
      - `wirecard`
        WireCard Account is a payment service provider.
      - `amazon_payments`
        Amazon Payments is a payment service provider.
      - `paypal_express_checkout`
        PayPal Express Checkout is a payment gateway.
      - `gocardless`
        GoCardless is a payment service provider.
      - `orbital`
        Chase Paymentech(Orbital) is a payment gateway.
      - `moneris_us`
        Moneris USA is a payment gateway.
      - `moneris`
        Moneris is a payment gateway.
      - `bluesnap`
        BlueSnap is a payment gateway.
      - `cybersource`
        CyberSource is a payment gateway.
      - `vantiv`
        Vantiv is a payment gateway.
      - `checkout_com`
        Checkout.com is a payment gateway.
      - `paypal`
        PayPal Commerce is a payment gateway.
      - `ingenico_direct`
        Worldline Online Payments is a payment gateway.
      - `exact`
        Exact Payments is a payment gateway.
      - `mollie`
        Mollie is a payment gateway.
      - `quickbooks`
        Intuit QuickBooks Payments gateway
      - `razorpay`
        Razorpay is a fast growing payment service provider in India working with all leading banks and support for major local payment methods including Netbanking, UPI etc.
      - `global_payments`
        Global Payments is a payment service provider.
      - `bank_of_america`
        Bank of America is a payment gateway.
      - `ecentric`
        Ecentric provides a seamless payment processing service in South Africa specializing on omnichannel capabilities.
      - `metrics_global`
        Metrics global is a leading payment service provider providing unified payment services in the US.
      - `windcave`
        Windcave provides an end to end payment processing solution in ANZ and other leading global markets.
      - `pay_com`
        Pay.com provides payment services focused on simplicity and hassle-free operations for businesses of all sizes.
      - `ebanx`
        EBANX is a payment gateway, enabling businesses to accept diverse local payment methods from various countries for increased market reach and conversion.
      - `dlocal`
        Dlocal provides payment solutions for global commerce by accepting local payment methods.
      - `nuvei`
        Nuvei is a secure and reliable payment processing solution that allows you to accept payments from customers and suitable for various types of businesses.
        
        This feature is a **Private Beta Release**. [Request access](https://app.chargebee.com/login?forward=https://app.chargebee.com/request_access/nuvei&ref=feature) to enable Nuvei for your test and live sites.
      - `solidgate`
        Solidgate is a secure and reliable payment processing solution that allows you to accept payments from customers and is suitable for various types of businesses.
      - `paystack`
        Paystack is a payment gateway for businesses in Africa. It enables secure payment acceptance both online and offline.
        
        This feature is a **Private Beta Release**. [Request access](https://app.chargebee.com/login?forward=https://app.chargebee.com/request_access/paystack&ref=feature) to enable Paystack for your test and live sites.
      - `jp_morgan`
        J.P. Morgan Mobility Payment Solutions is a payment gateway that enables you to securely accept and manage digital payments across different [`payment_source_type`](/docs/api/payment_sources/payment_source-object#type).
      - `deutsche_bank`
        Deutsche Bank is the leading German bank with strong European roots and a global network.
      - `ezidebit`
        Ezidebit is a payment gateway integration based in Australia that supports automated direct debit, BPAY, and card payments for businesses.
        
        Ezidebit is in beta.
      - `twikey`
        Twikey is a payment service provider that specializes in processing direct debit payments across the EU.
      - `tempus`
        Tempus Technologies is a payment gateway and payments technology provider offering secure payment processing with point-to-point encryption (P2PE) and tokenization.
      - `moyasar`
        Moyasar is a fully integrated online payment service that makes accepting payments simple and secure.
      - `payway`
        Payway is a payment gateway that enables secure card and payment acceptance.
      - `payu`
      - `not_applicable`
        Indicates that payment gateway is not applicable for this resource.
  - `gateway_account_id` (optional, string, max chars=50)
    The gateway account this payment method is stored with.
  - `status` (required, enumerated string, default=valid)
    Current status of the payment source.
    Possible enum values:
      - `valid`
        A payment source that is valid and active.
      - `expiring`
        A payment source that is expiring (like card's status based on its expiry date).
      - `expired`
        A payment source that has expired
      - `invalid`
        The billing agreement cannot be used. It might become valid again either automatically or due to customer action.
      - `pending_verification`
        The payment source needs to be verified
  - `reference_id` (required, string, max chars=200)
    The reference id. In the case of Amazon and PayPal this will be the 'billing agreement id'. For GoCardless direct debit this will be 'mandate id'. In the case of card payments this will be the identifier provided by the gateway/card vault for the specific payment method resource. **Note:** This is not the one time temporary token provided by gateways like Stripe.

- `balances` (optional, list of customer_balance)
  The list of balances for this customer.
  - `promotional_credits` (required, in cents, default=0, min=0)
    Promotional credits balance of this customer.
  - `excess_payments` (required, in cents, default=0, min=0)
    Total unused payments associated with the customer. These are automatically applied to new invoices subject to [limits set at the site level](https://www.chargebee.com/docs/billing/2.0/invoices-credit-notes-and-quotes/credit-notes#credits-flexibility) which can be overridden for subscriptions via [`subscription.billing_override`](/docs/api/subscriptions/subscription-object#billing_override).
  - `refundable_credits` (required, in cents, default=0, min=0)
    Refundable credits balance of this customer. These are automatically applied to new invoices subject to [limits set at the site level](https://www.chargebee.com/docs/billing/2.0/invoices-credit-notes-and-quotes/credit-notes#credits-flexibility) which can be overridden for subscriptions via [`subscription.billing_override`](/docs/api/subscriptions/subscription-object#billing_override).
  - `unbilled_charges` (required, in cents, default=0, min=0)
    Total unbilled charges for this customer.
  - `currency_code` (required, string, max chars=3)
    The currency code (ISO 4217 format) for balance.
  - `business_entity_id` (optional, string, max chars=50)
    The unique identifier of the [business entity](/docs/api/business_entities) associated with this balance.

- `entity_identifiers` (optional, list of entity_identifier)
  Each element of the `entity_identifiers[]` array identifies a specific customer entity with the e-invoicing system. If the customer has only one entity identifier whose `value` is the `vat_number` , then this array is not needed as the `scheme` can be provided via `entity_identifier_scheme`. This array holds any additional entity identifiers that the customer may have.
  - `id` (required, string, max chars=40)
    The unique id for the `entity_identifier` in Chargebee. When not provided, it is autogenerated.
  - `value` (optional, string, max chars=50)
    The value of the `entity_identifier`. This identifies the customer entity on the Peppol network. For example: `10101010-STO-10` .
    
    **Tip:**
    
    If there is only one entity identifier for the customer and the value is the same as `vat_number`, then there is no need to provide the `entity_identifiers[]` array. See [description for `entity_identifiers[]`](/docs/api/customers/customer-object#entity_identifiers).
  - `scheme` (required, string, max chars=50)
    The Peppol BIS scheme associated with the `[vat_number](/docs/api/customers/customer-object#vat_number)` of the customer. This helps identify the specific type of customer entity. For example, `DE:VAT` is used for a German business entity while `DE:LWID45` is used for a German government entity. The value must be from the list of possible values and must correspond to the country provided under `billing_address.country`. See [list of possible values](https://www.chargebee.com/docs/e-invoicing.html#supported-countries) .
    
    **Tip:**
    
    If there is only one entity identifier for the customer and the value is the same as `vat_number`, then there is no need to provide the `entity_identifiers[]` array. See [description for `entity_identifiers[]`](/docs/api/customers/customer-object#entity_identifiers).
  - `standard` (optional, string, default=iso6523-actorid-upis, max chars=50)
    The standard used for specifying the `entity_identifier` `scheme`. Currently, only `iso6523-actorid-upis` is supported and is used by default when not provided.
    
    **Tip:**
    
    If there is only one entity identifier for the customer and the value is the same as `vat_number`, then there is no need to provide the `entity_identifiers[]` array. See [description for `entity_identifiers[]`](/docs/api/customers/customer-object#entity_identifiers).

- `tax_providers_fields` (optional, list of tax_providers_field)
  This represents information related to custom [Tax Provider Fields](/docs/api/subscriptions). It includes the provider name, field Id, and its corresponding field value. It is used to send custom Tax provider fields to any tax provider.
  - `provider_name` (required, string, max chars=50)
    Name of the tax vendor currently we support.
  - `field_id` (required, string, max chars=50)
    Field id of the attribute which tax vendor has provided while getting onboarded with us.
  - `field_value` (required, string, max chars=50)
    Field value of the corresponding tax field.

- `relationship` (optional, relationship)
  The [account hierarchy](https://www.chargebee.com/docs/account-hierarchy.html) relationship that the customer is part of.
  - `parent_id` (optional, string, max chars=50)
    The `id` of the immediate parent of this customer under account hierarchy. If the customer is the root of the hierarchy, this attribute isn't returned.
  - `payment_owner_id` (required, string, max chars=50)
    The `id` of the customer responsible for paying the invoices for this customer. This ID must match either this customer's ID or the `invoice_owner_id` .
  - `invoice_owner_id` (required, string, max chars=50)
    The `id` of the customer who receives the invoice for charges incurred by the customer. This ID must match either this customer or one of its ancestors.

- `parent_account_access` (optional, parent_account_access)
  When the customer is part of an [account hierarchy](https://www.chargebee.com/docs/account-hierarchy.html), this attribute defines the level of access that the parent account has to the customer's information. **Note:** the 'parent' is the customer whose id is [payment\_owner\_id](/docs/api/customers/customer-object#relationship_payment_owner_id). However, if the `payment_owner_id` is the customer itself, then the parent is [parent\_id](/docs/api/customers/customer-object#relationship_parent_id) .
  - `portal_edit_child_subscriptions` (optional, enumerated string)
    Determines the parent's access to the child's subscriptions in the Self-Serve Portal.
    Possible enum values:
      - `yes`
        The parent can view and edit the child's subscriptions.
      - `view_only`
        The parent can only view the child's subscriptions.
      - `no`
        The parent can't view or edit the child's subscriptions.
  - `portal_download_child_invoices` (optional, enumerated string)
    Determines the parent's access to the child's invoices in the Self-Serve Portal.
    Possible enum values:
      - `yes`
        The parent can both view and download the child's invoices.
      - `view_only`
        The parent can view but not download the child's invoices.
      - `no`
        The parent can't view or download the child's invoices.
  - `send_subscription_emails` (required, boolean)
    Determines whether the parent receives email notifications for the child's subscriptions.
  - `send_invoice_emails` (required, boolean)
    Determines whether the parent receives email notifications for the child's invoices.
  - `send_payment_emails` (required, boolean)
    Determines whether, the parent receives email notifications for payment-related activities on the child's invoices.

- `child_account_access` (optional, child_account_access)
  When the customer is part of an [account hierarchy](https://www.chargebee.com/docs/account-hierarchy.html) , this attribute defines the level of access that the customer has to its own information.
  - `portal_edit_subscriptions` (optional, enumerated string)
    Determines the child's access to its own subscriptions in the Self-Serve Portal.
    Possible enum values:
      - `yes`
        The child account can view and edit its subscriptions.
      - `view_only`
        The child account can only view its subscriptions.
  - `portal_download_invoices` (optional, enumerated string)
    Determines the child's access to its own invoices in the Self-Serve Portal.
    Possible enum values:
      - `yes`
        The child account can both view and download its invoices.
      - `view_only`
        The child account can view but not download its invoices.
      - `no`
        The child account cannot view or download its own invoices.
  - `send_subscription_emails` (required, boolean)
    Determines whether the child account receives email notifications for its subscriptions.
  - `send_invoice_emails` (required, boolean)
    Determines whether the child account receives email notifications for its invoices.
  - `send_payment_emails` (required, boolean)
    Determines whether the child account receives email notifications for payment-related activities for its invoices.

