POST /customers
Note: This operation optionally supports 3DS verification flow. To achieve the same, create the Payment Intent and pass it as input parameter to this API.
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.
- 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.
Servers
- {protocol}://{site}.{environment}:{port}/api/v1
- {protocol}://{site}-test.{environment}:{port}/api/v1
Request headers
Name | Type | Required | Description |
---|---|---|---|
chargebee-request-origin-device |
String | No |
The device from which the customer has made the request |
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/x-www-form-urlencoded" |
chargebee-event-webhook |
String | No |
skip only webhooks Possible values:
|
chargebee-event-actions |
String | No |
skip all actions to be done on the events Possible values:
|
chargebee-request-origin-user |
String | No |
The email address of your customer/user. Use this when the email address has only ASCII characters. |
chargebee-request-origin-ip |
String | No |
The IP address of the customer where the request originated |
chargebee-request-origin-user-encoded |
String | No |
The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header |
chargebee-event-email |
String | No |
skip only emails Possible values:
|
Request body fields
Name | Type | Required | Description |
---|---|---|---|
taxability |
String | No |
Specifies if the customer is liable for tax. * 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 -
Possible values:
Default value: "taxable" |
created_from_ip |
String | No |
The IP address of the customer. Used primarily for referral integrations and EU/UK VAT validation. |
meta_data |
Object | No |
A set of key-value pairs stored as additional information for the customer. [Learn more](./#meta_data). |
payment_intent |
Object | No |
Parameters for payment_intent |
payment_intent.id |
String | No |
Identifier for PaymentIntent generated by Chargebee.js. Applicable only when you are using Chargebee.js for completing the 3DS flow. The PaymentIntent should be in 'authorized' state while passing it here. You need not pass other PaymentIntent parameters if this is passed. |
payment_intent.gateway_account_id |
String | No |
The gateway account used for performing the 3DS flow. |
payment_intent.gw_token |
String | No |
Identifier for 3DS transaction/verification object at the gateway. Can be passed only after successfully completing the 3DS flow. Refer 3DS implementation in Chargebee to find out the gateway-specific gw_token format. Applicable when you are using gateway APIs directly for completing the 3DS flow. |
payment_intent.reference_id |
String | No |
Identifier for Braintree permanent token. Applicable when you are using Braintree APIs for completing the 3DS flow. |
first_name |
String | No |
First name of the customer. |
invoice_notes |
String | No |
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. |
card |
Object | No |
Parameters for card |
card.billing_addr2 |
String | No |
Address line 2, as available in card billing address. |
card.billing_addr1 |
String | No |
Address line 1, as available in card billing address. |
card.gateway |
String | No |
Name of the gateway this payment source is stored with. * braintree - Braintree is a payment gateway. * pin - Pin is a payment gateway * authorize_net - Authorize.net is a payment gateway * nmi - NMI is a payment gateway. * not_applicable - Indicates that payment gateway is not applicable for this resource. * eway_rapid - eWAY Rapid is a payment gateway. * beanstream - Bambora(formerly known as Beanstream) is a payment gateway. * tco - 2Checkout is a payment gateway. * bluepay - BluePay is a payment gateway. * paypal_payflow_pro - PayPal Payflow Pro is a payment gateway. * paypal_pro - PayPal Pro Account is a payment gateway. * stripe - Stripe is a payment gateway. * sage_pay - Sage Pay is a payment gateway. * wirecard - WireCard Account is a payment service provider. * balanced_payments - Balanced is a payment gateway * migs - MasterCard Internet Gateway Service payment gateway. * paymill - PAYMILL is a payment gateway. * first_data_global - First Data Global Gateway Virtual Terminal Account * ogone - Ingenico ePayments (formerly known as Ogone) is a payment gateway. * chargebee - Chargebee test gateway. * worldpay - WorldPay is a payment gateway * hdfc - HDFC Account is a payment gateway. * elavon - Elavon Virtual Merchant is a payment solution. * eway - eWAY Account is a payment gateway. Possible values:
|
card.number |
String | No |
The credit card number without any format. If you are using Braintree.js, you can specify the Braintree encrypted card number here. |
card.ip_address |
String | No |
The IP address of the customer. Used primarily for referral integration and EU VAT validation. |
card.first_name |
String | No |
Cardholder's first name |
card.tmp_token |
String | No |
The single-use card token returned by vaults like Stripe/Braintree which act as a substitute for your card details. Before calling this API, you should have submitted your card details to the gateway and gotten this token in return. |
card.expiry_month |
Integer | No |
Card expiry month. |
card.last_name |
String | No |
Cardholder's last name |
card.billing_state_code |
String | No |
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set |
card.billing_zip |
String | No |
Postal or Zip code, as available in card billing address. |
card.expiry_year |
Integer | No |
Card expiry year. |
card.cvv |
String | No |
The card verification value (CVV). If you are using Braintree.js, you can specify the Braintree encrypted CVV here. |
card.billing_city |
String | No |
City, as available in card billing address. |
card.billing_state |
String | No |
The state/province name. Is set by Chargebee automatically for US, Canada and India If |
card.billing_country |
String | No |
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code. Note : If you enter an invalid country code, the system will return an error. Brexit If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then |
payment_method |
Object | No |
Parameters for payment_method |
payment_method.gateway |
String | No |
Name of the gateway the payment method is associated with. * chargebee - Chargebee test gateway. * stripe - Stripe is a payment gateway. * eway - eWAY Account is a payment gateway. * authorize_net - Authorize.net is a payment gateway * paypal_payflow_pro - PayPal Payflow Pro is a payment gateway. * sage_pay - Sage Pay is a payment gateway. * wirecard - WireCard Account is a payment service provider. * worldpay - WorldPay is a payment gateway * pin - Pin is a payment gateway * migs - MasterCard Internet Gateway Service payment gateway. * beanstream - Bambora(formerly known as Beanstream) is a payment gateway. * elavon - Elavon Virtual Merchant is a payment solution. * braintree - Braintree is a payment gateway. * nmi - NMI is a payment gateway. * first_data_global - First Data Global Gateway Virtual Terminal Account * bluepay - BluePay is a payment gateway. * paymill - PAYMILL is a payment gateway. * paypal_pro - PayPal Pro Account is a payment gateway. * eway_rapid - eWAY Rapid is a payment gateway. * ogone - Ingenico ePayments (formerly known as Ogone) is a payment gateway. * not_applicable - Indicates that payment gateway is not applicable for this resource. * tco - 2Checkout is a payment gateway. * hdfc - HDFC Account is a payment gateway. * balanced_payments - Balanced is a payment gateway Possible values:
|
payment_method.type |
String | No |
The type of payment method. For more details refer Update payment method for a customer API under Customer resource. * paypal_express_checkout - Payments made via PayPal Express Checkout. * direct_debit - Represents bank account for which the direct debit or ACH agreement/mandate is created. * automated_bank_transfer - Represents virtual bank account using which the payment will be done. * amazon_payments - Payments made via Amazon Payments. * card - Card based payment including credit cards and debit cards. Details about the card can be obtained from the card resource. Possible values:
|
payment_method.reference_id |
String | No |
The reference id. In the case of Amazon and Paypal this will be the billing agreement 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. |
vat_number |
String | No |
The VAT/tax registration number for the customer. For customers with billing_address |
allow_direct_debit |
Boolean | No |
Whether the customer can pay via Direct Debit. Default value: false |
id |
String | No |
Id for the new customer. If not given, this will be auto-generated. |
email |
String | No |
Email of the customer. Configured email notifications will be sent to this email. |
last_name |
String | No |
Last name of the customer. |
company |
String | No |
Company name of the customer. |
phone |
String | No |
Phone number of the customer. |
auto_collection |
String | No |
Whether payments needs to be collected automatically for this customer. * 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. Possible values:
Default value: "on" |
billing_address |
Object | No |
Parameters for billing_address |
billing_address.first_name |
String | No |
The first name of the billing contact. |
billing_address.state |
String | No |
The state/province name. Is set by Chargebee automatically for US, Canada and India If |
billing_address.city |
String | No |
The name of the city. |
billing_address.line2 |
String | No |
Address line 2 |
billing_address.line1 |
String | No |
Address line 1 |
billing_address.email |
String | No |
The email address. |
billing_address.last_name |
String | No |
The last name of the billing contact. |
billing_address.company |
String | No |
The company name. |
billing_address.line3 |
String | No |
Address line 3 |
billing_address.state_code |
String | No |
The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set |
billing_address.zip |
String | No |
Zip or postal code. The number of characters is validated according to the rules specified here. |
billing_address.phone |
String | No |
The phone number. |
billing_address.country |
String | No |
The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code. If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.