Core Resources
Customers
The
Customer object holds account information. Email is unique on the Customer; no two customers for a store can have the same email. Address is a child of the Customer object. There can be many child Addresses on a customer, but only one parent Customer per Address.64 additions in V2, marked New
Everything marked New also works when you send X-Recharge-Version: 2021-11.

#The customer object
Attributes
- idintegerUnique numeric identifier for the
Customer. - analytics_dataobjectAn object containing analytics data associated with the customer.
Show child attributesHide child attributes1
- utm_paramsarray of objectsAn array containing
utm_paramobjects.Show child attributesHide child attributes7
- utm_campaignstringThe UTM campaign.
- utm_contentstringThe UTM content.
- utm_data_sourcestringThe source of the campaign parameter.
- utm_sourcestringThe UTM source.
- utm_mediumstringThe UTM medium.
- utm_termstringThe UTM term.
- utm_timestampstringThe UTM timestamp.
- A boolean that indicates whether Recharge credits will be applied to the next checkout charge.
- A boolean that indicates whether Recharge credits will be applied to the next recurring charge.
- A boolean that indicates whether backup payment methods can be used for the customer when a charge fails.
nullwhen no preference has been set for the customer, in which case the store's default applies. - A boolean that indicates whether a payment method can be added to the customer in Recharge.
- An object containing the related resources requested with the
includequery parameter.Only returned when theincludequery parameter is passed.Show child attributesHide child attributes920 new
- The
Addressesassociated with theCustomer. Returned whenincludecontainsaddresses. - The most recent customer portal announcement for the
Customer. Returned whenincludecontainsannouncements.Empty unless the store uses customer portal announcements.Show child attributesHide child attributes66 new
- Unique numeric identifier for the announcement.
- Unique numeric identifier for the
Customerthe announcement is for. - Unique numeric identifier for the flow that created the announcement.
- An object describing the content of the announcement shown in the customer portal.
- The date and time when the announcement was created.
- The date and time when the announcement was last updated.
- The gift purchases for which the
Customeris the recipient. Returned whenincludecontainsgift_purchases. Requires theread_gift_purchasesscope. - The memberships of the
Customer. Returned whenincludecontainsmemberships. Requires theread_membershipsscope.Show child attributesHide child attributes22 new
- The name of the membership program the membership belongs to.
- The type of the membership program the membership belongs to.
- The
Metafieldsowned by theCustomer. Returned whenincludecontainsmetafields. - The
Payment Methodsof theCustomer. Returned whenincludecontainspayment_methods. Requires theread_payment_methodsscope. - An object keyed by punch card id that contains the progress of the
Customerin each punch card:punch_card_order_count,punch_card_streak_count,punch_card_total_order_value_in_store_currencyand thepunch_card_previous_*values recorded before the latest order. Returned whenincludecontainspunch_card_progress. - An object containing referral information for the
Customer. Returned whenincludecontainsreferral_info.Show child attributesHide child attributes13 new
- The referral link of the
Customer. Empty when the store has no active referral program.
- The
Subscriptionsof theCustomer. Returned whenincludecontainssubscriptions. Requires theread_subscriptionsscope.
- The number of active memberships the customer has.Only returned when retrieving or listing customers on stores that have memberships enabled.
- The total number of memberships created for the customer.Only returned when retrieving or listing customers on stores that have memberships enabled.
- A boolean that indicates whether falling back to the customer's default payment method with the payment processor is disabled when a charge on the assigned payment method fails.
- The lifetime value of the customer in Recharge, expressed in the store's default currency.
- The total number of charges successfully processed for the customer.
- created_atdatetimeThe date and time when the customer was created.
- emailstringThe email address of the customer.
- external_customer_idobjectAn object containing external ids for the customer record.
Show child attributesHide child attributes1
- ecommercestringThe customer ID as it appears in the external e-commerce platform.
- first_charge_processed_atdatetimeDate when first charge was processed for the customer.
- first_namestringThe customer’s first name.
- A boolean that indicates if the customer has a payment method that is in dunning (failed charge).
- has_valid_payment_methodbooleanIs the payment method valid or not.
- hashstringThe unique string identifier used in a customers portal link.
- last_namestringThe customer’s last name.
- phonestringThe customer's phone number.
- subscriptions_active_countintegerThe number of active subscriptions on addresses associated with the customer.
- subscriptions_total_countintegerThe total number of subscriptions created on addresses associated with the customer.
- tax_exemptbooleanWhether the customer tax exempt or not.
- updated_atdatetimeThe date and time when the customer was last updated.
{
"id": 18819267,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"apply_credit_to_next_checkout_charge": false,
"backup_payment_methods_enabled": null,
"can_add_payment_method": true,
"created_at": "2018-11-14T08:40:38+00:00",
"email": "example_mail@gmail.com",
"external_customer_id": {
"ecommerce": "126576412310131454"
},
"first_charge_processed_at": null,
"first_name": "Jacob",
"has_payment_method_in_dunning": false,
"has_valid_payment_method": false,
"hash": "18819267b1f9095be98f13a8",
"last_name": "Bronowski",
"payment_method_fallback_on_failure_disabled": false,
"phone": "+16175551212",
"recharge_lifetime_value_total_amount_store_default_currency": null,
"subscriptions_active_count": 0,
"subscriptions_total_count": 1,
"tax_exempt": false,
"total_processed_charge_count": 0,
"updated_at": "2020-11-14T08:40:38+00:00"
}#Create a customer
POST/customers
Create a customer in Recharge.
Scope
write_customersIf you plan to add payment information, it must be the tokenized customer representation. We do not accept card data directly. For Stripe users, 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.
Returns
Creating a customer in Recharge will not create the customer on any other platform at this time.
write_payment_methods permission is only required when creating customers with payment token information, or updating payment token information on a customer.phone must be in E.164 format, such as +16175551212.Returns
201 on success.Body parameters
- An object containing analytics data associated with the customer.
Show child attributesHide child attributes18 new
- An array containing
utm_paramobjects.Show child attributesHide child attributes77 new
- The source of the campaign parameter. Required for each
utm_paramobject. - The UTM source.
- The UTM medium.
- The UTM campaign.
- The UTM term.
- The UTM content.
- The UTM timestamp. Required for each
utm_paramobject.
- A list of up to 10 custom attributes to attach to the
Eventcreated by this request. They are returned in thecustom_attributesof thatEvent. - The customer’s email address.
- external_customer_idobjectAn object containing external ids for the customer record.
Show child attributesHide child attributes1
- ecommercestringThe customer ID as it appears in the external e-commerce platform.
- The customer’s first name.
- The customer’s last name.
- phonestringThe customer's phone number.
- tax_exemptbooleanWhether or not the customer is tax exempt.
curl -X POST 'https://api.rechargeapps.com/customers' \
-H 'X-Recharge-Version: v2' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"first_name": "Niels",
"last_name": "Bohr",
"email": "fake@example.com"
}'{
"customer": {
"id": 37657002,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"apply_credit_to_next_checkout_charge": false,
"backup_payment_methods_enabled": null,
"can_add_payment_method": true,
"created_at": "2020-02-19T17:40:07+00:00",
"email": "fake@example.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"first_charge_processed_at": "2020-02-19T17:40:11+00:00",
"first_name": "Jane",
"has_payment_method_in_dunning": false,
"has_valid_payment_method": true,
"hash": "7e706455cbd13e40",
"last_name": "Doe",
"payment_method_fallback_on_failure_disabled": false,
"phone": null,
"recharge_lifetime_value_total_amount_store_default_currency": null,
"subscriptions_active_count": 0,
"subscriptions_total_count": 0,
"subscription_related_charge_streak": 0,
"tax_exempt": false,
"total_processed_charge_count": 0,
"updated_at": "2020-12-17T18:50:39+00:00"
}
}#Retrieve a customer
GET/customers/{id}
Retrieve one customer using
customer_id.Scope
read_customersQuery parameters
- A comma-separated list of related resources to embed in the
includeattribute of eachCustomer.Possible valuesaddressesannouncementsgift_purchasesmembershipsmetafieldspayment_methodspunch_card_progressreferral_infosubscriptions
curl 'https://api.rechargeapps.com/customers/37657002' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"customer": {
"id": 37657002,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"apply_credit_to_next_checkout_charge": false,
"backup_payment_methods_enabled": null,
"can_add_payment_method": true,
"created_at": "2020-02-19T17:40:07+00:00",
"email": "fake@example.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"first_charge_processed_at": "2020-02-19T17:40:11+00:00",
"first_name": "Jane",
"has_payment_method_in_dunning": false,
"has_valid_payment_method": true,
"hash": "7e706455cbd13e40",
"last_name": "Doe",
"payment_method_fallback_on_failure_disabled": false,
"phone": "+16175551212",
"recharge_lifetime_value_total_amount_store_default_currency": null,
"subscriptions_active_count": 0,
"subscriptions_total_count": 1,
"subscription_related_charge_streak": 0,
"tax_exempt": false,
"total_processed_charge_count": 0,
"updated_at": "2020-12-17T18:50:39+00:00"
}
}#Update a customer
PUT/customers/{id}
Modify an existing
Customer to match the specified parameters.Scope
write_customersFor US citizens, parameter
billing_zip is required when updating customer’s billing_country parameter.phone must be in E.164 format, such as +16175551212.Body parameters
- An object containing analytics data associated with the customer. UTM parameters passed in the request are added to the customer's existing
utm_params.Show child attributesHide child attributes18 new
- An array containing
utm_paramobjects.Show child attributesHide child attributes77 new
- The source of the campaign parameter. Required for each
utm_paramobject. - The UTM source.
- The UTM medium.
- The UTM campaign.
- The UTM term.
- The UTM content.
- The UTM timestamp. Required for each
utm_paramobject.
- A boolean that indicates whether Recharge credits will be applied to the next checkout charge. Cannot be changed when the store's credit settings always or never apply credits to checkout charges.
- A boolean that indicates whether Recharge credits will be applied to the next recurring charge.This property is dependent upon the store's credit settings. If a call is made attempting to update this and the store has recurring redemption turned off or set to automatically redeem, the API will return a 422 response.
- The channel recorded as the origin of the change when
apply_credit_to_next_recurring_chargeis set totrue. Default isapi.Possible valuesmerchant_portalcustomer_portalcheckoutcancellation_preventionwinbacksapi - A boolean that indicates whether backup payment methods can be used for the customer when a charge fails.
- A list of up to 10 custom attributes to attach to the
Eventcreated by this request. They are returned in thecustom_attributesof thatEvent. - emailstringEmail address of the customer.
- external_customer_idobjectAn object containing external ids for the customer record.
Show child attributesHide child attributes1
- ecommercestringThe customer ID as it appears in the external e-commerce platform.
- first_namestringCustomer’s first name.
- last_namestringCustomer’s last name.
- A boolean that indicates whether falling back to the customer's default payment method with the payment processor is disabled when a charge on the assigned payment method fails.
- phonestringThe customer's phone number.
- tax_exemptbooleanWhether or not the customer is tax exempt.
curl -X PUT 'https://api.rechargeapps.com/customers/37657002' \
-H 'X-Recharge-Version: v2' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"last_name": "Doe"
}'{
"customer": {
"id": 37657002,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"apply_credit_to_next_checkout_charge": false,
"backup_payment_methods_enabled": null,
"can_add_payment_method": true,
"created_at": "2020-02-19T17:40:07+00:00",
"email": "fake@example.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"first_charge_processed_at": "2020-02-19T17:40:11+00:00",
"first_name": "Jane",
"has_payment_method_in_dunning": false,
"has_valid_payment_method": true,
"hash": "7e706455cbd13e40",
"last_name": "Doe",
"payment_method_fallback_on_failure_disabled": false,
"phone": "+16175551212",
"recharge_lifetime_value_total_amount_store_default_currency": null,
"subscriptions_active_count": 0,
"subscriptions_total_count": 1,
"tax_exempt": false,
"total_processed_charge_count": 0,
"updated_at": "2020-12-17T18:50:39+00:00"
}
}#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/37657002' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{}#List customers
GET/customers
Return a list of customers in your store.
HTTP request examples
GET /customers GET /customers?email=example@email.com GET /customers?hash=143806234a9ff87a8d9e GET /customers?limit=250 GET /customers?page=2GET /customers?external_customer_id=98273498Scope
read_customersIf emails contain special characters such as 'john+doe@example.com', you will need to encode them in the URLs, i.e.
Passing
?email=john%2Bdoe@example.comPassing
external_customer_id with an empty value returns a 422 error.Query 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.
- Page to show.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.
- external_customer_idstringReturns the user linked to the given
external_customer_id. - updated_at_maxstringGets all customers updated before this date.
- updated_at_minstringGets all customers updated after this date.
- A comma-separated list of related resources to embed in the
includeattribute of eachCustomer.Possible valuesaddressesannouncementsgift_purchasesmembershipsmetafieldspayment_methodspunch_card_progressreferral_infosubscriptions - Returns the customer linked to the given phone number. Must be in E.164 format, including the country code.
- Sort order of the results. Default is
id-desc.Possible valuesid-ascid-descupdated_at-ascupdated_at-desccreated_at-asccreated_at-desc - The
next_cursororprevious_cursorvalue from a previous response, used to retrieve the next or previous page of results. Whencursoris passed, onlylimitcan be passed with it.
curl 'https://api.rechargeapps.com/customers?limit=3' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"next_cursor": "next_cursor",
"previous_cursor": "previous_cursor",
"customers": [
{
"id": 37657002,
"analytics_data": {
"utm_params": [
{
"utm_source": "facebook",
"utm_medium": "cpc"
}
]
},
"apply_credit_to_next_checkout_charge": false,
"backup_payment_methods_enabled": null,
"can_add_payment_method": true,
"created_at": "2020-02-19T17:40:07+00:00",
"email": "fake@example.com",
"external_customer_id": {
"ecommerce": "2879413682227"
},
"first_charge_processed_at": "2020-02-19T17:40:11+00:00",
"first_name": "Jane",
"has_payment_method_in_dunning": false,
"has_valid_payment_method": true,
"hash": "7e706455cbd13e40",
"last_name": "Doe",
"payment_method_fallback_on_failure_disabled": false,
"phone": "+16175551212",
"recharge_lifetime_value_total_amount_store_default_currency": null,
"subscriptions_active_count": 0,
"subscriptions_total_count": 1,
"tax_exempt": false,
"total_processed_charge_count": 0,
"updated_at": "2020-12-17T18:50:39+00:00"
}
]
}#Retrieve a customer delivery schedule
GET/customers/{id}/delivery_schedule
Returns the list of projected deliveries in a specific interval.
Scope
read_customersIf several filters are passed in parameters, the most restrictive will dominate.
The maximum length of the future delivery interval is 365 days.
The maximum length of the future delivery interval is 365 days.
Query parameters
- delivery_count_futureintegerThe count of delivery objects that should be included that reference projected orders.Will not return deliveries past 365 days in the future.
- future_intervalintegerThe count of days forward to report deliveries on.Defaults to store setting or 90. Maximum of 365 days.
- date_maxstringThe end date of the requested delivery schedule.Cannot be in the past. Cannot exceed 365 days in the future.
Response attributes
- customerobjectCustomer details relevant for deliveries.
Show child attributesHide child attributes4
- idintegerUnique numeric identifier of the customer.
- emailstringEmail address of the customer.
- first_namestringThe customer’s first name.
- last_namestringThe customer’s last name.
- deliveriesarray of objectsThe order details of all deliveries due in the specified timeframe grouped by delivery date and address if customer has multiple addresses.
Show child attributesHide child attributes2
- datedateDate for the scheduled deliveries in Eastern Standard Time
- ordersarray of objectsThe order details for a given delivery.
Show child attributesHide child attributes7
- idintegerUnique numeric identifier for the orderDefaults to null if the
Chargelinked to this order has not been processed yet. - address_idintegerUnique numeric identifier for the customer's address for which the delivery is due.
- charge_idintegerUnique numeric identifier for the
Chargelinked to the order. May be null for projected orders with no charge yet created. - line_itemsarray of objectsList of order details.
Show child attributesHide child attributes15
- subscription_idintegerUnique numeric identifier for the subscription linked to this
line_itemin the order. - external_product_idobjectAn object containing external product ids.
Show child attributesHide child attributes1
- ecommercestringThe product id as it appears in the external e-commerce platform. The
external_product_idof theProductrecord in Recharge, linking aPlanto aProduct.
- external_variant_idobjectAn object containing external variant ids.
Show child attributesHide child attributes1
- ecommercestringThe variant id as it appears in the external e-commerce platform. The
external_variant_idof theProductrecord in Recharge, linking aPlanto aProduct.
- imagesobjectAn object containing the product's images.
Show child attributesHide child attributes5
- largestringThe url where a large image file is located.
- mediumstringThe url where a medium image file is located.
- smallstringThe url where a small image file is located.
- originalstringThe url of the original sized product image.
- sort_orderintegerThe sort order in which the x image from the array should appear when displayed.
- is_prepaidbooleanValue is set to
trueif it is a prepaid item - is_skippablebooleanValue is set to
trueif it is not a onetime or a prepaid item - is_skippedbooleanValue is set to
trueif the order is skipped. - original_pricestringThe original price of the item without discounts or taxes.
- plan_typestringThe type of the plan. May return null value in certain cases.Possible values
subscriptiononetime - product_titlestringThe name of the product in a store's catalog.
- propertiesarray of objectsA list of line item objects, each one containing information about the subscription. Custom key-value pairs can be installed here, they will appear on the connected queued charge and after it is processed on the order itself.
- quantityintegerThe number of items in the subscription.
- subtotal_pricestringThe subtotal price (sum of all line items * their quantity) of the order less discounts.
- unit_pricestringThe unit price of the variant.
- variant_titlestringThe name of the variant in a store's catalog.
- order_subtotalstringThe order subtotal price (sum of all individual order subtotals). May be "0.00" for subsequent prepaid orders not attributed to a charge.
- payment_methodobjectThe customer’s first name.
Show child attributesHide child attributes3
- idintegerThe unique payment method id for a customer.
- billing_addressobjectAn object with the customer’s address information.
Show child attributesHide child attributes10
- address1stringLine one of the billing address.
- address2stringLine two of the billing address.
- citystringThe city of the billing address.
- companystringThe company name of the billing address.
- country_codestring2-letter country code.
- first_namestringThe first name of the billing address.
- last_namestringThe last name of the billing address.
- phonestringThe phone number of the billing address.
- provincestringThe name of the province or state associated with the billing address.
- zipstringThe zip code or postcode of the address.
- payment_detailsobjectDetails about the specific payment methodThose details will vary based on the
payment_typeShow child attributesHide child attributes8
- brandstring
Payment_methodbrand or company powering it.valid forCREDIT_CARDonly. - exp_monthstring
Payment_methodexpiry month.valid forCREDIT_CARDonly. - exp_yearstring
Payment_methodexpiry year.valid forCREDIT_CARDonly. - last4stringlast 4-digits of the identifier.valid for
CREDIT_CARDonly. - paypal_emailstringemail linked to .valid for
PAYPALonly. - paypal_payer_idstringpaypal user identifier.valid for
PAYPALonly. - wallet_typestringIf a digital wallet.
- funding_typestringType of funding for the
Payment Method.
- shipping_addressobjectThe shipping address where the order will be shipped.
Show child attributesHide child attributes10
- address1stringLine one of the billing address.
- address2stringLine two of the billing address.
- citystringThe city of the billing address.
- companystringThe company name of the billing address.
- country_codestring2-letter country code.
- first_namestringThe first name of the billing address.
- last_namestringThe last name of the billing address.
- phonestringThe phone number of the billing address.
- provincestringThe name of the province or state associated with the billing address.
- zipstringThe zip code or postcode of the address.
curl 'https://api.rechargeapps.com/customers/37657002/delivery_schedule' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"deliverySchedule": {
"customer": {
"id": 73720164,
"email": "test@example.com",
"first_name": "Aria",
"last_name": "Beciu"
},
"deliveries": [
{
"date": "2022-02-07",
"orders": [
{
"id": null,
"address_id": 79342717,
"charge_id": 507503288,
"line_items": [
{
"subscription_id": 186930285,
"external_product_id": {
"ecommerce": "1642443555555"
},
"external_variant_id": {
"ecommerce": null
},
"images": {},
"is_skippable": true,
"is_skipped": false,
"is_prepaid": false,
"original_price": "17.00",
"plan_type": "subscription",
"product_title": "Organic coffee beans",
"properties": [
{
"name": "shipping_interval_unit_type",
"value": "month"
},
{
"name": "shipping_interval_frequency",
"value": "1"
},
{
"name": "subscription_id",
"value": null
}
],
"quantity": 1,
"subtotal_price": "17.00",
"unit_price": "17.00",
"variant_title": "Refill large"
}
],
"order_subtotal": "17.00",
"payment_method": {
"id": 769874,
"billing_address": {
"address1": "90 avenue du Rouergue",
"address2": null,
"city": "Rodez",
"company": null,
"country_code": "FR",
"first_name": "Diane",
"last_name": "Farley",
"phone": null,
"province": null,
"zip": "12000"
},
"payment_details": {}
},
"shipping_address": {
"address1": "149 Forest Avenue",
"address2": null,
"city": "New York City",
"company": null,
"country_code": "US",
"first_name": "Aria",
"last_name": "Beciu",
"phone": "1234567890",
"province": "New York",
"zip": "10019"
}
}
]
}
]
}
}#Retrieve a customer's credit summary
GET/customers/{id}/credit_summary
Returns a credit summary for the customer.
Scope
read_credit_summaryThe response is returned under the
The response is returned under the
credit_summary key.The response is returned under the
credit_summary key.Query parameters
- If
credit_detailsis passed, the response includes the individual credit accounts of the customer ininclude.credit_details.Possible valuescredit_details - A 3-letter currency code. When passed, the response also includes the balances converted to this currency.
Response attributes
- customer_idintegerUnique numeric identifier for the
Customer. - total_available_balancestringThe total balance of the customer's credit accounts.
- currency_codestringThe currency of the customer's credit balance.
curl 'https://api.rechargeapps.com/customers/37657002/credit_summary' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{
"credit_summary": {
"customer_id": 37657002,
"total_available_balance": "0.00",
"currency_code": "USD"
}
}