API Reference

The Recharge API is primarily a REST API with some RPC endpoints to support common operations. It has predictable, resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and methods.

Related guides: Generate API tokens, Using the API



API and Platforms compatibility

Recharge offers hosted solutions and integrates with various ecommerce platforms to process recurring transactions with the setup of your choice. In order to be compatible with those platforms some of our API resources and endpoints may be limited in use to a subset of platforms. When that is the case we will flag with the help of tags the checkout/platform association for which that feature is compatible.
When there is no restriction of compatibility no tags will appear.
Below is a legend of the tags you may come across:


Tag Checkout solution Ecommerce platform
BigCommerce Recharge hosted BigCommerce
Custom Recharge hosted or API-first Custom
RCS Recharge hosted Shopify
SCI Shopify hosted Shopify

You may also come across other tags specifying regional restrictions (e.g. USA Only) or new releases (e.g. Alpha, Beta).



Intro image
Base URL
https://api.rechargeapps.com

Authentication

Recharge uses API keys to authenticate requests.

Each request to the API should contain an API token in the following header:

X-Recharge-Access-Token:store_api_token

Replace store_api_token with your API key.

All requests must be made over HTTPS.


API Token Scopes

Scopes can be set up from the API token edit page in Recharge to control the level of access of an API token.

The API currently supports the scopes below:

Write Read
read_accounts
write_batches read_batches
write_charges read_charges
write_customers read_customers
write_discounts read_discounts
read_events
write_notifications
write_orders read_orders
write_payment_methods read_payment_methods
write_products read_products
write_subscriptions read_subscriptions
read_store
GET /
curl -i -H 'X-Recharge-Access-Token: your_api_token'
-X GET

Versioning

All requests will use your account API settings, unless you send a X-Recharge-Version header to specify the version.
You can use the same token to make calls to all versions. When no version is specified it will default to the default version on your store.

Existing API Versions Release notes
2021-11 2021-11 release notes
2021-01

Responses

Recharge uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided ( e.g. a required parameter was omitted, a charge failed, etc ), and codes in the 5xx range indicate an error with Recharge’s servers.

200 - OK: Everything worked as expected.
201 - OK: The request was successful, created a new resource, and resource created is in the body.
202 - OK: The request has been accepted and is in processing.
204 - OK: The server has successfully fulfilled the request and there is no content to send in the response body.
400 - Bad Request: The request was unacceptable, often due to a missing required parameter.
401 - Unauthorized: No valid API key was provided.
402 - Request Failed: The parameters were valid but the request failed.
403 - The request was authenticated but not authorized for the requested resource (permission scope error).
404 - Not Found: The requested resource doesn’t exist.
405 - Method Not Allowed: The method is not allowed for this URI.
406 - The request was unacceptable, or requesting a data source which is not allowed although permissions permit the request.
409 - Conflict: You will get this error when you try to send two requests to edit an address or any of its child objects at the same time, in order to avoid out of date information being returned.
415 - The request body was not a JSON object.
422 - The request was understood but cannot be processed due to invalid or missing supplemental information.
426 - The request was made using an invalid API version.
429 - The request has been rate limited.
500 - Internal server error.
501 - The resource requested has not been implemented in the current version but may be implemented in the future.
503 - A 3rd party service on which the request depends has timed out.

Extending responses

Our API endpoints and webhooks allow developers to extend responses with additional data in order to optimize calls, allowing for simpler and more efficient implementations.

The API supports including additional objects when using a GET request to retrieve a list or a GET request to retrieve a record by a specific id. This is achieved by using an include query parameter in the request URL. The include value contains the object or objects you want to include in the response of your request. On routes where multiple includes are available, you are able to pass multiple values separated by a comma (include=customer,metafields). The below table defines available include values for commonly used resources of the API.

Webhooks support included_objects on the topics listed below. Webhook included_objects accepts an array of supported values ("included_objects": [ "customer", "metafields"]). Specifying included_objects will return an enriched payload, containing the original resource and the associated included objects.

Resource Endpoints Webhook topics Supported include values Supported included_objects values
Addresses GET /addresses
GET /addresses/:id
address/created
address/updated
customer
discount
payment_methods (beta)
subscriptions
customer
metafields
Charges GET /charges
GET /charges/:id
charge/created
charge/failed
charge/max_retries_reached
charge/paid
charge/refunded
charge/uncaptured
charge/upcoming
charge/updated
metafields metafields
Customers GET /customers
GET /customers/:id
customer/activated
customer/created
customer/deactivated
customer/payment_method_updated
customer/updated
addresses
metafields
payment_methods (beta)
subscriptions
addresses
metafields
Orders GET /orders
GET /orders/:id
order/cancelled
order/created
order/deleted
order/processed
order/upcoming
order/updated
customer
metafields
customer
metafields
Products GET /products
GET /products/:id
product/created
product/deleted
product/updated
collections
metafields
collections
metafields
Subscriptions GET /subscriptions
GET /subscriptions/:id
subscription/activated
subscription/cancelled
subscription/created
subscription/deleted
subscription/skipped
subscription/updated
subscription/unskipped
subscription/paused
address
metafields
metafields

Page Based Pagination

By default API calls will return 50 results. By using the limit parameter that can be increased to 250 results.

When there are more results than can fit on a page you may loop through the results by using the page parameter.

To request a page, include page as a parameter in the url.

E.g. https://api.rechargeapps.com/subscriptions?limit=250&page=1

The example to the right shows a loop through all Subscription by page.

With minor changes this example can be used for looping through any object type: Customers, Addresses etc.


NOTE:
Page based pagination deep into large data sets is not recommended due to performance degradation. To paginate deeper into a data set, we recommend exploring cursor pagination instead.
Example Request
# request the first page (page=1)
curl -i -H 'X-Recharge-Access-Token: your_api_token'
 -X GET https://api.rechargeapps.com/subscriptions?limit=250&page=1
# request next page of results (page=2)
curl -i -H 'X-Recharge-Access-Token: your_api_token'
 -X GET https://api.rechargeapps.com/subscriptions?limit=250&page=2
Example Response
id: 123
id: 456
# ... continues through 250 records
page: 1 result_size: 250

id: 567
id: 678
# ... continues through 250 records
page: 2 result_size: 250

id: 567
id: 678
# ... continues through only 10 records, no further pages needed
page: 3 result_size: 10

Cursor Pagination

By default API calls will return 50 results. By using the limit parameter that can be increased to 250 results. When there are more results than the current limit a cursor may be used to request additional results.

Cursor based pagination is the preferred method for looping through all records in a given data set, as it is more performant than specifying a page number along with number of results. This method also provides more assurance that you will receive all of the records in a given set.

Cursor based pagination works by providing a reference to a specific item in a list of sequential data which will represent the cursor, such as a numeric id. You can then specify whether you would like to query records starting before or starting after that item.

For convenience, the API provides a Link header in all responses for which there are further pages. This header contains both a next_cursor and previous_cursor link, which is just a URL with an encoded page_info parameter that contains any filters from your first call, as well as markers to let the API know where it left off and where to begin for the next call.

Please note that the only compatible filter allowed to be used with cursors is limit.


Supported endpoints for Link
GET /addresses
GET /async_batches
GET /async_batches/:id/tasks
GET /charges
GET /customers
GET /discounts
GET /orders
GET /products
GET /subscriptions

NOTE:
/charges requests which supply either the updated_at_min or created_at_min filter will not currently return a Link header.
Requests which contain a filter for ids, shopify_product_ids will not return a Link header.
Example Request
URL="https://api.rechargeapps.com/charges?limit=5"

response=$(curl -s -w "%{http_code}" 
    -H 'X-Recharge-Access-Token: your_api_token'  
    -H 'X-Recharge-Version: 2021-11'  
    -X GET $URL)

 content=$(sed '$ d' <<< "$response") # get all but the last line which contains the status code

# Display results
echo $content | jq "."

# parse next url
echo "Next URL"
next_cursor=$(jq ".next_cursor" <<< "${content}")

# Notice next_cursor value is passed as page_info query param
echo "$URL&page_info=$next_cursor"

Sorting

The API supports sorting of results when using a GET request to retrieve a list. Sorting is achieved using a sort_by query parameter in the request URL. The sort_by value contains the parameter and sort direction for your results (ascending or descending), and available sort_by values vary between resources. The below table defines available sort_by options for commonly used resources.


Resource Supported sort_by_values
Address Default: id-desc
Options: id-asc id-desc updated_at-asc updated_at-desc
Async Batch Default: id-desc
Options: id-asc id-desc created_at-asc created_at-desc
Charge Default: id-asc
Options: id-asc id-desc created_at-asc created_at-desc updated_at-asc updated_at-desc charge_date-asc charge_date-desc
Customer Default: id-desc
Options: id-asc id-desc created_at-asc created_at-desc updated_at-asc updated_at-desc
Discount Default: id-desc
Options: id-asc id-desc created_at-asc created_at-desc updated_at-asc updated_at-desc
Metafield Default: id-desc
Options:id-asc id-desc updated_at-asc updated_at-desc
Onetime Default: id-desc
Options: id-asc id-desc created_at-asc created_at-desc updated_at-asc updated_at-desc
Order Default: id-desc
Options: id-asc id-desc created_at-asc created_at-desc shipped_date-asc shipped_date-desc shipping_date-asc shipping_date-desc updated_at-asc updated_at-desc
Product Default: id-desc
Options: id-asc id-desc created_at-asc created_at-desc updated_at-asc updated_at-desc title-asc title-desc
Subscription Default: id-desc
Options: id-asc id-desc created_at-asc created_at-desc updated_at-asc updated_at-desc
Webhook Default: id-desc
Options: id-asc id-desc

Addresses

Addresses represents one of the many shipping locations a customer may have. Subscriptions are tied to a given address. Each customer can have multiple address objects (many to one aka n:1) in the relationship.

Endpoints
POST
/customers/{id}/addresses
GET
/addresses/{id}
PUT
/addresses/{id}
DELETE
/addresses/{id}
GET
/addresses
GET
/addresses/count
POST
/addresses/validate

The address object

Addresses represents one of the many shipping locations a customer may have. Subscriptions are tied to a given address. Each customer can have multiple address objects (many to one aka n:1) in the relationship.

Attributes
  • id
    integer

    Unique numeric identifier for the Address.

  • address1
    string

    The street associated with the Address.

  • address2
    string

    Any additional information associated with the shipping address.

  • cart_note
    string

    The note that that will be passed to the note field of Orders made within the Address.

    cart_note is not currently honored when sent to the Shopify contract api (SCI).

  • city
    string

    The city associated with the shipping address.

  • company
    string

    The company associated with the shipping address.

  • country
    string

    The country associated with the shipping address.

  • country_code
    string

    The 2-letter country code.

  • customer_id
    integer

    Unique numeric identifier for the Customer associated with the Address.

  • discount_id
    integer

    Unique numeric identifier of Discount that is applied on the Address.

  • first_name
    string

    The customer’s first name associated with the address.

  • last_name
    string

    The customer’s last name associated with the address.

  • note_attributes
    array

    Extra information that is added to the order.

    note_attributes is not currently honored when sent to the Shopify contract api (SCI).

  • phone
    string

    The phone number associated with the address.

  • presentment_currency
    string

    Presentment currency is the currency used to display prices to the associated on a storefront and at checkout.

    Only set if the currency is different from the store-level currency. Else, will default to store-level currency.

  • province
    string

    The state or province associated with the address.

  • shipping_lines_override
    array

    Used when shipping rates need to be overridden. If this parameter has value null, rates will be fetched when a related Charge is created or regenerated

  • zip
    string

    The zip or postal code associated with the address.

More Attributes
  • cart_attributes
    array

    Additional information added to an initial order.

    Important: This field will be deprecated. Please use note_attributes instead.

  • created_at
    datetime

    The date and time when the address was created.

  • original_shipping_lines

    Shipping line details.

    Important: This field will be deprecated. Please use shipping_lines_override instead.

  • updated_at
    datetime

    The date and time when the Address was last updated.

The address object
{
  "address": {
    "id": 21317826,
    "address1": "1776 Washington Street",
    "address2": "",
    "cart_note": null,
    "city": "Los Angeles",
    "company": "Recharge",
    "country": "United States",
    "country_code": "US",
    "created_at": "2018-11-14T09:00:01",
    "customer_id": 18819267,
    "discount_id": null,
    "first_name": "John",
    "last_name": "Doe",
    "note_attributes": [
      {
        "name": "custom name",
        "value": "custom value"
      }
    ],
    "original_shipping_lines": [
      {
        "code": "Standard Shipping",
        "price": "0.00",
        "title": "Standard Shipping"
      }
    ],
    "phone": "5551234567",
    "presentment_currency": null,
    "province": "California",
    "shipping_lines_override": null,
    "updated_at": "2018-11-14T09:00:01",
    "zip": "90404"
  }
}

Create an address

Create a new address for a customer.

Scopes: write_customers
Body Parameters
  • address1
    string
    * Required

    The street associated with the Address. Minimum length is 1 character. If country is “United States” then validate with UPS external service.

  • address2
    string

    Any additional information associated with the shipping address.

  • cart_note
    string

    The note that that will be passed to the note field of Orders made within the Address.

    cart_note is not currently honored when sent to the Shopify contract api (SCI).

  • city
    string
    * Required

    The city associated with the shipping address. Minimum length is 1 character. If country is “United States” then validate with UPS external service.

  • company
    string

    The company associated with the shipping address.

  • country
    string
    * Required

    The country associated with the shipping address. Minimal length is 1 character. Check if the store supports shipping to this country. This is set by the merchant in their Shipping Settings page.

  • first_name
    string
    * Required

    The customer’s first name associated with the address. Minimum length is 1 character.

  • last_name
    string
    * Required

    The customer’s last name associated with the address. Minimum length is 1 character.

  • note_attributes
    array

    Extra information that is added to the order.

    note_attributes is not currently honored when sent to the Shopify contract api (SCI).

  • phone
    string
    * Required

    The phone number associated with the address. Must be included in the request schema but can be an empty string.

  • presentment_currency
    string

    The currency that charges on this address will be processed in. If no presentment_currency is passed, it will be set to your default store currency.

  • province
    string
    * Required

    The state or province associated with the address. Check if country requires a province COUNTRIES_REQUIRING_PROVINCE. If country is United States then validate with UPS external service.

  • shipping_lines_override
    array

    Used when shipping rates need to be overridden. If this parameter has value null, rates will be fetched when a related Charge is created or regenerated

  • zip
    string
    * Required

    The zip or postal code associated with the address. Check if the country requires a zip code COUNTRIES_NOT_REQUIRING_ZIP. If not included in the list then a zip code with the minimum length of 1 character is required. If the country is United States then validate against regex UNITED_STATES_ZIP_REGEX and validate with UPS external service. If country is United Kingdom then validate against regex UNITED_KINGDOM_ZIP_REGEX.

More Parameters
  • cart_attributes
    array

    Additional information added to an initial order.

    Important note: This field will be deprecated. Please use note_attributes instead.

  • original_shipping_lines

    Shipping line details.

    Important note: This field will be deprecated. Please use shipping_lines_override instead.

Responses
  • 200

    successful response

POST
/customers/{id}/addresses
curl 'https://api.rechargeapps.com/customers/3411137/addresses' \ 
 -H 'Content-Type: application/json' \ 
 -H 'X-Recharge-Access-Token: your_api_token' \ 
 -d '{
  "address1": "1776 Washington Street",
  "address2": "",
  "city": "Los Angeles",
  "company": "Recharge",
  "country": "United States",
  "first_name": "John",
  "last_name": "Doe",
 "note_attributes": [
    {
      "name": "custom name",
      "value": "custom value" 
 }
  ],
 "phone": "5551234567",
 "presentment_currency": "USD",
  "province": "California",
  "shipping_lines_override": [
    {
      "code": "Standard Shipping",
      "price": "0.00",
      "title": "Standard Shipping"
    }
  ],
  "zip": "90404"
}'
Response
{
  "address": {
    "id": 21317826,
    "address1": "1776 Washington Street",
    "address2": "",
    "cart_note": null,
    "city": "Los Angeles",
    "company": "Recharge",
    "country": "United States",
    "country_code": "US",
    "created_at": "2018-11-14T09:00:01",
    "customer_id": 18819267,
    "discount_id": null,
    "first_name": "John",
    "last_name": "Doe",
    "note_attributes": [
      {
        "name": "custom name",
        "value": "custom value"
      }
    ],
    "shipping_lines_override": [
      {
        "code": "Standard Shipping",
        "price": "0.00",
        "title": "Standard Shipping"
      }
    ],
    "phone": "5551234567",
    "presentment_currency": "USD",
    "province": "California",
    "updated_at": "2018-11-14T09:00:01",
    "zip": "90404"
  }
}

Retrieve an address

Retrieves address for customer based on specified address id.

Scopes: read_customers
Responses
  • 200

    successful response

GET
/addresses/{id}
curl 'https://api.rechargeapps.com/addresses/21317826' \ 
 -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "address": {
    "id": 21317826,
    "address1": "6419 Ocean Front Walk",
    "address2": "Apt 1",
    "cart_note": null,
    "city": "Los Angeles",
    "company": "",
    "country": "United States",
    "country_code": "US",
    "created_at": "2020-06-16T12:45:35",
    "customer_id": 43845860,
    "discount_id": null,
    "first_name": "Nikola",
    "last_name": "Tesla",
    "note_attributes": [
      {
        "name": "custom name",
        "value": "custom value"
      }
    ],
    "original_shipping_lines": [
      {
        "code": "Standard Shipping",
        "price": "0.00",
        "title": "Standard Shipping"
      }
    ],
    "phone": "1-800-800-8000",
    "presentment_currency": null,
    "province": "California",
    "shipping_lines_override": null,
    "updated_at": "2020-07-10T11:12:58",
    "zip": "90293"
  }
}

Update an address

Updates an existing address to match the specified parameters.

When updating the country property you will have to update the zip property as well, otherwise you will receive an error.

Scopes: write_customers
Body Parameters
  • address1
    string

    The street associated with the Address. Minimum length is 1 character. If country is “United States” then validate with UPS external service.

  • address2
    string

    Any additional information associated with the shipping address.

  • cart_note
    string

    The note that that will be passed to the note field of Orders made within the Address.

    cart_note is not currently honored when sent to the Shopify contract api (SCI).

  • city
    string

    The city associated with the shipping address. Minimum length is 1 character. If country is “United States” then validate with UPS external service.

  • company
    string

    The company associated with the shipping address.

  • country
    string

    The country associated with the shipping address. Minimal length is 1 character. Check if the store supports shipping to this country. This is set by the merchant in their Shipping Settings page.

  • first_name
    string

    The customer’s first name associated with the address. Minimum length is 1 character.

  • last_name
    string

    The customer’s last name associated with the address. Minimum length is 1 character.

  • note_attributes
    array

    Extra information that is added to the order.

    note_attributes is not currently honored when sent to the Shopify contract api (SCI).

  • phone
    string

    The phone number associated with the address. Must be included in the request schema but can be an empty string.

  • province
    string

    The state or province associated with the address. Check if country requires a province COUNTRIES_REQUIRING_PROVINCE. If country is United States then validate with UPS external service.

  • shipping_lines_override
    array

    Used when shipping rates need to be overridden. If this parameter has value null, rates will be fetched when a related Charge is created or regenerated

  • zip
    string

    The zip or postal code associated with the address. Check if the country requires a zip code COUNTRIES_NOT_REQUIRING_ZIP. If not included in the list then a zip code with the minimum length of 1 character is required. If the country is United States then validate against regex UNITED_STATES_ZIP_REGEX and validate with UPS external service. If country is United Kingdom then validate against regex UNITED_KINGDOM_ZIP_REGEX.

More Parameters
  • cart_attributes
    array

    Additional information added to an initial order.

    Important note: This field will be deprecated. Please use note_attributes instead.

  • original_shipping_lines

    Shipping line details.

    Important note: This field will be deprecated. Please use shipping_lines_override instead.

Responses
  • 200

    successful response

PUT
/addresses/{id}
curl -X PUT 'https://api.rechargeapps.com/addresses/21317826' \ 
 -H 'Content-Type: application/json' \ 
 -H 'X-Recharge-Access-Token: your_api_token' \ 
 -d '{"address1": "3020 Nebraska Avenue"}'
Response
{
  "address": {
    "id": 21317826,
    "address1": "3020 Nebraska Avenue",
    "address2": "",
    "cart_note": null,
    "city": "Los Angeles",
    "company": "Recharge",
    "country": "United States",
    "country_code": "US",
    "created_at": "2018-11-14T09:00:01",
    "customer_id": 18819267,
    "discount_id": null,
    "first_name": "John",
    "last_name": "Doe",
    "note_attributes": [
      {
        "name": "custom name",
        "value": "custom value"
      }
    ],
    "original_shipping_lines": [
      {
        "code": "Standard Shipping",
        "price": "0.00",
        "title": "Standard Shipping"
      }
    ],
    "phone": "5551234567",
    "presentment_currency": null,
    "province": "California",
    "shipping_lines_override": null,
    "updated_at": "2018-11-14T09:00:01",
    "zip": "90404"
  }
}

Delete an address

It is possible to delete certain addresses from the store using API. However, there are some rules for deleting them. Note: Only Addresses with no active subscriptions can be deleted.

Scopes: write_customers
Responses
  • 200

    successful response

DELETE
/addresses/{id}
curl -X DELETE 'https://api.rechargeapps.com/addresses/21317826' \ 
 -H 'X-Recharge-Access-Token: your_api_token'
Response
{}

List addresses

Returns all addresses from the store, or addresses for the user given in the parameter.

HTTPS request examples


GET /addresses

GET /customers/:id/addresses

You can combine created_at_min and created_at_max to return all addresses created in the given timespan. This also applies to updated_at_min and updated_at_max parameters

Scopes: read_customers
Query Parameters
  • created_at_max
    string

    Returns addresses created before the given time.

  • created_at_min
    string

    Returns addresses created after the given time.

  • customer_id
    integer

    Unique numeric identifier for the customer associated with the address.

  • discount_code
    string

    Returns addresses that have the provided discount_code.

  • discount_id
    string

    Returns addresses that have the provided discount_id.

  • ids
    string

    Filter addresses by id. If passing multiple values, must be comma separated. Non-integer values will result in a 422 error

  • limit
    string

    Default: 50

    Max: 250

    The amount of results. Default is 50 while the maximum is 250.

  • page
    string

    Default: 1

    The page to show. Default is 1.

  • updated_at_max
    string

    Returns addresses updated before the given date.

  • updated_at_min
    string

    Returns addresses updated after the given time.

Responses
  • 200

    successful response

GET
/addresses
curl 'https://api.rechargeapps.com/addresses' \ 
 -H 'X-Recharge-Access-Token: your_api_token' \ 
 -d limit=3 -G
Response
{
  "addresses": [
    {
      "id": 48563471,
      "address1": "6419 Ocean Front Walk",
      "address2": "Apt 1",
      "cart_note": null,
      "city": "Los Angeles",
      "company": "",
      "country": "United States",
      "country_code": "US",
      "created_at": "2020-06-16T12:45:35",
      "customer_id": 43845860,
      "discount_id": null,
      "first_name": "Nikola",
      "last_name": "Tesla",
      "note_attributes": [
        {
          "name": "custom name",
          "value": "custom value"
        }
      ],
      "original_shipping_lines": [],
      "phone": "1-800-800-8000",
      "presentment_currency": null,
      "province": "California",
      "shipping_lines_override": null,
      "updated_at": "2020-07-10T11:12:58",
      "zip": "90293"
    }
  ]
}

Count addresses

Retrieve the count of addresses.

HTTPS request examples


GET /addresses/count

GET /addresses/count?discount_code=10PERCENTOFF

GET /addresses/count?discount_id=123123123

GET /addresses/count?created_at_min=2019-11-11

GET /addresses/count?created_at_max=2019-11-11

GET /addresses/count?updated_at_min=2019-11-11

GET /addresses/count?updated_at_max=2019-11-11

GET /addresses/count?created_at_min=2019-11-10&updated_at_max=2019-11-11

Notes: you can combine multiple parameters with &

Scopes: read_customers
Query Parameters
  • created_at_max
    string

    Returns addresses created before the given time.

  • created_at_min
    string

    Returns addresses created after the given time.

  • discount_code
    string

    Returns addresses that have the provided discount_code.

  • discount_id
    string

    Returns addresses that have the provided discount_id.

  • updated_at_max
    string

    Returns addresses updated before the given date.

  • updated_at_min
    string

    Returns addresses updated after the given time.

Responses
  • 200

    successful response

GET
/addresses/count
curl 'https://api.rechargeapps.com/addresses/count' \ 
 -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "count": 6000
}

Validate an address

USA only

It is important to validate an address before attempting to create charges for it, as at that point the user may no longer be available to edit incorrect values.

Address validation works only for USA addresses.

Body Parameters
  • address1
    string
    * Required

    The street associated with the address.

  • city
    string
    * Required

    The city associated with the address.

  • state
    string
    * Required

    The state associated with the address.

  • zipcode
    string
    * Required

    The zip or postal code associated with the address.

Responses
  • 200

    successful response

POST
/addresses/validate
curl 'https://api.rechargeapps.com/addresses/validate' \ 
 -H 'Content-Type: application/json' \ 
 -H 'X-Recharge-Access-Token: your_api_token' \ 
 -d '{
  "address1": "1776 Washington Street",
  "city": "santa monica",
  "state": "California",
  "zipcode": "90404"
}'
Response
{
  "city": "santa monica",
  "errors": {},
  "state": "CA",
  "state_name": "California",
  "zipcode": "90404"
}

Charges

A charge is the representation of a financial transaction linked to the purchase of an item (past or future). It can be a transaction that was processed already or the representation of an upcoming transaction. A charge is linked to its corresponding Orders( one Order for pay as you go subscriptions and several for pre-paid). Order are created once the corresponding Charge is successful. After successful payment, the first order will be immediately submitted to the external platform if applicable (e.g. Shopify, BigCommerce).

Endpoints
GET
/charges/{id}
GET
/charges
GET
/charges/count
POST
/charges/{id}/change_next_charge_date
POST
/charges/{id}/skip
POST
/charges/{id}/unskip
POST
/charges/{id}/refund
POST
/charges/{id}/process
POST
/charges/{id}/capture_payment

Checkouts

The checkout resource allows to create unique checkout experiences.
We currently support Stripe, Apple Pay, Google Pay, and Braintree as payment processor.

Related guides: Mobile payments

Important - The Checkout endpoints are only available for BigCommerce and Custom. Checkouts on Shopify must go through Shopify.

Endpoints
POST
/checkouts
GET
/checkouts/{token}
POST
/checkouts
PUT
/checkouts/{token}
GET
/checkouts/{token}/shipping_rates
POST
/checkouts/{token}/charge

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.

Endpoints
POST
/customers
GET
/customers/{id}
PUT
/customers/{id}
DELETE
/customers/{id}
GET
/customers
GET
/customers/count
GET
/customers/{id}/payment_sources