Core Resources
Customers
The Customer object holds account and billing information. Email is unique on the customer; no two customers for a store can have the same email. Address is the child of the customer object. There can be many child addresses on a customer, but only one parent customer per address.

#The customer object
The following fields are deprecated:
stripe_customer_token, paypal_customer_token, authorizedotnet_profile_id, authorizedotnet_payment_profile_id. To add payment methods to a customer use 2021-11 /payment_methods insteadAttributes
- idintegerUnique numeric identifier for the customer.
- accepts_marketingbooleanIndicates whether the
Customergives consent for marketing communications. - billing_address1stringThe customer’s billing address.
- billing_address2stringAn additional field for the customer’s billing address.
- billing_citystringThe customer’s billing city.
- billing_companystringThe customer’s billing company.
- billing_countrystringThe customer’s billing country.
- billing_first_namestringThe customer’s billing first name. Required when creating a customer.
- billing_last_namestringThe customer’s billing last name. Required when creating a customer.
- billing_phonestringThe customer’s billing phone number.
- billing_provincestringThe customer’s billing province or state name.
- billing_zipstringThe customer’s billing zip or postal code.
- created_atdatetimeThe date and time when the customer was created.
- emailstringThe email address of the customer.
- Date when first charge was processed for the customer.
- first_namestringThe customer’s first name.
- has_card_error_in_dunningbooleanDoes have a credit card in dunning, can be
trueandfalse. - has_valid_payment_methodbooleanIs the payment method valid or not, can be
trueandfalse. - hashstringThe unique string identifier used in a customers portal link.
- last_namestringThe customer’s last name.
- number_active_subscriptionsintegerThe number of active subscriptions for the customer.
- number_subscriptionsintegerThe number of subscriptions for the customer.
- phonestringThe customer's phone number.
- processor_typestringWhat the merchant processor customer is stored on.
- Why payment method is not valid.
- shopify_customer_idstringShopify’s unique identifier for the customer.
- statusstringCustomer’s status, can be
ACTIVEandINACTIVE. - updated_atdatetimeThe date and time when the customer was last updated.
{
"id": 18819267,
"accepts_marketing": true,
"analytics_data": {
"utm_params": []
},
"billing_address1": "3030 Nebraska Avenue",
"billing_address2": null,
"billing_city": "Los Angeles",
"billing_company": null,
"billing_country": "United States",
"billing_phone": "3103843698",
"billing_province": "California",
"billing_zip": "90404",
"created_at": "2018-11-14T08:40:38",
"email": "example_mail@gmail.com",
"first_charge_processed_at": null,
"first_name": "Jacob",
"has_card_error_in_dunning": false,
"has_valid_payment_method": false,
"hash": "18819267b1f9095be98f13a8",
"last_name": "Bronowski",
"number_active_subscriptions": 0,
"number_subscriptions": 0,
"phone": "+16175551212",
"processor_type": null,
"reason_payment_method_not_valid": null,
"shopify_customer_id": null,
"status": "INACTIVE",
"stripe_customer_token": "cus_I9bJ...",
"updated_at": "2018-11-14T08:40:38"
}#Create a customer
POST/customers
Create a customer in Recharge.
If you plan to add payment information, it must be the tokenized customer representation. We do not accept card data directly. Please make sure it starts with ‘cus’ and not with a 'tok’, as the 'cus’ is prefix for customer token, and 'tok’ is prefix for payment token.
Creating a customer in Recharge will not create the customer on any other platform at this time.
Write_Payments permission is only required when creating customers with payment token information, or updating payment token information on a customer.
If you plan to add payment information, it must be the tokenized customer representation. We do not accept card data directly. Please make sure it starts with ‘cus’ and not with a 'tok’, as the 'cus’ is prefix for customer token, and 'tok’ is prefix for payment token.
Creating a customer in Recharge will not create the customer on any other platform at this time.
Write_Payments permission is only required when creating customers with payment token information, or updating payment token information on a customer.
Scopes
write_customerswrite_paymentsBody parameters
- accepts_marketingbooleanIndicates whether the
Customergives consent for marketing communications. - The customer’s billing address 1.
- billing_address2stringAn additional field for the customer’s billing address.
- The customer’s billing city.
- billing_companystringThe customer’s billing company.
- The customer’s billing country.
- The customer’s billing first name.
- The customer’s billing last name.
- billing_phonestringThe customer’s billing phone number.
- The customer’s billing province or state name.
- The customer’s billing zip or postal code.
- The customer’s email address.
- The customer’s first name.
- The customer’s last name.
- The payment processor customer payment token.
- phonestringThe customer's phone number.
- processor_typestringWhat the merchant processor customer is stored on.
- shopify_customer_idstringThe shopify customer id.
_The provided "shopify_customer_id" must match the provided "email" in the Shopify database for the customer. - The customer token, you will need to tokenize customers first on the payment processors end, and after you get the customer token, you can create the Recharge customer with it.
curl -X POST 'https://api.rechargeapps.com/customers' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"billing_address1": "3030 Nebraska Avenue",
"billing_city": "Los Angeles",
"billing_country": "United States",
"billing_first_name": "Mike",
"billing_last_name": "Flynn",
"billing_phone": "3103843698",
"billing_province": "California",
"billing_zip": "90404",
"email": "example_mail@gmail.com",
"first_name": "Mike",
"last_name": "Flynn",
"stripe_customer_token": "Customer_payment_token"
}'{
"customer": {
"id": 18819267,
"accepts_marketing": true,
"analytics_data": {
"utm_params": []
},
"billing_address1": "3030 Nebraska Avenue",
"billing_address2": null,
"billing_city": "Los Angeles",
"billing_company": null,
"billing_country": "United States",
"billing_phone": "3103843698",
"billing_province": "California",
"billing_zip": "90404",
"created_at": "2018-11-14T08:40:38",
"email": "example_mail@gmail.com",
"first_charge_processed_at": null,
"first_name": "Mike",
"hash": "18819267b1f9095be98f13a8",
"has_card_error_in_dunning": false,
"has_valid_payment_method": false,
"last_name": "Flynn",
"number_active_subscriptions": 0,
"number_subscriptions": 0,
"phone": "+16175551212",
"processor_type": null,
"reason_payment_method_not_valid": null,
"shopify_customer_id": null,
"status": "INACTIVE",
"stripe_customer_token": "cus_I9bJ...",
"updated_at": "2018-11-14T08:40:38"
}
}#Retrieve a customer
GET/customers/{id}
Retrieve one customer using the Recharge customer id.
Scope
read_customerscurl 'https://api.rechargeapps.com/customers/18819267' \
-H 'X-Recharge-Access-Token: your_api_token'{
"customer": {
"id": 18819267,
"accepts_marketing": true,
"analytics_data": {
"utm_params": []
},
"billing_address1": "3030 Nebraska Avenue",
"billing_address2": null,
"billing_city": "Los Angeles",
"billing_company": null,
"billing_country": "United States",
"billing_phone": "3103843698",
"billing_province": "California",
"billing_zip": "90404",
"created_at": "2018-11-14T08:40:38",
"email": "example_mail@gmail.com",
"first_charge_processed_at": null,
"first_name": "Mike",
"hash": "18819267b1f9095be98f13a8",
"has_card_error_in_dunning": false,
"has_valid_payment_method": false,
"last_name": "Flynn",
"number_active_subscriptions": 0,
"number_subscriptions": 0,
"phone": "+16175551212",
"processor_type": null,
"reason_payment_method_not_valid": null,
"shopify_customer_id": null,
"status": "INACTIVE",
"stripe_customer_token": "cus_I9bJ...",
"updated_at": "2018-11-14T08:40:38"
}
}#Update a customer
PUT/customers/{id}
Modify an existing customer to match the specified parameters.
Note: For US citizens parameter
Note: For US citizens parameter
billing_zip is required when updating customer’s billing_country parameterScope
write_customersBody parameters
- accepts_marketingbooleanIndicates whether the
Customergives consent for marketing communications. - emailstringEmail address of the customer.
- billing_address1stringCustomer’s billing address 1.
- billing_address2stringAn additional field for the customer’s billing address.
- billing_citystringCustomer’s billing city.
- billing_companystringAn additional field for the customer’s company.
- billing_countrystringCustomer’s billing country.
- billing_first_namestringCustomer’s billing first name.
- billing_last_namestringCustomer’s billing last name.
- billing_phonestringCustomers billing phone number.
- billing_provincestringCustomer’s billing province or state name.
- billing_zipstringCustomer’s billing zip or postal code.
- first_namestringCustomer’s first name.
- last_namestringCustomer’s last name.
- phonestringThe customer's phone number.
- shopify_customer_idintegerShopify’s customer id.
curl -X PUT 'https://api.rechargeapps.com/customers/18819267' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"billing_address1": "3030 Nebraska Avenue"
}'{
"customer": {
"id": 18819267,
"accepts_marketing": true,
"analytics_data": {
"utm_params": []
},
"billing_address1": "3030 Nebraska Avenue",
"billing_address2": null,
"billing_city": "Los Angeles",
"billing_company": null,
"billing_country": "United States",
"billing_phone": "3103843698",
"billing_province": "California",
"billing_zip": "90404",
"created_at": "2018-11-14T08:40:38",
"email": "example_mail@gmail.com",
"first_charge_processed_at": null,
"first_name": "Mike",
"hash": "18819267b1f9095be98f13a8",
"has_card_error_in_dunning": false,
"has_valid_payment_method": false,
"last_name": "Flynn",
"number_active_subscriptions": 0,
"number_subscriptions": 0,
"phone": "+16175551212",
"processor_type": null,
"reason_payment_method_not_valid": null,
"shopify_customer_id": null,
"status": "INACTIVE",
"stripe_customer_token": "cus_I9bJ...",
"updated_at": "2018-11-14T08:40:38"
}
}#Delete a customer
DELETE/customers/{id}
Customer deletion will automatically cancel and delete all child Address, Subscription, Onetime, etc. resources of that customer to eliminate orphaned child data.
To delete a certain address without deleting the customer you can use the Delete Address endpoint.
To delete a certain address without deleting the customer you can use the Delete Address endpoint.
Scope
write_customerscurl -X DELETE 'https://api.rechargeapps.com/customers/18819267' \
-H 'X-Recharge-Access-Token: your_api_token'{}#List customers
GET/customers
Return a list of customers in your store.
## HTTP request examples
## HTTP request examples
GET /customers GET /customers?email=example@email.com GET /customers?hash=143806234a9ff87a8d9e GET /customers?limit=250 GET /customers?page=2GET /customers?shopify_customer_id=98273498Scope
read_customersQuery parameters
- emailstringReturns the user linked to the email address provided.
- created_at_maxstringGets all customers created before this date.
- created_at_minstringGets all customers created after this date.
- hashstringReturns the user linked to the given recharge customer hash.
- idsstringFilter customers by id. If passing multiple values, must be comma separated. Non-integer values will result in a 422 error
- limitstringNumber of results.
Default value is 50, maximum is 250. - Page to show. Default value is 1.Page-based pagination has been deprecated but still available to use for pages up to a 100. If you need data past this point, use cursor pagination.
- shopify_customer_idstringReturns the user linked to the given shopify_customer_id.
- statusstringReturns users with specified status
Values are 'ACTIVE’, and 'INACTIVE’. - updated_at_maxstringGets all customers updated before this date.
- updated_at_minstringGets all customers updated after this date.
curl 'https://api.rechargeapps.com/customers?limit=3' \
-H 'X-Recharge-Access-Token: your_api_token'{
"customers": [
{
"id": 18819267,
"accepts_marketing": true,
"analytics_data": {
"utm_params": [
{
"utm_campaign": "spring_sale",
"utm_content": "differentiate-content",
"utm_data_source": "website_cookie",
"utm_medium": "email",
"utm_source": "newsletter",
"utm_term": "test-term",
"utm_time_stamp": "2019-12-16T23:57:28.752Z"
}
]
},
"billing_address1": "3030 Nebraska Avenue",
"billing_address2": null,
"billing_city": "Los Angeles",
"billing_company": null,
"billing_country": "United States",
"billing_phone": "3103843698",
"billing_province": "California",
"billing_zip": "90404",
"created_at": "2018-11-14T08:40:38",
"email": "example_mail@gmail.com",
"first_charge_processed_at": null,
"first_name": "Mike",
"hash": "18819267b1f9095be98f13a8",
"has_card_error_in_dunning": false,
"has_valid_payment_method": true,
"last_name": "Flynn",
"number_active_subscriptions": 0,
"number_subscriptions": 0,
"reason_payment_method_not_valid": null,
"shopify_customer_id": null,
"phone": "+16175551212",
"processor_type": null,
"status": "INACTIVE",
"stripe_customer_token": "cus_I9bJ...",
"updated_at": "2018-11-14T08:40:38"
}
]
}#Count customers
GET/customers/count
Retrieve a count of customers.
## HTTP request examples
## HTTP request examples
GET /customers/count GET /customers/count?created_at_max=2019-11-11 GET /customers/count?created_at_min=2019-11-11 GET /customers/count?created_at_min=2019-11-10&updated_at_max=2019-11-11&status=ACTIVE GET /customers/count?status=ACTIVE GET /customers/count?updated_at_max=2019-11-11 GET /customers/count?updated_at_min=2019-11-11Scope
read_customersQuery parameters
- created_at_maxstringGets count of all customers created before this date.
- created_at_minstringGets count of all customers created after this date.
- statusstringReturns the count of users with the specified status
Values are 'ACTIVE’, and 'INACTIVE’. - updated_at_maxstringGets count of all customers updated before this date.
- updated_at_minstringGets count of all customers updated after this date.
Response attributes
- countinteger
curl 'https://api.rechargeapps.com/customers/count' \
-H 'X-Recharge-Access-Token: your_api_token'{
"count": 12057
}#Payment sources
GET/customers/{id}/payment_sources
Retrieve payment sources for customer
Scope
read_customersThis endpoint has been deprecated. Use 2021-01
/payment_methods insteadQuery parameters
- cardholder_namestringIdentifies the owner of the credit card.
- card_brandstringIdentifies the brand of the credit card.
- card_exp_monthstringThe month when the card expires.
- card_exp_yearstringThe year when the card expires.
- card_last4stringThe last four digits of the card.
- customer_idstringUnique customer identifier.
- If it has
truevalue, then there was an error in the dunning process. There were no errors in the dunning process if it hasfalsevalue. - Identifies the payment type. It could have
credit,debit,paypalorapple_payvalues. - processor_namestringIdentifies the payment processor. It could have
stripe,braintreeorauthorizevalue. - statusstringIdentifies the status of the payment method. It could have
activeorfailedvalue. - status_reasonstringProvides more information on why the payment method is not valid if
statushasfailedvalue.
Response attributes
- billing_addressobject
- cardholder_namestring
- card_brandstring
- card_exp_monthstring
- card_exp_yearstring
- card_last4string
- customer_idstring
- payment_tokenstring
- payment_typestring
- processor_namestring
- statusstring
- status_reasonstring
curl 'https://api.rechargeapps.com/customers/18819267/payment_sources' \
-H 'X-Recharge-Access-Token: your_api_token'{
"payment_sources": [
{
"billing_address": {
"id": 1,
"address1": "3030 Nebraska Avenue",
"address2": null,
"city": "Los Angeles",
"company": null,
"country": "United States",
"first_name": "Mike",
"last_name": "Flynn",
"phone": "3103843698",
"province": "California",
"zip": "90404"
},
"cardholder_name": null,
"card_brand": null,
"card_exp_month": null,
"card_exp_year": null,
"card_last4": null,
"customer_id": 18819267,
"has_card_error_in_dunning": false,
"payment_token": "cus_I9bJ...",
"payment_type": "credit",
"processor_name": "stripe",
"status": "active",
"status_reason": null
}
]
}