Represents a customer. Subscriptions, Card and Billing Address are associated with the customer resource. Customer resource will be created along with subscription via "Create a Subscription" API. The id of the customer will be same as that of associated subscription id if not explictly set.

The Billing Address is significant especially when EU VAT taxes are involved, for tax calculations will be based on this address. For customers without Billing Address, EU VAT taxes will not be included. Thus ensure to set this properly if you have configured EU VAT Tax.

Note: For the customers who signed up before 1st Mar 2014, Customer's Billing Address and 'vat_number' will be replaced automatically whenever the associated Card gets updated. i.e existing values for Billing Address and 'vat_number' will be cleared and the new values will be set. This behaviour is changed now - The VAT Number should always be passed along Billing Address and not with Card address. Both the addresses have to be dealt separately.

Sample customer [ JSON ]

{ "id": "4gkYnd21ouvW", "email": "jane@test.com", "auto_collection": "on", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1412101852, "resource_version": 1412101852000, "deleted": false, "object": "customer", "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }

API Index URL GET

https://{site}.chargebee.com/api/v2/customers
id
Identifier of the customer.
string, max chars=50
first_name
First name of the customer.
optional, string, max chars=150
last_name
Last name of the customer.
optional, string, max chars=150
email
Email of the customer. Configured email notifications will be sent to this email.
optional, string, max chars=70
phone
Phone number of the customer.
optional, string, max chars=50
company
Company name of the customer.
optional, string, max chars=250
vat_number
VAT/ Tax registration number of the customer. Learn more.
optional, string, max chars=20
auto_collection
Whether payments needs to be collected automatically for this customer.
enumerated string, default=on
Possible values are
onWhenever an invoice is created, an automatic attempt to charge the customer's payment method is made.offAutomatic collection of charges will not be made. All payments must be recorded offline.
net_term_days
The number of days within which the customer has to make payment for the invoice.
integer, default=0
allow_direct_debit
Whether the customer can pay via Direct Debit.
boolean, default=false
created_at
Timestamp indicating when this customer resource is created.
timestamp(UTC) in seconds
created_from_ip
The IP address of the customer. Used primarly for referral integration and EU VAT validation.
optional, string, max chars=50
taxability
Specifies if the customer is liable for tax.
optional, enumerated string, default=taxable
Possible values are
taxableCustomer is taxable.exemptCustomer is exempted from tax.
entity_code
The exemption category of the customer, for the USA and Canada. applicable if you use Chargebee's Avalara integration.
optional, enumerated string
Possible values are
aFederal government (United States).bState government (United States).cTribe/Status Indian/Indian Band (both).dForeign diplomat (both).
eCharitable or benevolent org (both).fReligious or educational org (both).gResale (both).hCommercial agricultural production (both).iIndustrial production/manufacturer (both).jDirect pay permit (United States).kDirect mail (United States).lOther (both).nLocal government (United States).pCommercial aquaculture (Canada).qCommercial Fishery (Canada).rNon-resident (Canada).med1US Medical Device Excise Tax with exempt sales tax.med2US Medical Device Excise Tax with taxable sales tax.
Show all values[+]
exempt_number
Any string value that will cause the sale to be exempted. Use this if your finance team manually verifies and tracks exemption certificates. Applicable only for Avalara.
optional, string, max chars=100
resource_version
Version number of this resource. Each update of this resource results in incremental change of this number. This attribute will be present only if the resource has been updated after 2016-09-28.
optional, long
updated_at
Timestamp indicating when this customer was last updated. This attribute will be present only if the resource has been updated after 2016-09-28.
optional, timestamp(UTC) in seconds
locale
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.
optional, string, max chars=50
consolidated_invoicing
Applicable when consolidated invoicing is enabled. Indicates whether invoice consolidation should happen during subscription renewals. Needs to be set only if this value is different from the defaults configured.
optional, boolean
billing_date
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.
optional, integer, min=1, max=31
billing_date_mode
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.
optional, enumerated string
Possible values are
using_defaultsBilling date is set based on defaults configured.manually_setBilling date is specifically set (default configuration is overridden).
billing_day_of_week
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.
optional, enumerated string
Possible values are
sundaySunday.mondayMonday.tuesdayTuesday.wednesdayWednesday.thursdayThursday.fridayFriday.saturdaySaturday.
billing_day_of_week_mode
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.
optional, enumerated string
Possible values are
using_defaultsBilling date is set based on defaults configured.manually_setBilling date is specifically set (default configuration is overridden).
fraud_flag
Indicates whether or not the customer has been identified as fraudulent.
optional, enumerated string
Possible values are
safeThe customer has been marked as safe.suspiciousThe customer has been identified as potentially fraudulent by the gateway.fraudulentThe customer has been marked as fraudulent.
primary_payment_source_id
Primary payment source for the customer.
optional, string, max chars=40
backup_payment_source_id
Backup payment source for the customer. Used to collect payment if primary payment source fails.
optional, string, max chars=40
invoice_notes
Invoice Notes for this resource. Read More.
optional, string, max chars=1000
preferred_currency_code
TThe currency code of the customer's preferred currency (ISO 4217 format). Applicable if the Multicurrency feature is enabled.
optional, string, max chars=3
promotional_credits
Promotional credits balance of this customer.
in cents, min=0
unbilled_charges
Total unbilled charges for this customer.
in cents, min=0
refundable_credits
Refundable credits balance of this customer.
in cents, min=0
excess_payments
Total unused payments associated with the customer.
in cents, min=0
meta_data
Additional data about this resource can be stored here in the JSON Format. Learn more.
optional, jsonobject
deleted
Indicates that this resource has been deleted.
boolean
registered_for_gst
Confirms that a customer is registered under GST. This field is available for Australia only.
optional, boolean
billing_address
Show attributes[+]
Billing address for a customer.
optional, billing_address
Billing addres attributes
first_name
First name.
optional, string, max chars=150
last_name
Last name.
optional, string, max chars=150
email
Email.
optional, string, max chars=70
company
Company name.
optional, string, max chars=250
phone
Phone number.
optional, string, max chars=50
line1
Address line 1.
optional, string, max chars=150
line2
Address line 2.
optional, string, max chars=150
line3
Address line 3.
optional, string, max chars=150
city
City.
optional, string, max chars=50
state_code
The ISO 3166-2 state/province code. Supported only for countries US,Canada and India.
optional, string, max chars=50
state
State or Province.
optional, string, max chars=50
country
2-letter ISO 3166 alpha-2 country code.
optional, string, max chars=50
zip
Zip or Postal code.
optional, string, max chars=20
validation_status
The address verification status.
optional, enumerated string, default=not_validated
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
referral_urls
Show attributes[+]
List of referral urls for the customer (if applicable).
optional, list of referral_url
Referral url attributes
external_customer_id
External customer id in the referral system.
optional, string, max chars=100
referral_sharing_url
Referral sharing url for the customer.
string, max chars=50
created_at
The referral url creation time.
timestamp(UTC) in seconds
updated_at
The referral url updation time.
timestamp(UTC) in seconds
referral_campaign_id
Referral campaign id.
string, max chars=50
referral_account_id
Referral account id.
string, max chars=50
referral_external_campaign_id
Referral external campaign id.
optional, string, max chars=50
referral_system
Url for the referral system account.
enumerated string
Possible values are
referral_candyReferral Candy.referral_saasquatchReferral Saasquatch.friendbuyFriendbuy.
contacts.
optional, list of contact
Contact attributes
id
Unique reference ID provided for the contact.
string, max chars=150
first_name
First name of the contact.
optional, string, max chars=150
last_name
Last name of the contact.
optional, string, max chars=150
email
Email of the contact.
string, max chars=70
phone
Phone number of the contact.
optional, string, max chars=50
label
Label/Tag provided for contact.
optional, string, max chars=50
enabled
Contact enabled / disabled.
boolean, default=false
send_account_email
Whether Account Emails option is enabled for the contact.
boolean, default=false
send_billing_email
Whether Billing Emails option is enabled for the contact.
boolean, default=false
payment_method
Show attributes[+]
Primary Payment Source of the customer.
optional, payment_method
Payment method attributes
type
Type of payment source.
enumerated string
Possible values are
cardCard based payment including credit cards and debit cards. Details about the card can be obtained from the card resource.paypal_express_checkoutPayments made via PayPal Express Checkout.amazon_paymentsPayments made via Amazon Payments.direct_debitRepresents bank account for which the direct debit or ACH agreement/mandate is created.genericGeneric Payment Method.alipayAlipay Payments.unionpayUnionPay Payments.apple_payApple Pay Payments.
gateway
Name of the gateway the payment method is associated with.
enumerated string
Possible values are
chargebeeChargebee test gateway.stripeStripe payment gateway.wepayWePay Gateway.braintreeBraintree payment gateway.
authorize_netAuthorize.net payment gateway.paypal_proPaypal Pro Account.pinPin payment gateway.ewayeWAY Account.eway_rapideWAY Rapid gateway.worldpayWorldPay payment gateway.balanced_paymentsBalanced payment gateway.beanstreamBeanstream Account.bluepayBluePay payment gateway.elavonElavon Virtual Merchant.first_data_globalFirst Data Global Gateway Virtual Terminal Account.hdfcHDFC Account.migsMasterCard Internet Gateway Service.nmiNMI gateway.ogoneOgone Account.paymillPAYMILL payment gateway.paypal_payflow_proPayPal Payflow Pro gateway.sage_paySage Pay gateway.tco2Checkout payment gateway.wirecardWireCard Account.amazon_paymentsThe amazon payments.paypal_express_checkoutThe paypal gateway.gocardlessGoCardless.adyenAdyen.not_applicableIndicates that payment gateway is not applicable for this resource.
Show all values[+]
gateway_account_id
The gateway account this payment method is stored with.
optional, string, max chars=50
status
Current status of the payment source.
enumerated string, default=valid
Possible values are
validA payment source that is valid and active.expiringA payment source that is expiring (like card's status based on its expiry date).expiredA payment source that has expired.invalidThe billing agreement cannot be used. It might become valid again either automatically or due to customer action.pending_verificationThe payment source needs to be verified.
reference_id
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.
string, max chars=50

Creates a customer. You can create a customer and then create subscriptions for the customer when required. When creating a customer, you can pass along the billing address and card details.

Passing credit card details to through the API involves PCI liability at your end as sensitive card information passes through your servers. If you wish to avoid that, you can use one of the following integration methodologies if applicable:

  • If you use Stripe, you can also use Stripe.js with your checkout form, to collect card information. Here's how to set this up.
  • If you are using Braintree gateway, you can use Braintree.js with your checkout form.
  • You can also use our Hosted Pages based integration.

The Billing Address is significant especially when EU VAT taxes are involved, for tax calculations will be based on this address. For customers without a billing address, EU VAT taxes will not be included. Thus ensure to set this properly if you have configured EU VAT Tax.

Billing Address attributes shall be explicitly passed for customers paying offline(Cash, Check, Bank Transfer etc).

Note: When an invoice is generated for a customer, the billing address provided for the customer will be stored with the invoice. If the First Name, Last Name, and Company fields do not contain any information under Billing Info, the same will be picked from Customer Details if the same is available there.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers \
     -u {site_api_key}: \
     -d first_name="John" \
     -d last_name="Doe" \
     -d email="john@test.com" \
     -d locale="fr-CA" \
     -d billing_address[first_name]="John" \
     -d billing_address[last_name]="Doe" \
     -d billing_address[line1]="PO Box 9999" \
     -d billing_address[city]="Walnut" \
     -d billing_address[state]="California" \
     -d billing_address[zip]="91789" \
     -d billing_address[country]="US"
copy
curl  https://{site}.chargebee.com/api/v2/customers \
     -u {site_api_key}: \
     -d first_name="John" \
     -d last_name="Doe" \
     -d email="john@test.com" \
     -d locale="fr-CA" \
     -d billing_address[first_name]="John" \
     -d billing_address[last_name]="Doe" \
     -d billing_address[line1]="PO Box 9999" \
     -d billing_address[city]="Walnut" \
     -d billing_address[state]="California" \
     -d billing_address[zip]="91789" \
     -d billing_address[country]="US"

Sample Response [ JSON ]

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

URL Format POST

https://{site}.chargebee.com/api/v2/customers
id
Id for the new customer. If not given, this will be auto-generated.
optional, string, max chars=50
first_name
First name of the customer.
optional, string, max chars=150
last_name
Last name of the customer.
optional, string, max chars=150
email
Email of the customer. Configured email notifications will be sent to this email.
optional, string, max chars=70
preferred_currency_code
The currency code (ISO 4217 format) of the customer. Applicable if Multicurrency is enabled.
optional, string, max chars=3
phone
Phone number of the customer.
optional, string, max chars=50
company
Company name of the customer.
optional, string, max chars=250
auto_collection
Whether payments needs to be collected automatically for this customer.
optional, enumerated string, default=on
Possible values are
onWhenever an invoice is created, an automatic attempt to charge the customer's payment method is made.offAutomatic collection of charges will not be made. All payments must be recorded offline.
net_term_days
The number of days within which the customer has to make payment for the invoice.
optional, integer, default=0
allow_direct_debit
Whether the customer can pay via Direct Debit.
optional, boolean, default=false
vat_number
VAT/ Tax registration number of the customer. Learn more.
optional, string, max chars=20
registered_for_gst
Confirms that a customer is registered under GST. This field is available for Australia only.
optional, boolean
taxability
Specifies if the customer is liable for tax.
optional, enumerated string, default=taxable
Possible values are
taxableCustomer is taxable.exemptCustomer is exempted from tax.
locale
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.
optional, string, max chars=50
entity_code
The exemption category of the customer, for the USA and Canada. applicable if you use Chargebee's Avalara integration.
optional, enumerated string
Possible values are
aFederal government (United States).bState government (United States).cTribe/Status Indian/Indian Band (both).dForeign diplomat (both).
eCharitable or benevolent org (both).fReligious or educational org (both).gResale (both).hCommercial agricultural production (both).iIndustrial production/manufacturer (both).jDirect pay permit (United States).kDirect mail (United States).lOther (both).nLocal government (United States).pCommercial aquaculture (Canada).qCommercial Fishery (Canada).rNon-resident (Canada).med1US Medical Device Excise Tax with exempt sales tax.med2US Medical Device Excise Tax with taxable sales tax.
Show all values[+]
exempt_number
Any string value that will cause the sale to be exempted. Use this if your finance team manually verifies and tracks exemption certificates. Applicable only for Avalara.
optional, string, max chars=100
meta_data
Additional data about this resource can be stored here in the JSON Format. Learn more.
optional, jsonobject
consolidated_invoicing
Applicable when consolidated invoicing is enabled. Indicates whether invoice consolidation should happen during subscription renewals. Needs to be set only if this value is different from the defaults configured.
optional, boolean
invoice_notes
Invoice Notes for this resource. Read More.
optional, string, max chars=1000
card
Parameters for card
pass parameters as card[<param name>]
card[gateway_account_id]
The gateway account in which this payment source is stored.
optional, string, max chars=50
card[first_name]
Cardholder's first name.
optional, string, max chars=50
card[last_name]
Cardholder's last name.
optional, string, max chars=50
card[number]
The credit card number without any format. If you are using Braintree.js, you can specify the Braintree encrypted card number here.
required if card provided, string, max chars=1500
card[expiry_month]
Card expiry month.
required if card provided, integer, min=1, max=12
card[expiry_year]
Card expiry year.
required if card provided, integer
card[cvv]
The card verification value. If you are using Braintree.js, you can specify the Braintree encrypted cvv here.
optional, string, max chars=520
card[billing_addr1]
Address line 1, as available in card billing address.
optional, string, max chars=150
card[billing_addr2]
Address line 2, as available in card billing address.
optional, string, max chars=150
card[billing_city]
City, as available in card billing address.
optional, string, max chars=50
card[billing_state_code]
The ISO 3166-2 state/province code. The recommended way of passing the state/province information. Supported for US, Canada and India now. Further if this is specified, 'state' attribute should not be specified as it will be set automatically.
optional, string, max chars=50
card[billing_state]
The state/province name. Use this to pass the state/province information for cases where 'state_code' is not supported or cannot be passed.
optional, string, max chars=50
card[billing_zip]
Postal or Zip code, as available in card billing address.
optional, string, max chars=20
card[billing_country]
2-letter ISO 3166 alpha-2 country code.
optional, string, max chars=50
payment_method
Parameters for payment_method
pass parameters as payment_method[<param name>]
payment_method[type]
The type of payment method. For more details refer Update payment method for a customer API under Customer resource.
optional, enumerated string
Possible values are
cardCard based payment including credit cards and debit cards. Details about the card can be obtained from the card resource.paypal_express_checkoutPayments made via PayPal Express Checkout.amazon_paymentsPayments made via Amazon Payments.direct_debitRepresents bank account for which the direct debit or ACH agreement/mandate is created.genericGeneric Payment Method.alipayAlipay Payments.unionpayUnionPay Payments.apple_payApple Pay Payments.
payment_method[gateway_account_id]
The gateway account in which this payment source is stored.
optional, string, max chars=50
payment_method[reference_id]
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 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.
For more details refer Update payment method for a customer API under Customer resource.
optional, string, max chars=50
payment_method[tmp_token]
Single-use tokens created by payment gateways. In Stripe, a single-use token is created for Apple Pay Wallet, card details or direct debit. In Braintree, a nonce is created for Apple Pay Wallet, PayPal, or card details.
required if reference_id not provided, string, max chars=150
billing_address
Parameters for billing_address
pass parameters as billing_address[<param name>]
billing_address[first_name]
First name.
optional, string, max chars=150
billing_address[last_name]
Last name.
optional, string, max chars=150
billing_address[email]
Email.
optional, string, max chars=70
billing_address[company]
Company name.
optional, string, max chars=250
billing_address[phone]
Phone number.
optional, string, max chars=50
billing_address[line1]
Address line 1.
optional, string, max chars=150
billing_address[line2]
Address line 2.
optional, string, max chars=150
billing_address[line3]
Address line 3.
optional, string, max chars=150
billing_address[city]
City.
optional, string, max chars=50
billing_address[state_code]
The ISO 3166-2 state/province code. The recommended way of passing the state/province information. Supported for US, Canada and India now. Further if this is specified, 'state' attribute should not be specified as it will be set automatically.
optional, string, max chars=50
billing_address[state]
The state/province name. Use this to pass the state/province information for cases where 'state_code' is not supported or cannot be passed.
optional, string, max chars=50
billing_address[zip]
Zip or Postal code.
optional, string, max chars=20
billing_address[country]
2-letter ISO 3166 alpha-2 country code.
optional, string, max chars=50
billing_address[validation_status]
The address verification status.
optional, enumerated string, default=not_validated
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
Resource object representing customer.
always returned
Resource object representing card.
optional
Retrieves the list of customers.
Sample Request
curl  https://{site}.chargebee.com/api/v2/customers \
     -G  \
     -u {site_api_key}: \
     --data-urlencode limit="5" \
     --data-urlencode first_name[is_not]="John" \
     --data-urlencode last_name[is]="Doe" \
     --data-urlencode email[is_not]="john@test.com" \
     --data-urlencode sort_by[asc]="created_at"
copy
curl  https://{site}.chargebee.com/api/v2/customers \
     -G  \
     -u {site_api_key}: \
     --data-urlencode limit="5" \
     --data-urlencode first_name[is]="John" \
     --data-urlencode last_name[is]="Doe" \
     --data-urlencode email[is]="john@test.com" \
     --data-urlencode sort_by[asc]="created_at"

Sample Response [ JSON ]

{ "list": [ {"customer": { "id": "3Nl8KVeQVm9oZN6B", "first_name": "John", "last_name": "Doe", "email": "john@test.com", "auto_collection": "on", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1505917846, "taxability": "taxable", "updated_at": 1505917846, "locale": "fr-CA", "resource_version": 1505917846000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }}, {..} ], "next_offset": "[\"1505917846000\",\"122000000130\"]" }

URL Format GET

https://{site}.chargebee.com/api/v2/customers
limit
Limits the number of resources to be returned.
optional, integer, default=10, min=1, max=100
offset
Allows you to fetch the next set of resources. The value used for this parameter must be the value returned for next_offset parameter in the previous API call.
optional, string, max chars=1000
include_deleted
If set to true, includes the deleted resources in the response. For the deleted resources in the response, the 'deleted' attribute will be 'true'.
optional, boolean, default=false
sort_by[<sort-order>]
Sorts based on the specified attribute.
Supported attributes : created_at
Supported sort-orders : asc, desc

Example sort_by[asc] = "created_at"
This will sort the result based on the 'created_at' attribute in ascending(earliest first) order.
optional, string filter
Filter Params
For operator usages, see the Pagination and Filtering section.
id[<operator>]
To filter based on Customer Id.
Supported operators : is, is_not, starts_with, in, not_in

Example id[is] = "9bsvnHgsvmsI"
optional, string filter
first_name[<operator>]
To filter based on Customer First Name.
Supported operators : is, is_not, starts_with, is_present

Example first_name[is] = "John"
optional, string filter
last_name[<operator>]
To filter based on Customer Last Name.
Supported operators : is, is_not, starts_with, is_present

Example last_name[is_not] = "Clint"
optional, string filter
email[<operator>]
To filter based on Customer Email.
Supported operators : is, is_not, starts_with, is_present

Example email[is] = "john@test.com"
optional, string filter
company[<operator>]
To filter based on Customer Company.
Supported operators : is, is_not, starts_with, is_present

Example company[is] = "Globex Corp"
optional, string filter
phone[<operator>]
To filter based on Customer Phone.
Supported operators : is, is_not, starts_with, is_present

Example phone[is] = "(541) 754-3010"
optional, string filter
auto_collection[<operator>]
To filter based on Customer Auto Collection. Possible values are : on, off.
Supported operators : is, is_not, in, not_in

Example auto_collection[is] = "on"
optional, enumerated string filter
taxability[<operator>]
To filter based on Customer Taxability. Possible values are : taxable, exempt.
Supported operators : is, is_not, in, not_in

Example taxability[is] = "taxable"
optional, enumerated string filter
created_at[<operator>]
To filter based on Customer Created At.
Supported operators : after, before, on, between

Example created_at[after] = "1435054328"
optional, timestamp(UTC) in seconds filter
updated_at[<operator>]
To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
Supported operators : after, before, on, between

Example updated_at[after] = "1243545465"
optional, timestamp(UTC) in seconds filter
Resource object representing customer.
always returned
Resource object representing card.
optional
next_offset
This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter “offset”.
optional, string, max chars=1000
Retrieves the customer identified by the unique identifier.
Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW \
     -u {site_api_key}:

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917839, "resource_version": 1505917839000, "deleted": false, "object": "customer", "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format GET

https://{site}.chargebee.com/api/v2/customers/{customer_id}
Resource object representing customer.
always returned
Resource object representing card.
optional

Sample admin console URL

https://{site}.chargebee.com/admin-console/customers/4gkYnd21ouvW

Updates the customer resource. However this method cannot be used for updating the 'Billing Info' - the Billing Address and 'vat_number' attributes - of the customer. To update the same, use our Update Billing Info API.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW \
     -u {site_api_key}: \
     -d first_name="Denise" \
     -d last_name="Barone" \
     -d locale="fr-CA"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW \
     -u {site_api_key}: \
     -d first_name="Denise" \
     -d last_name="Barone" \
     -d locale="fr-CA"

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917847, "locale": "fr-CA", "resource_version": 1505917847000, "deleted": false, "object": "customer", "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}
first_name
First name of the customer.
optional, string, max chars=150
last_name
Last name of the customer.
optional, string, max chars=150
email
Email of the customer. Configured email notifications will be sent to this email.
optional, string, max chars=70
preferred_currency_code
The currency code (ISO 4217 format) of the customer. Applicable if Multicurrency is enabled.
optional, string, max chars=3
phone
Phone number of the customer.
optional, string, max chars=50
company
Company name of the customer.
optional, string, max chars=250
auto_collection
Whether payments needs to be collected automatically for this customer.
optional, enumerated string
Possible values are
onWhenever an invoice is created, an automatic attempt to charge the customer's payment method is made.offAutomatic collection of charges will not be made. All payments must be recorded offline.
allow_direct_debit
Whether the customer can pay via Direct Debit.
optional, boolean
net_term_days
The number of days within which the customer has to make payment for the invoice.
optional, integer
taxability
Specifies if the customer is liable for tax.
optional, enumerated string
Possible values are
taxableCustomer is taxable.exemptCustomer is exempted from tax.
locale
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.
optional, string, max chars=50
entity_code
The exemption category of the customer, for the USA and Canada. applicable if you use Chargebee's Avalara integration.
optional, enumerated string
Possible values are
aFederal government (United States).bState government (United States).cTribe/Status Indian/Indian Band (both).dForeign diplomat (both).
eCharitable or benevolent org (both).fReligious or educational org (both).gResale (both).hCommercial agricultural production (both).iIndustrial production/manufacturer (both).jDirect pay permit (United States).kDirect mail (United States).lOther (both).nLocal government (United States).pCommercial aquaculture (Canada).qCommercial Fishery (Canada).rNon-resident (Canada).med1US Medical Device Excise Tax with exempt sales tax.med2US Medical Device Excise Tax with taxable sales tax.
Show all values[+]
exempt_number
Any string value that will cause the sale to be exempted. Use this if your finance team manually verifies and tracks exemption certificates. Applicable only for Avalara.
optional, string, max chars=100
invoice_notes
Invoice Notes for this resource. Read More.
optional, string, max chars=1000
meta_data
Additional data about this resource can be stored here in the JSON Format. Learn more.
optional, jsonobject
fraud_flag
Indicates whether or not the customer has been identified as fraudulent.
optional, enumerated string
Possible values are
safeThe customer has been marked as safe.fraudulentThe customer has been marked as fraudulent.
consolidated_invoicing
Applicable when consolidated invoicing is enabled. Indicates whether invoice consolidation should happen during subscription renewals. Needs to be set only if this value is different from the defaults configured.
optional, boolean
Resource object representing customer.
always returned
Resource object representing card.
optional
We recently released Payment Sources, which comes with additional options and improvements to the Card APIs. For this operation, use the Create using temporary token API or Create using permanent token API under Payment Sources to update payment method for the customer.

Updates payment method details for a customer.

Note: If you wish to pass the card number, CVV, or the single-use card tokens provided by gateways like Stripe, then use the Update card for a customer API under Cards resource. This API is not supported for Chargebee Test Gateway, it is provided to help you understand the billing workflow in Chargebee.

PayPal Express Checkout
You can use this API if you are directly integrating PayPal Express Checkout in your website instead of using ChargeBee's hosted pages. When your customer updates his payment method using PayPal Express Checkout, you will be provided with the Billing Agreement ID by PayPal. You can update the payment method for that customer in Chargebee by passing type as paypal_express_checkout and reference_id with the Billing Agreement ID.

Login and Pay with Amazon
You can use this API if you are directly integrating Login and Pay with Amazon in your website instead of using ChargeBee's hosted pages. When your customer updates Amazon as a payment method, you will be provided with the Billing Agreement ID by Amazon. You can update the payment method for that customer in Chargebee by passing type as amazon_payments and reference_id with the Billing Agreement ID.

Card Payments
When the card details of your customer are stored in the vault of gateways such as Stripe or Braintree, you can use this API to update the reference id provided by them in Chargebee. To use this API, pass

  • type as card.
  • gateway with the gateway associated with the card. If the gateway is not specified, the default gateway will be used.
  • reference_id with the identifier provided by the gateway/Spreedly to reference that specific card.

Reference id format for Card Payments
The format of reference_id will differ based on where the card is stored.

Stripe: In case of Stripe, the reference_id consists of combination of Stripe Customer ID and Stripe Card ID separated by forward slash (e.g. cus_63MnDn0t6kfDW7/card_6WjCF20vT9WN1G). If you are passing Stripe Customer ID alone, then ChargeBee will store the card marked as active for that customer in Stripe.

Braintree: In case of Braintree, the reference_id consists of combination of Braintree Customer ID and Braintree Payment Method Token separated by forward slash
(e.g. cus_63MnDn0t6kfDW7/card_6WjCF20vT9WN1G). If you are passing Braintree Customer ID alone, then Chargebee will store the card marked as default for that customer in Braintree.

Spreedly Card vault: If the card details are stored in Spreedly vault, then you need to provide the Spreedly token as reference_id.

Direct Debit Payments
When the bank account details of your customer are stored in the gateway vault, you can use this API to update the reference id provided by them in Chargebee. To use this API, pass

  • type as direct_debit.
  • gateway with the gateway where the bank account details are stored (e.g. authorize_net). If the gateway is not specified, the gateway supporting the direct debit will be used.
  • reference_id with the identifier provided by the gateway to reference the customer's bank account details.
  • tmp_token with the single use token provided by the gateway ( Applicable only for Stripe gateway and should be passed only if reference_id is not passed ).

Reference id format for Direct Debit Payments
The format of reference_id will differ based on where the bank account is stored.

Stripe: In case of Stripe, the reference_id consists of combination of Stripe Customer ID and Stripe Bank Account ID separated by forward slash
(e.g. cus_8suoHaLQH4G5AW/ba_18b8z2KmcbENlhgU03RznRYW). If you are passing Stripe Customer ID alone, then Chargebee will store the first bank account details present in payment profile list of that customer in Stripe.

Authorize.Net: The reference_id consists of combination of Authorize.Net's Customer Profile ID and Payment Profile ID separated by forward slash (e.g. 2384383/34834382). If you are passing Authorize.Net's Customer Profile ID alone, then Chargebee will store the first bank account details present in payment profile list of that customer in Authorize.Net.

GoCardless: The reference_id is the GoCardless Customer Mandate ID (e.g. MD0077Z99TTQXK).

Note: While using this API to update payment method details, Card Verification will not happen even if it is enabled for that particular gateway.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/update_payment_method \
     -u {site_api_key}: \
     -d payment_method[type]="paypal_express_checkout" \
     -d payment_method[reference_id]="B-09u9343Sde24D"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/update_payment_method \
     -u {site_api_key}: \
     -d payment_method[type]="paypal_express_checkout" \
     -d payment_method[reference_id]="B-09u9343Sde24D"

Sample Response [ JSON ]

{ "customer": { "id": "3Nl8KfcQVm8uzx76", "first_name": "John", "last_name": "Doe", "email": "john@test.com", "auto_collection": "on", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1505917632, "taxability": "taxable", "updated_at": 1505917654, "resource_version": 1505917654000, "deleted": false, "object": "customer", "billing_address": { "first_name": "Hello", "last_name": "World", "phone": "122242222", "line1": "Wow", "line2": "Cool", "city": "Chennai", "state_code": "TN", "state": "Tamil Nadu", "country": "IN", "zip": "600041", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "valid", "primary_payment_source_id": "pm_3Nl8KVeQVm90j5f", "payment_method": { "object": "payment_method", "type": "card", "reference_id": "cus_BR1DlXDUtJjA5j/card_BR1DUjWxznEUil", "gateway": "stripe", "gateway_account_id": "gw_3Nl8KfcQVm8v1q7G", "status": "valid" }, "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }, "card": { "status": "valid", "gateway": "stripe", "gateway_account_id": "gw_3Nl8KfcQVm8v1q7G", "first_name": "Hello", "last_name": "World", "iin": "******", "last4": "4242", "card_type": "visa", "funding_type": "credit", "expiry_month": 10, "expiry_year": 2020, "issuing_country": "US", "object": "card", "masked_number": "************4242", "customer_id": "3Nl8KfcQVm8uzx76", "payment_source_id": "pm_3Nl8KVeQVm90j5f" } }

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/update_payment_method
payment_method
Parameters for payment_method
pass parameters as payment_method[<param name>]
payment_method[type]
The type of payment method. For more details refer Update payment method for a customer API under Customer resource.
required, enumerated string
Possible values are
cardCard based payment including credit cards and debit cards. Details about the card can be obtained from the card resource.paypal_express_checkoutPayments made via PayPal Express Checkout.amazon_paymentsPayments made via Amazon Payments.direct_debitRepresents bank account for which the direct debit or ACH agreement/mandate is created.genericGeneric Payment Method.alipayAlipay Payments.unionpayUnionPay Payments.
payment_method[gateway_account_id]
The gateway account in which this payment source is stored.
optional, string, max chars=50
payment_method[reference_id]
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 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.
For more details refer Update payment method for a customer API under Customer resource.
optional, string, max chars=50
payment_method[tmp_token]
Single-use toke created by payment gateways. In Stripe, a single-use token is created for card details or direct debit. In Braintree, a nonce is created for PayPal or card details.
required if reference_id not provided, string, max chars=150
Resource object representing customer.
always returned
Resource object representing card.
optional

This method is used for updating the 'Billing Info' - the Billing Address and 'vat_number' attributes - of the customer. For updating the other customer attributes use our Update Customer API.

During this operation if Billing Info(Billing Address and vat_number) is not already present it will get added. Whereas if it is present already, the existing values will be replaced. i.e existing values for Billing Address and vat_number will be cleared and the new values will be set.

Note: When an invoice is generated for a customer, the billing address provided for the customer will be stored with the invoice. If the First Name, Last Name, and Company fields do not contain any information under Billing Info, the same will be picked from Customer Details if the same is available there.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/update_billing_info \
     -u {site_api_key}: \
     -d billing_address[first_name]="John" \
     -d billing_address[last_name]="Doe" \
     -d billing_address[line1]="PO Box 9999" \
     -d billing_address[city]="Walnut" \
     -d billing_address[state]="California" \
     -d billing_address[zip]="91789" \
     -d billing_address[country]="US"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/update_billing_info \
     -u {site_api_key}: \
     -d billing_address[first_name]="John" \
     -d billing_address[last_name]="Doe" \
     -d billing_address[line1]="PO Box 9999" \
     -d billing_address[city]="Walnut" \
     -d billing_address[state]="California" \
     -d billing_address[zip]="91789" \
     -d billing_address[country]="US"

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917847, "locale": "fr-CA", "resource_version": 1505917847000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/update_billing_info
vat_number
VAT/ Tax registration number of the customer. Learn more.
optional, string, max chars=20
registered_for_gst
Confirms that a customer is registered under GST. This field is available for Australia only.
optional, boolean
billing_address
Parameters for billing_address
pass parameters as billing_address[<param name>]
billing_address[first_name]
First name.
optional, string, max chars=150
billing_address[last_name]
Last name.
optional, string, max chars=150
billing_address[email]
Email.
optional, string, max chars=70
billing_address[company]
Company name.
optional, string, max chars=250
billing_address[phone]
Phone number.
optional, string, max chars=50
billing_address[line1]
Address line 1.
optional, string, max chars=150
billing_address[line2]
Address line 2.
optional, string, max chars=150
billing_address[line3]
Address line 3.
optional, string, max chars=150
billing_address[city]
City.
optional, string, max chars=50
billing_address[state_code]
The ISO 3166-2 state/province code. The recommended way of passing the state/province information. Supported for US, Canada and India now. Further if this is specified, 'state' attribute should not be specified as it will be set automatically.
optional, string, max chars=50
billing_address[state]
The state/province name. Use this to pass the state/province information for cases where 'state_code' is not supported or cannot be passed.
optional, string, max chars=50
billing_address[zip]
Zip or Postal code.
optional, string, max chars=20
billing_address[country]
2-letter ISO 3166 alpha-2 country code.
optional, string, max chars=50
billing_address[validation_status]
The address verification status.
optional, enumerated string, default=not_validated
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validAddress is verified but only partially.invalidAddress is invalid.
Resource object representing customer.
always returned
Resource object representing card.
optional

Assign Primary or Backup payment role or unassign role for the payment source based on the preference for the payment collection.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/assign_payment_role \
     -u {site_api_key}: \
     -d role="primary"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/assign_payment_role \
     -u {site_api_key}: \
     -d role="primary"

Sample Response [ JSON ]

{ "payment_source": { "id": "pm_3Nl8KVeQVm8qdN5", "object": "payment_source", "customer_id": "3Nl8KfcQVm8nIa6j", "type": "card", "reference_id": "tok_3Nl8KVeQVm8qcr4", "status": "valid", "gateway": "chargebee", "gateway_account_id": "gw_3Nl8KfcQVm8Whp2", "ip_address": "127.0.0.1", "card": { "first_name": "Hello", "last_name": "World", "iin": "411111", "last4": "1111", "funding_type": "credit", "expiry_month": 10, "expiry_year": 2020, "masked_number": "************1111", "object": "card", "brand": "visa" } }, "customer": { "id": "3Nl8KfcQVm8nIa6j", "first_name": "Hello", "last_name": "World", "email": "john@acmeinc.com", "auto_collection": "on", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1505917615, "created_from_ip": "127.0.0.1", "taxability": "taxable", "updated_at": 1505917616, "resource_version": 1505917616000, "deleted": false, "object": "customer", "billing_address": { "first_name": "Hello", "last_name": "World", "phone": "122242222", "line1": "Wow", "line2": "Cool", "city": "Chennai", "state_code": "TN", "state": "Tamil Nadu", "country": "IN", "zip": "600041", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "valid", "primary_payment_source_id": "pm_3Nl8KVeQVm8qdN5", "payment_method": { "object": "payment_method", "type": "card", "reference_id": "tok_3Nl8KVeQVm8qcr4", "gateway": "chargebee", "gateway_account_id": "gw_3Nl8KfcQVm8Whp2", "status": "valid" }, "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" } }

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/assign_payment_role
payment_source_id
Payment source id this role will be assigned to.
required, string, max chars=40
role
Indicates whether the payment source is Primary, Backup, or neither.
required, enumerated string
Possible values are
primaryPrimary.backupBackup.noneNone.
Resource object representing customer.
always returned
Resource object representing payment_source.
always returned
Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/add_contact \
     -u {site_api_key}: \
     -d contact[first_name]="Jane" \
     -d contact[last_name]="Doe" \
     -d contact[email]="jane@test.com" \
     -d contact[label]="dev" \
     -d contact[enabled]="true" \
     -d contact[send_billing_email]="true" \
     -d contact[send_account_email]="true"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/add_contact \
     -u {site_api_key}: \
     -d contact[first_name]="Jane" \
     -d contact[last_name]="Doe" \
     -d contact[email]="jane@test.com" \
     -d contact[label]="dev" \
     -d contact[enabled]="true" \
     -d contact[send_billing_email]="true" \
     -d contact[send_account_email]="true"

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917847, "locale": "fr-CA", "resource_version": 1505917847000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/add_contact
contact
Parameters for contact
pass parameters as contact[<param name>]
contact[id]
Unique reference ID provided for the contact.
optional, string, max chars=150
contact[first_name]
First name of the contact.
optional, string, max chars=150
contact[last_name]
Last name of the contact.
optional, string, max chars=150
contact[email]
Email of the contact.
required, string, max chars=70
contact[phone]
Phone number of the contact.
optional, string, max chars=50
contact[label]
Label/Tag provided for contact.
optional, string, max chars=50
contact[enabled]
Contact enabled / disabled.
optional, boolean, default=false
contact[send_billing_email]
Whether Billing Emails option is enabled for the contact.
optional, boolean, default=false
contact[send_account_email]
Whether Account Emails option is enabled for the contact.
optional, boolean, default=false
Resource object representing customer.
always returned
Resource object representing card.
optional
Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/update_contact \
     -u {site_api_key}: \
     -d contact[id]="8avaFPYtreDQ5" \
     -d contact[first_name]="Jane" \
     -d contact[last_name]="Doe" \
     -d contact[email]="jane@test.com" \
     -d contact[label]="dev" \
     -d contact[enabled]="true" \
     -d contact[send_billing_email]="true" \
     -d contact[send_account_email]="true"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/update_contact \
     -u {site_api_key}: \
     -d contact[id]="8avaFPYtreDQ5" \
     -d contact[first_name]="Jane" \
     -d contact[last_name]="Doe" \
     -d contact[email]="jane@test.com" \
     -d contact[label]="dev" \
     -d contact[enabled]="true" \
     -d contact[send_billing_email]="true" \
     -d contact[send_account_email]="true"

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917847, "locale": "fr-CA", "resource_version": 1505917847000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/update_contact
contact
Parameters for contact
pass parameters as contact[<param name>]
contact[id]
Unique reference ID provided for the contact.
required, string, max chars=150
contact[first_name]
First name of the contact.
optional, string, max chars=150
contact[last_name]
Last name of the contact.
optional, string, max chars=150
contact[email]
Email of the contact.
optional, string, max chars=70
contact[phone]
Phone number of the contact.
optional, string, max chars=50
contact[label]
Label/Tag provided for contact.
optional, string, max chars=50
contact[enabled]
Contact enabled / disabled.
optional, boolean
contact[send_billing_email]
Whether Billing Emails option is enabled for the contact.
optional, boolean
contact[send_account_email]
Whether Account Emails option is enabled for the contact.
optional, boolean
Resource object representing customer.
always returned
Resource object representing card.
optional
Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/delete_contact \
     -u {site_api_key}: \
     -d contact[id]="8avaFPYtreDQ5"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/delete_contact \
     -u {site_api_key}: \
     -d contact[id]="8avaFPYtreDQ5"

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917847, "locale": "fr-CA", "resource_version": 1505917847000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/delete_contact
contact
Parameters for contact
pass parameters as contact[<param name>]
contact[id]
Unique reference ID provided for the contact.
required, string, max chars=150
Resource object representing customer.
always returned
Resource object representing card.
optional

This API call can be used to add promotional credits to a customer. Learn more about Promotional Credits.

For example, if a customer has credits of $10, if you pass the amount as $10, then the customer’s credit balance would become $20.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/add_promotional_credits \
     -u {site_api_key}: \
     -d amount="500" \
     -d description="Loyalty credits"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/add_promotional_credits \
     -u {site_api_key}: \
     -d amount="500" \
     -d description="Loyalty credits"

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917847, "locale": "fr-CA", "resource_version": 1505917847000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 500, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/add_promotional_credits
amount
Credit amount to be added.
required, in cents, min=1
currency_code
The currency code (ISO 4217 format) of the specified credit amount.
required if Multicurrency is enabled, string, max chars=3
description
Description for this credit.
required, string, max chars=250
credit_type
Source credit type for the promotional credit.
optional, enumerated string, default=general
Possible values are
loyalty_creditsLoyalty Credits.referral_rewardsReferral.generalGeneral.
reference
Reference about the account credit type.
optional, string, max chars=500
Resource object representing customer.
always returned

This API call can be used to deduct promotional credits for a customer. Learn more about Promotional Credits.

For example, if a customer has a credit balance of $20, if you pass the amount as $5, then the customer’s credit balance would become $15.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/deduct_promotional_credits \
     -u {site_api_key}: \
     -d amount="200" \
     -d description="Correcting credits given by mistake"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/deduct_promotional_credits \
     -u {site_api_key}: \
     -d amount="200" \
     -d description="Correcting credits given by mistake"

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917847, "locale": "fr-CA", "resource_version": 1505917847000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 300, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/deduct_promotional_credits
amount
Credit amount to be deducted.
required, in cents, min=1
currency_code
The currency code (ISO 4217 format) of the specified credit amount.
required if Multicurrency is enabled, string, max chars=3
description
Description for this credit.
required, string, max chars=250
credit_type
Source credit type for the promotional credit.
optional, enumerated string, default=general
Possible values are
loyalty_creditsLoyalty Credits.referral_rewardsReferral.generalGeneral.
reference
Reference about the account credit type.
optional, string, max chars=500
Resource object representing customer.
always returned

This API call can be used to set the promotional credits balnce of a customer. Learn more about Promotional Credits.

For example, if a customer has a credit balance of $10 and if you would like to set the balance to $100, you could pass the amount as $100.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/set_promotional_credits \
     -u {site_api_key}: \
     -d amount="1200" \
     -d description="Correcting credits given by mistake"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/set_promotional_credits \
     -u {site_api_key}: \
     -d amount="1200" \
     -d description="Correcting credits given by mistake"

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917847, "locale": "fr-CA", "resource_version": 1505917847000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 1200, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/set_promotional_credits
amount
Credit amount to be set.
required, in cents, min=0
currency_code
The currency code (ISO 4217 format) of the specified credit amount.
required if Multicurrency is enabled, string, max chars=3
description
Description for this credit.
required, string, max chars=250
credit_type
Source credit type for the promotional credit.
optional, enumerated string, default=general
Possible values are
loyalty_creditsLoyalty Credits.referral_rewardsReferral.generalGeneral.
reference
Reference about the account credit type.
optional, string, max chars=500
Resource object representing customer.
always returned

Use this API to record any excess payments made by the customer, such as advance payments. Such payments will be automatically applied to the future invoices. It can also be manually applied to the existing Not Paid or Payment Due invoices.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/record_excess_payment \
     -u {site_api_key}: \
     -d transaction[amount]="500" \
     -d transaction[date]="1435054328" \
     -d transaction[payment_method]="check" \
     -d comment="Check payment received from John"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/record_excess_payment \
     -u {site_api_key}: \
     -d transaction[amount]="500" \
     -d transaction[date]="1435054328" \
     -d transaction[payment_method]="check" \
     -d comment="Check payment received from John"

Sample Response [ JSON ]

{ "customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917847, "locale": "fr-CA", "resource_version": 1505917847000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 1200, "refundable_credits": 0, "excess_payments": 500, "unbilled_charges": 0, "preferred_currency_code": "USD" }, "transaction": { "id": "txn_3Nl8KVeQVm9oxd6G", "customer_id": "4gkYnd21ouvW", "payment_method": "check", "gateway": "not_applicable", "type": "payment", "date": 1435054328, "exchange_rate": 1.0, "amount": 500, "status": "success", "updated_at": 1505917847, "resource_version": 1505917847000, "deleted": false, "object": "transaction", "currency_code": "USD", "base_currency_code": "USD", "amount_unused": 500, "linked_invoices": [], "linked_refunds": [] } }

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/record_excess_payment
comment
Remarks, if any, on the payment.
optional, string, max chars=300
transaction
Parameters for transaction
pass parameters as transaction[<param name>]
transaction[amount]
The payment transaction amount.
required, in cents, min=1
transaction[currency_code]
The currency code (ISO 4217 format) for the transaction.
required if Multicurrency is enabled, string, max chars=3
transaction[date]
Indicates when this transaction occurred.
required, timestamp(UTC) in seconds
transaction[payment_method]
The Payment Method of this transaction.
required, enumerated string, default=card
Possible values are
cashCash.checkCheck.
bank_transferBank Transfer.otherPayment Methods other than the above types.
Show all values[+]
transaction[reference_number]
The reference number for this transaction. e.g check number in case of 'check' payments.
optional, string, max chars=100
Resource object representing customer.
always returned
Resource object representing transaction.
always returned

This API can be used to collect the payments for customer’s payment_due and not_paid invoices. You can either choose to collect the payment from an existing payment source or a new payment source. You can choose to either retain or discard the new payment source, which is being used for payment. If the amount collected exceeds the invoice amount, the surplus will be counted in as excess payments.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/collect_payment \
     -X POST  \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/collect_payment \
     -X POST  \
     -u {site_api_key}:

Sample Response [ JSON ]

{ "customer": { "allow_direct_debit": false, "auto_collection": "off", "card_status": "no_card", "created_at": 1505917707, "deleted": false, "email": "henry@gmail.com", "excess_payments": 0, "first_name": "Henry", "id": "3Nl8KVeQVm9EJI2h", "last_name": "Richard", "net_term_days": 0, "object": "customer", "preferred_currency_code": "USD", "promotional_credits": 0, "refundable_credits": 0, "resource_version": 1505917711000, "taxability": "taxable", "unbilled_charges": 0, "updated_at": 1505917711 }, "transaction": { "amount": 1000, "amount_unused": 0, "base_currency_code": "USD", "currency_code": "USD", "customer_id": "3Nl8KVeQVm9EJI2h", "date": 1505917710, "deleted": false, "exchange_rate": 1, "fraud_reason": "Payment complete.", "gateway": "stripe", "gateway_account_id": "gw_3Nl8KfcQVm8v1q7G", "id": "txn_3Nl8KVeQVm9F1z2q", "id_at_gateway": "ch_BR1Eb5RVbjkxqo", "linked_invoices": [ { "applied_amount": 1000, "applied_at": 1505917711, "invoice_date": 1505917707, "invoice_id": "40", "invoice_status": "paid", "invoice_total": 1000 }, {..} ], "linked_refunds": [], "masked_card_number": "************4242", "object": "transaction", "payment_method": "card", "resource_version": 1505917711000, "status": "success", "subscription_id": "3Nl8KVeQVm9EL42j", "type": "payment", "updated_at": 1505917711 } }

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/collect_payment
amount
Amount to be collected. If this parameter is not passed then the invoice(s) amount to collect will be collected.
optional, in cents, min=0
payment_source_id
Payment source used for the payment.
optional, string, max chars=40
replace_primary_payment_source
Indicates whether the primary payment source need to be replaced with the payment source given.
optional, boolean, default=false
retain_payment_source
Indicates whether the payment source should be retained for the customer.
optional, boolean, default=false
payment_method
Parameters for payment_method
pass parameters as payment_method[<param name>]
payment_method[type]
The type of payment method. For more details refer Update payment method for a customer API under Customer resource.
optional, enumerated string
Possible values are
cardCard based payment including credit cards and debit cards. Details about the card can be obtained from the card resource.paypal_express_checkoutPayments made via PayPal Express Checkout.amazon_paymentsPayments made via Amazon Payments.direct_debitRepresents bank account for which the direct debit or ACH agreement/mandate is created.genericGeneric Payment Method.alipayAlipay Payments.unionpayUnionPay Payments.apple_payApple Pay Payments.
payment_method[gateway_account_id]
The gateway account in which this payment source is stored.
optional, string, max chars=50
payment_method[reference_id]
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 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.
For more details refer Update payment method for a customer API under Customer resource.
optional, string, max chars=50
payment_method[tmp_token]
Single-use token created by payment gateways. In Stripe, a single-use token is created for Apple Pay Wallet or card details. In Braintree, a nonce is created for Apple Pay Wallet, PayPal, or card details.
required if reference_id not provided, string, max chars=150
card
Parameters for card
pass parameters as card[<param name>]
card[gateway_account_id]
The gateway account in which this payment source is stored.
optional, string, max chars=50
card[first_name]
Cardholder's first name.
optional, string, max chars=50
card[last_name]
Cardholder's last name.
optional, string, max chars=50
card[number]
The credit card number without any format. If you are using Braintree.js, you can specify the Braintree encrypted card number here.
required if card provided, string, max chars=1500
card[expiry_month]
Card expiry month.
required if card provided, integer, min=1, max=12
card[expiry_year]
Card expiry year.
required if card provided, integer
card[cvv]
The card verification value. If you are using Braintree.js, you can specify the Braintree encrypted cvv here.
optional, string, max chars=520
card[billing_addr1]
Address line 1, as available in card billing address.
optional, string, max chars=150
card[billing_addr2]
Address line 2, as available in card billing address.
optional, string, max chars=150
card[billing_city]
City, as available in card billing address.
optional, string, max chars=50
card[billing_state_code]
The ISO 3166-2 state/province code. The recommended way of passing the state/province information. Supported for US, Canada and India now. Further if this is specified, 'state' attribute should not be specified as it will be set automatically.
optional, string, max chars=50
card[billing_state]
The state/province name. Use this to pass the state/province information for cases where 'state_code' is not supported or cannot be passed.
optional, string, max chars=50
card[billing_zip]
Postal or Zip code, as available in card billing address.
optional, string, max chars=20
card[billing_country]
2-letter ISO 3166 alpha-2 country code.
optional, string, max chars=50
invoice_allocations
Parameters for invoice_allocations. Multiple invoice_allocations can be passed by specifying unique indices.
pass parameters as invoice_allocations[<param name>][<idx:0..n>]
invoice_allocations[invoice_id][0..n]
Identifier for the invoice. Multiple invoices can be passed.
optional, string, max chars=50
invoice_allocations[allocation_amount][0..n]
Amount that will override the Invoice amount to be collected. If not specified Invoice amount to collect will be taken as default.
optional, in cents, min=0
Resource object representing customer.
always returned
Resource object representing transaction.
always returned

Deletes the customer resource.

Notes

This will delete the Payment Method from the gateway/vault. If you do not want the Payment Method to be deleted from the vault, set the value for the delete_payment_method parameter to false.

This operation is irreversible - all data related to the customer, such as subscriptions, invoices, transactions, and reports, will be deleted.

Note: This operation schedules the customer resource for deletion. It will be deleted in a few minutes.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/delete \
     -X POST  \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/delete \
     -X POST  \
     -u {site_api_key}:

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917847, "locale": "fr-CA", "resource_version": 1505917847000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 1200, "refundable_credits": 0, "excess_payments": 500, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/delete
delete_payment_method
Deletes the Payment Method from the gateway/vault.
optional, boolean, default=true
Resource object representing customer.
always returned
Resource object representing card.
optional
This API is not enabled for live sites by default. Please contact support@chargebee.com to get this enabled.
Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/move \
     -u {site_api_key}: \
     -d id_at_from_site="cust_01" \
     -d from_site="merchant"
copy
curl  https://{site}.chargebee.com/api/v2/customers/move \
     -u {site_api_key}: \
     -d id_at_from_site="cust_01" \
     -d from_site="merchant"

Sample Response [ JSON ]

{"resource_migration": { "from_site": "cbdemo-test", "entity_type": "customer", "entity_id": "copy-customer-123", "status": "scheduled", "created_at": 1505917848, "updated_at": 1505917848, "object": "resource_migration" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/move
id_at_from_site
Id of the customer to be copied.
required, string, max chars=100
from_site
Name of the site from which this customer need to be copied.
required, string, max chars=50
Resource object representing resource_migration.
always returned

Applicable when calendar billing (with customer specific billing date support) is enabled. Changes the customer's billing_date and/or billing_day_of_week.

Notes

During this operation the upcoming renewal dates are not updated to align immediately with the new date. The alignment will happen during subsequent renewals.

Say a customer's upcoming renewal is scheduled for Jan, 10th. If the customer's billing date is changed to 15th - the next renewal still happens on Jan, 10th. During this renewal alignment with the new date happens therby the subsequent renewal gets scheduled for Feb, 15th.

If you want to align with the new date immediately (in this example: you want the next renewal to be on Jan, 15th and not Jan, 10th) you need to manually change the subscription's term end.

Sample Request
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/change_billing_date \
     -u {site_api_key}: \
     -d billing_date="15" \
     -d billing_date_mode="MANUALLY_SET" \
     -d billing_day_of_week="sunday" \
     -d billing_day_of_week_mode="MANUALLY_SET"
copy
curl  https://{site}.chargebee.com/api/v2/customers/4gkYnd21ouvW/change_billing_date \
     -u {site_api_key}: \
     -d billing_date="15" \
     -d billing_date_mode="MANUALLY_SET" \
     -d billing_day_of_week="sunday" \
     -d billing_day_of_week_mode="MANUALLY_SET"

Sample Response [ JSON ]

{"customer": { "id": "4gkYnd21ouvW", "first_name": "Denise", "last_name": "Barone", "email": "jane@test.com", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1412101852, "taxability": "taxable", "updated_at": 1505917848, "locale": "fr-CA", "billing_date": 15, "billing_date_mode": "manually_set", "billing_day_of_week": "sunday", "billing_day_of_week_mode": "manually_set", "resource_version": 1505917848000, "deleted": false, "object": "customer", "billing_address": { "first_name": "John", "last_name": "Doe", "line1": "PO Box 9999", "city": "Walnut", "state_code": "CA", "state": "California", "country": "US", "zip": "91789", "validation_status": "not_validated", "object": "billing_address" }, "card_status": "no_card", "contacts": [ { "id": "ty68op521m", "first_name": "Michel", "last_name": "Ross", "email": "Mike@test.com", "label": "Mike", "enabled": true, "send_account_email": true, "send_billing_email": false, "object": "contact" }, {..} ], "promotional_credits": 1200, "refundable_credits": 0, "excess_payments": 500, "unbilled_charges": 0, "preferred_currency_code": "USD" }}

URL Format POST

https://{site}.chargebee.com/api/v2/customers/{customer_id}/change_billing_date
billing_date
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.
optional, integer, min=1, max=31
billing_date_mode
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.
optional, enumerated string
Possible values are
using_defaultsBilling date is set based on defaults configured.manually_setBilling date is specifically set (default configuration is overridden).
billing_day_of_week
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.
optional, enumerated string
Possible values are
sundaySunday.mondayMonday.tuesdayTuesday.wednesdayWednesday.thursdayThursday.fridayFriday.saturdaySaturday.
billing_day_of_week_mode
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.
optional, enumerated string
Possible values are
using_defaultsBilling date is set based on defaults configured.manually_setBilling date is specifically set (default configuration is overridden).
Resource object representing customer.
always returned