ChargebeeAPI

Customers

Represents a customer, which can be an individual or organization that subscribes to your products or services. The customer resource associates with subscriptions, card information, and billing addresses. The customer details include their ID, name, contact information, and any custom attributes you'd like to associate with them.

Breaking Change:

  • Sites** created before March 1, 2014**: updating the card 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 CustomerJSON

Customers attributes

id
required, string, max chars=50

Identifier of the customer.

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

country as XI (which is United Kingdom - Northern Ireland ), the first two characters of the full VAT number can be overridden by setting vat_number_prefix .

auto_collection
required, enumerated string, default=on

Whether payments needs to be collected automatically for this customer

Possible Enum Values
on

Whenever an invoice is created, an automatic attempt to charge the customer's payment method is made.

off

Automatic collection of charges will not be made. All payments must be recorded offline.

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

net_term_days
required, integer, default=0

The number of days within which the customer has to make payment for the invoice.

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 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

Customer location is validated based on IP address and Card issuing country. If the location is valid, it returns True. If not, it returns False. Applicable only for EU, New Zealand and Australia.

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. Used primarily for referral integrations and EU/UK VAT validation.

exemption_details
optional, jsonarray

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 integration. To know more about what values you need to provide, refer to this Avalara's API document .

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. 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 feature or when using the TaxJar integration, no other action is needed.
  • However, when using our Avalara integration, optionally, specify entity_code or exempt_number attributes if you use Chargebee's AvaTax for Sales or specify exemption_details attribute if you use Chargebee's AvaTax for Communications 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 .

Possible Enum Values
a

Federal government

b

State government

c

Tribe/Status Indian/Indian Band

d

Foreign diplomat

e

Charitable or benevolent organization

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 .

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

Applicable when calendar billing (with customer specific billing date support) is enabled. When set, renewals of all the monthly and yearly subscriptions of this customer will be aligned to this date.

billing_month
optional, integer, min=1, max=12

billing_month, together with billing_date, specify, for this customer, the day of the year when the renewals of all the year-based subscriptions take place.

For example, the renewals happen on 15th July when billing_month is 7 and billing_date is 15.

Note Applicable when Calendar Billing (with customer-specific billing date support) is enabled and billing_date_mode is manually_set.

billing_date_mode
optional, enumerated string

Indicates whether this customer's billing_date value is derived as per configurations or its specifically set (overriden). When specifically set, the billing_date will not be reset even when all of the monthly/yearly 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)

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 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 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) 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) 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 for more information.

active_id
optional, string, max chars=50

This attribute is only valid for product catalog 2.0 as the Multiple Business Entity features can only be enabled for product catalog 2.0.

fraud_flag
optional, enumerated string

Indicates whether or not the customer has been identified as fraudulent.

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

Primary payment source for the customer.

backup_payment_source_id
optional, string, max chars=40

Backup payment source for the customer. Used to collect payment if primary payment source fails.

invoice_notes
optional, string, max chars=2000

A customer-facing note added to all invoices associated with this API resource. This note becomes one among all the notes displayed on the invoice PDF.

business_entity_id
optional, string, max chars=50

The ID of the business entity created for the site. For Product Catalog 1.0, all the site data is tied to this business entity.

Note

Multiple Business Entities is a feature available only on Product Catalog 2.0.

preferred_currency_code
optional, string, max chars=3

The currency code of the customer's preferred currency (ISO 4217 format). Applicable if the Multicurrency feature is enabled.

promotional_credits
required, in cents, min=0

Promotional credits balance of this 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

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 einvoice 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 .

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 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. This attribute is applicable only when Consolidated Invoicing is enabled.

Note:

Any invoices raised when a subscription activates from in_trial or future status, are not consolidated by default. Contact Support to enable consolidation for such invoices.

customer_type
optional, enumerated string

Indicates the type of the customer. This is applicable only if you use Chargebee's AvaTax for Communications integration.

Possible Enum Values
residential

When the purchase is made by a customer for home use

business

When the purchase is made at a place of business

senior_citizen

When the purchase is made by a customer who meets the jurisdiction requirements to be considered a senior citizen and qualifies for senior citizen tax breaks

industrial

When the purchase is made by 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

Indicates the Client profile id for the customer. This is applicable only if you use Chargebee's AvaTax for Communications integration.

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. Only applicable specifically for customers with billing_address

country as XI (which is United Kingdom - Northern Ireland ).

When you have enabled EU VAT in 2021 or have manually enabled the Brexit configuration, you have the option of setting 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 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 .

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.

referral_urls
optional, list of referral_url

List of referral urls for the customer (if applicable)

contacts
optional, list of contact

contacts

payment_method
optional, payment_method

Primary Payment Source of the customer.

balances
optional, list of customer_balance

The list of balances for this customer

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.

tax_providers_fields
optional, list of tax_providers_field

This represents information related to custom Tax Provider Fields. 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.

relationship
optional, relationship

The account hierarchy relationship that the customer is part of.

parent_account_access
optional, parent_account_access

When the customer is part of an account hierarchy, 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. However, if the payment_owner_id is the customer itself, then the parent is parent_id .

child_account_access
optional, child_account_access

When the customer is part of an account hierarchy , this attribute defines the level of access that the customer has to its own information.