Recharge
  • 15 Aug 2024
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Recharge

  • Dark
    Light
  • PDF

Article summary

Recharge API

API Documentation Link


Configuration Parameters

Any instance where an entry in the below configuration has a leading $ represents a parameter that needs to be replaced with a static value. For example, if collecting the Addresses resource, the Base URL will need to be https://api.rechargeapps.com/addresses

Parameters in this document:

  • $resource_name - The Resource Name represents the name of the resource to be appended and used as part of the Destination Table name. The value that should be used here can be found in the API Resources table below.
  • $api_token - The API Token will provide access to the Recharge API. Documentation on how to generate an API Token can be found here.
  • $incremental_starting_value - The Incremental Starting Value represents the earliest date that data should be collected for, given in yyyy-mm-DD format. For example, if you would like your historical data to go back to the start of 2021, this value would be set to 2021-01-01.

API Resources

Resource$resource_name
Addressesaddresses
Chargescharges
Collectionscollections
Collection Productscollection_products
Customerscustomers
Discountsdiscounts
Metafieldsmetafields
Notificationsnotifications
Onetimesonetimes
Ordersorders
Payment Methodspayment_methods
Plansplans
Productsproducts
Retention Strategiesretention_strategies
Subscriptionssubscriptions

Connector configuration

  • Base url: https://api.rechargeapps.com/$resource_name
  • Method: GET
  • URL Parameters: limit=250

For the Addresses, Charges, Customers, Discounts, Notifications, Onetimes, Orders, Plans, and Subscriptions resources, if incremental collections are desired, the following URL Parameter should be included in the connector configuration:
&updated_at_min=<<date_format({incval},'%Y-%m-%d')>>

Additionally, for these resources, you will need to configure the URL parameters to remove in the pagination configuration and the Incremental Key in the Advanced Settings.

  • Headers: {"X-Recharge-Version":"2021-11"}
  • Destination: recharge_$resource_name

Destination table naming convention is ultimately up to you as the data owner. One common structure used for this API is recharge_$resource_name (e.g. when collecting the Addresses resource, using the Destination of recharge_addresses)

Authorization

  • Authorization API Key
  • Key: X-Recharge-Access-Token
  • Value: {api_token}
  • Add to: Headers

Variables

Variable nameVariable value
api_token$api_token

Pagination

  • Enable Checkbox
  • Get next page value: Dynamic
  • Next page key in response: next_cursor
  • Use next page value: As a URL parameter value
  • URL/body key: cursor
  • URL parameters to remove: updated_at_min

Only required if using Incremental Key for Addresses, Charges, Customers, Discounts, Notifications, Onetimes, Orders, Plans, and Subscriptions resources

  • Stop iterating when: No next page in response

Advanced Settings

  • Data key: $resource_name
  • Errors waiting time: 429=80
  • Incremental Key:
    Column nameColumn value
    updated_at$incremental_starting_value

Only applicable to the Addresses, Charges, Customers, Discounts, Notifications, Onetimes, Orders, Plans, and Subscriptions resources

Incremental value format

If needed, you can enter a column value in order extract data only since a certain date. When entering a column value, you will need to use the following format: yyyy-mm-DD


Was this article helpful?

What's Next