Create a customer
Creates a new customer object.
POST
/v1/customers
The above command returns JSON structured like this:
Arguments
first_name
string
optional
The customer’s first name.
last_name
string
optional
Customer last name.
string
optional
Customer’s email address. It’s displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to 512 characters. This will be unset if you POST an empty value.
currency
string
optional
Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes.
phone
string
optional
The customer’s phone number. This will be unset if you POST an empty value.
default_locale
string
optional
Customer’s preferred default language.
description
string
optional
An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. This will be unset if you POST an empty value.
address
dictionary
optional
The customer’s address.
source
string
optional
The source can be a Token or a Source, as returned by Elements. You must provide a source if the customer does not already have a valid source attached, and you are subscribing the customer to be charged automatically for a plan that is not free. Passing source will create a new source object, make it the customer default source, and delete the old customer default if one exists. If you want to add an additional source, instead use the card creation API to add the card and then the customer update API to set it as the default. Whenever you attach a card to a customer, API will automatically validate the card.
metadata
hash
optional
Contain the key, value pair with merchant information that will be linked to the customer.
Returns
Returns a customer object if the call succeeded. The returned object will have information about token sources, if that information has been provided. If a source has been attached to the customer, the returned customer object will have a default_source attribute, which is an ID that can be expanded into the full source details when retrieving the customer.
Last updated