Core Resources
Subscriptions
Subscriptions are individual items a customer receives on a recurring basis.
A subscription is a product added to an address.
If store owner wants to sell multiple products as one subscription on 1 address it can be done by creating a product in Shopify that consists of multiple products e.g. 3 types of vegetables in the box, set of different shirts, etc. This multiple products appear on the store as 1 product, therefore it can be sold in a single subscription to 1 or more addresses.
A subscription is a product added to an address.
If store owner wants to sell multiple products as one subscription on 1 address it can be done by creating a product in Shopify that consists of multiple products e.g. 3 types of vegetables in the box, set of different shirts, etc. This multiple products appear on the store as 1 product, therefore it can be sold in a single subscription to 1 or more addresses.

- POST/subscriptions
- GET/subscriptions/{id}
- PUT/subscriptions/{id}
- DELETE/subscriptions/{id}
- GET/subscriptions
- GET/subscriptions/count
- POST/subscriptions/{id}/set_next_charge_date
- POST/subscriptions/{id}/change_address
- POST/subscriptions/{id}/cancel
- POST/subscriptions/{id}/activate
- POST/addresses/{id}/subscriptions-bulk
- PUT/addresses/{id}/subscriptions-bulk
- DELETE/addresses/{id}/subscriptions-bulk
#The subscription object
These fields are deprecated, however they will not be removed from this API version.
product_title is deprecated. Use title instead. shipping_date is deprecated. Use scheduled_at instead. shopify_id is deprecated. Use shopify_order_id instead. address_is_active is deprecated. Please ignore, not an applicable field.Attributes
- idintegerUnique numeric identifier for the subscription.
- address_idintegerUnique numeric identifier for the address the subscription is associated with.
- cancellation_reasonstringReason provided for cancellation.
- Additional comment for cancellation.
- cancelled_atstringThe time the subscription was cancelled.
- The number of units (specified in order_interval_unit) between each charge. For example, order_interval_unit=month and charge_interval_frequency=3, indicate charge every 3 months. Charges must use the same unit types as orders. Max value: 1000
- created_atstringThe time the subscription was created.
- customer_idintegerUnique numeric identifier for the customer the subscription is tied to.
- emailstringThe email address of the customer.
- Set the number of charges until subscription expires.
- has_queued_chargesbooleanRetrieves 1 if there is queued charge. Otherwise, retrieves 0.
- is_prepaidbooleanValue is set to True if it is a prepaid item.
- is_skippablebooleanValue is set to True if it is not a prepaid item
- is_swappablebooleanValue is set to True if it is not a prepaid item and if in Customer portal settings swap is allowed for customers.
- max_retries_reachedbooleanRetrieves 1 if charge has an error max retries reached. Otherwise, retrieves 0.
- next_charge_scheduled_atstringDate of the next charge for the subscription.
- order_day_of_monthintegerThe set day of the month order is created. Default is that there isn’t a strict day of the month when the order is created. This is only applicable to subscriptions with order_interval_unit = “month”.
- order_day_of_weekintegerThe set day of the week order is created. Default is that there isn’t a strict day of the week order is created. This is only applicable to subscriptions with order_interval_unit = “week”. Value of 0 equals to Monday, 1 to Tuesday etc.
- order_interval_frequencystringThe number of units (specified in order_interval_unit) between each order. For example, order_interval_unit=month and order_interval_frequency=3, indicate order every 3 months. Max value: 1000
- order_interval_unitstringThe frequency which a subscription should have the order created with. Valid values are “day”, “week”, and “month”.
- priceintegerThe price of the item before discounts, taxes, or shipping have been applied.
- product_titlestringThe name of the product in a shop’s catalog.
- propertiesstringA 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.
- recharge_product_idintegerUnique number identifier of the product in Recharge.
- shopify_product_idintegerUnique number identifier of the product in Shopify.
- shopify_variant_idintegerUnique number identifier of the product variant in Shopify.
- skustringA unique identifier of the item in the fulfillment. In cases where SKU is blank, it will be dynamically pulled whenever it is used.
- sku_overridebooleanFlag that is automatically updated to true when SKU is passed on create or update. When sku_override is true, the sku on the subscription will be used to generate charges and orders. When sku_override is false, Recharge will dynamically fetch the SKU from the corresponding shopify variant.
- statusstringThe status of the subscription. Valid values:
• ACTIVE - The subscription is active.
• CANCELLED - The subscription has been cancelled.
• EXPIRED - The subscription has expired. This occurs when the maximum number of charges for a product has been reached. - variant_titlestringThe name of the variant in a shop’s catalog.
{
"subscription": {
"id": 89559201,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:30:51",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"is_prepaid": true,
"is_skippable": false,
"is_swappable": false,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-15T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "15",
"order_interval_unit": "day",
"price": 5,
"product_title": "Powder Milk 50.00% Off Auto renew",
"properties": [
{
"name": "Colour",
"value": "White"
},
{
"name": "Package Material",
"value": "Paper"
}
],
"quantity": 3,
"recharge_product_id": 1422079,
"shopify_product_id": 4546063663207,
"shopify_variant_id": 32165284380775,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:30:51",
"variant_title": "1 / Powder"
}
}#Create a subscription
POST/subscriptions
Scope
write_subscriptionsWhen creating a subscription via API, “order_interval_frequency” and “charge_interval_frequency” values do not necessarily need to match the values set in the respective ruleset. The product, however, does need to be a part of a ruleset in order to be added to a subscription.
Body parameters
- Unique numeric identifier of the customer’s address.
- The number of units, specified in order_interval_unit, between each charge.
- customer_idstringUnique numeric identifier of the customer.
- The number of charges until the subscription expires.
- This will set the first charge date of a new subscription.
- order_day_of_monthstringThis is populated when order_interval_unit has value “month”. Default value is 0.
- order_day_of_weekstringThis is populated when order_interval_unit has value “week”.
- The number of units, specified in order_interval_unit, between each order.
- The frequency which a subscription should have the order created with. Valid values are “day”, “week”, and “month”.
- pricestringThe price of the product.
- propertiesstringThe list of line item objects.
- product_titlestringThe name of the product.
- The quantity of the product
- Unique numeric identifier of the product id in Shopify.
- Unique numeric identifier of the product variant id in Shopify.
- statusstringDefault is set to "ACTIVE".
curl 'https://api.rechargeapps.com/subscriptions' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"address_id": 48563471,
"charge_interval_frequency":"30",
"next_charge_scheduled_at":"2020-07-15",
"order_interval_frequency":"15",
"order_interval_unit":"day",
"properties": [
{
"name": "Colour",
"value": "Yellow"
},
{
"name": "Bottle Material",
"value": "Glass"
}
]
"shopify_variant_id":32165284380775,
"shopify_product_id":4546063663207
"quantity":3
}'{
"subscription": {
"id": 89559201,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:30:51",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"is_prepaid": true,
"is_skippable": false,
"is_swappable": false,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-15T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "15",
"order_interval_unit": "day",
"price": 5,
"product_title": "Powder Milk 50.00% Off Auto renew",
"properties": [
{
"name": "Colour",
"value": "White"
},
{
"name": "Package Material",
"value": "Paper"
}
],
"quantity": 3,
"recharge_product_id": 1422079,
"shopify_product_id": 4546063663207,
"shopify_variant_id": 32165284380775,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:30:51",
"variant_title": "1 / Powder"
}
}#Retrieve a subscription
GET/subscriptions/{id}
Retrieve a subscription using the Recharge subscription id.
Scope
read_subscriptionscurl 'https://api.rechargeapps.com/subscriptions/27363808' \
-H 'X-Recharge-Access-Token: your_api_token'{
"subscription": {
"id": 89559201,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:30:51",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"is_prepaid": true,
"is_skippable": false,
"is_swappable": false,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-15T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "15",
"order_interval_unit": "day",
"price": 5,
"product_title": "Powder Milk 50.00% Off Auto renew",
"properties": [
{
"name": "Colour",
"value": "White"
},
{
"name": "Package Material",
"value": "Paper"
}
],
"quantity": 3,
"recharge_product_id": 1422079,
"shopify_product_id": 4546063663207,
"shopify_variant_id": 32165284380775,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:30:51",
"variant_title": "1 / Powder"
}
}#Update a subscription
PUT/subscriptions/{id}
Update an existing subscription.
Updating parameters like
When updating subscription “status” attribute from “CANCELLED” to “ACTIVE”, following attributes will be set to null: “cancelled_at”, “cancellation_reason” and “cancellation_reason_comments”
When updating
Updating parameters like
frequency, charge_interval_frequency, order_interval_frequency, order_interval_unit will affect our algorithm to automatically recalculate the next charge date (next_charge_scheduled_at). If you want to change the next charge date (next_charge_scheduled_at) we recommend you to update these parameters first. When updating subscription “status” attribute from “CANCELLED” to “ACTIVE”, following attributes will be set to null: “cancelled_at”, “cancellation_reason” and “cancellation_reason_comments”
When updating
order_interval_unit OR order_interval_frequency OR charge_interval_frequency all three parameters are requiredScope
write_subscriptionsQuery parameters
- force_updatebooleanIf set to
True, updates will also be applied toCANCELLEDsubscriptions. IfnullorFalse, onlyACTIVEsubscriptions will be updated.
Body parameters
- The number of units (specified in order_interval_unit) between each charge. Required when updating order_interval_unit.
WARNING: This update will remove skipped and manually changed charges. - commit_updatebooleanControls whether the
QUEUEDcharges linked to the subscription should be regenerated upon subscription update. By default the flag is set totruewhich means the charges get regenerated for everyPUT. Having the flag set tofalsewill delay charge regeneration 5 seconds so you can run multiple calls to perform the changes and you’ll be able to receive responses much faster since your app won’t wait between requests and responses for every charge regeneration to complete. - The number of charges until subscription expires.
- order_day_of_monthstringThe day of the month the order is created on.
WARNING: this update will remove skips and manually changed charges. - order_day_of_weekstringThe day of the week the order is created on.
WARNING: this update will remove skips and manually changed charges. - The number of units (specified in order_interval_unit) between each order. Required when updating order_interval_unit.
WARNING: This update will remove skipped and manually changed charges. - The frequency which a subscription should have the order created with. Valid values are “day”, “week”, and “month”.
WARNING: This update will remove skipped and manually changed charges. - overridestringAdvanced usage only When used, this allows for updating a prepaid subscription variant, which otherwise is not allowed because of the complexity of results. Use with caution.
- pricestringThe price of the item before discounts, taxes, or shipping has been applied.
- product_titlestringThe name of the product.
- propertiesstringList of properties.
- quantitystringThe number of items in the subscription.
- shopify_variant_idstringUnique number identifier of the product variant in Shopify.
- skustringA unique identifier of the item in the fulfillment.
- sku_overridestringFlag is automatically updated to true when SKU is passed on create or update. When sku_override is true, the sku on the subscription will be used to generate charges and orders. When sku_override is false, Recharge will dynamically fetch the sku from the corresponding shopify variant.
- use_shopify_variant_defaultsbooleanFlag instructing to pull the
price,sku,variant_title, andproduct_titlefrom the provided Shopify variant.You need to pass thevariant_idand set this attribute totruein the request for the flag to work. - variant_titlestringThe name of the product variant.
curl -X PUT 'https://api.rechargeapps.com/subscriptions/27363808' \
-H 'X-Recharge-Access-Token: your_api_token' \
-H 'Content-Type: application/json' \
-d '{
"quantity": 4
}'{
"subscription": {
"id": 89559201,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:30:51",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"is_prepaid": true,
"is_skippable": false,
"is_swappable": false,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-15T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "15",
"order_interval_unit": "day",
"price": 5,
"product_title": "Powder Milk 50.00% Off Auto renew",
"properties": [
{
"name": "Colour",
"value": "White"
},
{
"name": "Package Material",
"value": "Paper"
}
],
"quantity": 3,
"recharge_product_id": 1422079,
"shopify_product_id": 4546063663207,
"shopify_variant_id": 32165284380775,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:30:51",
"variant_title": "1 / Powder"
}
}#Delete a subscription
DELETE/subscriptions/{id}
We now have a feature for deleting a subscription.
Scope
write_subscriptionsBody parameters
- send_emailbooleanWhen your store setting indicates that cancellation emails should be sent, this value determines if the email should be sent for the specified subscription cancellation. If set to 1, cancellation emails will be sent for the specified subscription cancellations. If set to 0, cancellation emails will not be sent.
curl -X DELETE -H 'https://api.rechargeapps.com/subscriptions/89559201' \
-H 'X-Recharge-Access-Token: your_api_token'{}#List subscriptions
GET/subscriptions
Returns a list of all your subscriptions.
## HTTP request examples
## HTTP request examples
GET /subscriptions GET /subscriptions?created_at_min=2018-10-10&created_at_max=2019-10-16 GET /subscriptions?customer_id=<customer_id>Scope
read_subscriptionsQuery parameters
- address_idstringReturn the subscriptions linked to the given address id.
- created_at_maxstringReturn the subscriptions created before the given date.
- created_at_minstringReturn the subscriptions created after the given date.
- customer_idstringReturn the subscriptions linked to the given Recharge customer id.
- idsstringComma-separated list of subscription ids to filter
- include_onetimesstring(beta-feature)
When set as true the response will contain onetimes and subscriptions that meet the given search criteria. Onetimes will be sent as an array with the key "onetimes" and subscriptions will be sent as an array with the key "subscriptions". If no onetimes or subscriptions meet the search criteria, the corresponding array will be empty. Requires one of the following search parameters:
* address_id
* customer_id
* shopify_customer_id
Note: this feature requires a beta flag that must be enabled by Recharge. - limitstringThe number of results. Default value is 50 and maximum is 250.
- The 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_idstringReturn the subscriptions linked to the given Shopify customer id.
- shopify_variant_idstringReturn the subscriptions linked to the given Shopify product variant id.
- statusstringReturn the subscriptions with specified status. Status can have the following values:
• ACTIVE - The subscription is active.
• CANCELLED - The subscription has been cancelled.
• EXPIRED - The subscription has expired. This occurs when the maximum number of charges for a product has been reached. - updated_at_maxstringReturn the subscriptions updated before the given date.
- updated_at_minstringReturn the subscriptions updated after the given date.
curl https://api.rechargeapps.com/subscriptions
-H 'X-Recharge-Access-Token: your_api_token'
-d limit=3 -Gcurl https://api.rechargeapps.com/subscriptions -H 'X-Recharge-Access-Token: your_api_token' -d limit=3 -G
curl -X DELETE -H https://api.rechargeapps.com/subscriptions/89559201 -H 'X-Recharge-Access-Token: your_api_token'{
"subscriptions": [
{
"id": 89560571,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:39:01",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"is_prepaid": false,
"is_skippable": true,
"is_swappable": false,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-16T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "30",
"order_interval_unit": "day",
"price": 7,
"product_title": "Orange Juice Auto renew",
"properties": [],
"quantity": 2,
"recharge_product_id": 1463299,
"shopify_product_id": 4578081833063,
"shopify_variant_id": 32309455192167,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:39:01",
"variant_title": "Squeezed"
}
]
}#Count subscriptions
GET/subscriptions/count
Returns the count of subscriptions.
## HTTP request examples
## HTTP request examples
GET /subscriptions/count GET /subscriptions/count?customer_id=123123123 GET /subscriptions/count?address_id=123123123 GET /subscriptions/count?status=ACTIVE GET /subscriptions/count?shopify_customer_id=123123123123 GET /subscriptions/count?shopify_variant_id=123123123123 GET /subscriptions/count?updated_at_min=2019-11-10-&updated_at_max=2019-11-11 GET /subscriptions/count?created_at_min=2019-11-10-&updated_at_max=2019-11-11Scope
read_subscriptionsQuery parameters
- address_idstringReturn the count of subscriptions linked to the given address id.
- created_at_maxstringReturn the count of subscriptions created before the given date.
- created_at_minstringReturn the count of subscriptions created after the given date.
- customer_idstringReturn the count of subscriptions linked to the given customer id.
- shopify_customer_idstringReturn the count of subscriptions linked to the given Shopify customer id.
- shopify_variant_idstringReturn the count of subscriptions that have the provided shopify_variant_id
- statusstringReturn the count of subscriptions with specified status. Status can have the following values:
• ACTIVE - The subscription is active.
• CANCELLED - The subscription has been cancelled.
• EXPIRED - The subscription has been expired. This occurs when the maximum number of charges for a product has been reached. - updated_at_maxstringReturn the count of subscriptions updated before the given date.
- updated_at_minstringReturn the count of subscriptions updated after the given date.
Response attributes
- countinteger
curl 'https://api.rechargeapps.com/subscriptions/count' \
-H 'X-Recharge-Access-Token: your_api_token'{
"count": 120457
}#Change a subscription next charge date
POST/subscriptions/{id}/set_next_charge_date
Update an existing subscription’s next charge date.
Note: if there are two active subscriptions with the same
Note: if there are two active subscriptions with the same
address_id, and you update their next_charge_date parameters to match, their charges will get merged into a new charge with a new idScope
write_subscriptionsBody parameters
- The next charge date desired.
curl -X POST 'https://api.rechargeapps.com/subscriptions/27363808/set_next_charge_date' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"date": "2021-08-05"
}'{
"subscription": {
"id": 89559201,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:30:51",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"is_prepaid": true,
"is_skippable": false,
"is_swappable": false,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-15T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "15",
"order_interval_unit": "day",
"price": 5,
"product_title": "Powder Milk 50.00% Off Auto renew",
"properties": [
{
"name": "Colour",
"value": "White"
},
{
"name": "Package Material",
"value": "Paper"
}
],
"quantity": 3,
"recharge_product_id": 1422079,
"shopify_product_id": 4546063663207,
"shopify_variant_id": 32165284380775,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:30:51",
"variant_title": "1 / Powder"
}
}#Change a subscription address
POST/subscriptions/{id}/change_address
Update an existing subscription’s address.
Scope
write_subscriptionsBody parameters
- Unique id of the address that need to be associated with subscription.
- next_charge_scheduled_atstringDate and time when next charge need to be scheduled.
curl -X POST 'https://api.rechargeapps.com/subscriptions/27363808/change_address' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"address_id": 23397943
}'{
"subscription": {
"id": 89559201,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:30:51",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"is_prepaid": true,
"is_skippable": false,
"is_swappable": false,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-15T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "15",
"order_interval_unit": "day",
"price": 5,
"product_title": "Powder Milk 50.00% Off Auto renew",
"properties": [
{
"name": "Colour",
"value": "White"
},
{
"name": "Package Material",
"value": "Paper"
}
],
"quantity": 3,
"recharge_product_id": 1422079,
"shopify_product_id": 4546063663207,
"shopify_variant_id": 32165284380775,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:30:51",
"variant_title": "1 / Powder"
}
}#Cancel a subscription
POST/subscriptions/{id}/cancel
Cancel an active subscription.
Scope
write_subscriptionsAn involuntary subscription cancelled due to max retries reached will trigger the
charge/max_retries_reached webhook.Body parameters
- Reason for subscription cancellation.
- Cancellation reason comment. Maximum length is 1024 characters.
- send_emailstringIf set to
false, subscription cancelled email will not be sent to customer and store owner. Note: even if set to True, there are some conditions where an email will not be sent. They are: inactive subscription_cancellation email template, customer or subscription was created on the same day, subscription is for a membership, email already sent for this subscription in the last 24 hours, customer has other active subscriptions or onetimes
curl -X POST 'https://api.rechargeapps.com/subscriptions/27363808/cancel' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"cancellation_reason": "other reason"
}'{
"subscription": {
"id": 89559201,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:30:51",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"is_prepaid": true,
"is_skippable": false,
"is_swappable": false,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-15T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "15",
"order_interval_unit": "day",
"price": 5,
"product_title": "Powder Milk 50.00% Off Auto renew",
"properties": [
{
"name": "Colour",
"value": "White"
},
{
"name": "Package Material",
"value": "Paper"
}
],
"quantity": 3,
"recharge_product_id": 1422079,
"shopify_product_id": 4546063663207,
"shopify_variant_id": 32165284380775,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:30:51",
"variant_title": "1 / Powder"
}
}#Activate a subscription
POST/subscriptions/{id}/activate
Activate a cancelled subscription.
When activating subscription, following attributes will be set to null: “cancelled_at”, “cancellation_reason” and “cancellation_reason_comments”
When activating subscription, following attributes will be set to null: “cancelled_at”, “cancellation_reason” and “cancellation_reason_comments”
Scope
write_subscriptionscurl -X POST 'https://api.rechargeapps.com/subscriptions/27363808/activate' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your api token' \
-d '{}'{
"subscription": {
"id": 89559201,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:30:51",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"is_prepaid": true,
"is_skippable": false,
"is_swappable": false,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-15T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "15",
"order_interval_unit": "day",
"price": 5,
"product_title": "Powder Milk 50.00% Off Auto renew",
"properties": [
{
"name": "Colour",
"value": "White"
},
{
"name": "Package Material",
"value": "Paper"
}
],
"quantity": 3,
"recharge_product_id": 1422079,
"shopify_product_id": 4546063663207,
"shopify_variant_id": 32165284380775,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:30:51",
"variant_title": "1 / Powder"
}
}#Bulk create subscriptions
POST/addresses/{id}/subscriptions-bulk
Bulk create new subscriptions.
There is a limit of 20 subscriptions per request.
There is a limit of 20 subscriptions per request.
Scope
write_subscriptionsBody parameters
- The number of units, specified in order_interval_unit, between each charge.
- customer_idstringUnique numeric identifier of the customer.
- The number of charges until subscription expires.
- This will set the first charge date of a new subscription.
- order_day_of_monthstringThis is populated when order_interval_unit has value “month”. Default value is 0.
- order_day_of_weekstringThis is populated when order_interval_unit has value “week”.
- order_interval_frequencystringThe number of units, specified in order_interval_unit, between each order.
- The frequency which a subscription should have the order created with. Valid values are “day”, “week”, and “month”.
- pricestringThe price of the product.
- product_titlestringThe name of the product.
- propertiesstringThe list of line item objects.
- The quantity of the product.
- Unique numeric identifier of the product variant in Shopify.
- statusstringDefault is set to "ACTIVE".
curl -X POST 'https://api.rechargeapps.com/addresses/42420080/subscriptions-bulk' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"subscriptions": [
{
"charge_interval_frequency": "30",
"next_charge_scheduled_at": "2020-07-16",
"order_interval_frequency": "30",
"order_interval_unit": "day",
"quantity": 2,
"shopify_variant_id": 32309455192167
},
{
"charge_interval_frequency": "6",
"expire_after_specific_number_of_charges": 4,
"next_charge_scheduled_at": "2020-07-13",
"order_interval_frequency": "1",
"order_interval_unit": "month",
"quantity": 1,
"shopify_variant_id": 32309455224935
},
{
"charge_interval_frequency": "4",
"next_charge_scheduled_at": "2020-08-01",
"order_interval_frequency": "4",
"order_interval_unit": "week",
"quantity": 1,
"shopify_variant_id": 32165284479079
}
]
}'{
"subscriptions": [
{
"id": 89560571,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:39:00",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-16T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "30",
"order_interval_unit": "day",
"price": 7,
"product_title": "Orange Juice Auto renew",
"properties": [],
"quantity": 2,
"recharge_product_id": 1463299,
"shopify_product_id": 4578081833063,
"shopify_variant_id": 32309455192167,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:39:00",
"variant_title": "Squeezed"
},
{
"id": 89560572,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "6",
"created_at": "2020-07-10T10:39:00",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": 4,
"has_queued_charges": 1,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-13T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "1",
"order_interval_unit": "month",
"price": 7,
"product_title": "Orange Juice Auto renew",
"properties": [],
"quantity": 1,
"recharge_product_id": 1463299,
"shopify_product_id": 4578081833063,
"shopify_variant_id": 32309455224935,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:39:00",
"variant_title": "Can"
},
{
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "4",
"created_at": "2020-07-10T10:39:00",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"id": 89560574,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-08-01T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "4",
"order_interval_unit": "week",
"price": 5,
"product_title": "Powder Milk 50.00% Off Auto renew",
"properties": [],
"quantity": 1,
"recharge_product_id": 1422079,
"shopify_product_id": 4546063663207,
"shopify_variant_id": 32165284479079,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:39:00",
"variant_title": "1 / Powder"
}
]
}#Bulk update subscriptions
PUT/addresses/{id}/subscriptions-bulk
Bulk update existing subscriptions
There is a limit of 20 subscriptions per request.
Updating parameters like
When updating the subscription
When updating
There is a limit of 20 subscriptions per request.
Updating parameters like
frequency, charge_interval_frequency, order_interval_frequency, and order_interval_unit will affect our algorithm to automatically recalculate the next charge date (next_charge_scheduled_at). If you want to change the next charge date (next_charge_scheduled_at) we recommend you update these parameters first.When updating the subscription
status attribute from CANCELLED to ACTIVE, the following attributes will be set to null: cancelled_at, cancellation_reason, and cancellation_reason_comments.When updating
order_interval_unit OR order_interval_frequency OR charge_interval_frequency, all three parameters are required.Scope
write_subscriptionsBody parameters
- Unique identifier of subscription.
- address_idstringCan be used to change the address of the subscriptions.
- cancellation_reasonstringUsed to provide cancellation reason when cancelling subscriptions.
- If
cancellation_reasonis provided, this attribute can be used to provide additional cancellation reason comments. Maximum length is 1024 characters. - The number of units (specified in order_interval_unit) between each charge. Required when updating order_interval_unit.
WARNING: This update will remove skipped and manually changed charges. - The number of charges until the subscription expires.
- force_updatebooleanIf set to
True, updates will also be applied toCANCELLEDsubscriptions. IfnullorFalse, onlyACTIVEsubscriptions will be updated. - Can be used to change the date of the next queued charge (must be current or future date).
- order_day_of_monthstringThe day of the month order is created.
WARNING: this update will remove skips and manually changed charges. - order_day_of_weekstringThe day of the week order is created.
WARNING: this update will remove skips and manually changed charges. - order_interval_frequencystringThe number of units (specified in order_interval_unit) between each order. Required when updating order_interval_unit.
WARNING: This update will remove skipped and manually changed charges. - The frequency which a subscription should have the order created with. Valid values are “day”, “week”, and “month”.
WARNING: This update will remove skipped and manually changed charges. - pricestringThe price of the item before discounts, taxes, or shipping has been applied.
- product_titlestringThe name of the product.
- propertiesstringList of properties.
- quantitystringThe number of items in subscription.
- send_emailstringIf set to false, subscription cancelled email will not be sent to customer and store owner.
- shopify_variant_idstringUnique number identifier of the product variant in Shopify.
- skustringA unique identifier of the item in the fulfillment.
- sku_overridestringFlag is automatically updated to true when SKU is passed on create or update. When sku_override is true, the sku on the subscription will be used to generate charges and orders. When sku_override is false, Recharge will dynamically fetch the sku from the corresponding shopify variant.
- use_shopify_variant_defaultsbooleanFlag instructing to pull the
price,sku,variant_title, andproduct_titlefrom the provided Shopify variant.You need to pass thevariant_idand set this attribute totruein the request for the flag to work. - statusstringStatus of the subscription. Can be used to cancel subscriptions when set to CANCELLED or to re-activate subscriptions when set to ACTIVE.
- variant_titlestringThe name of the product variant.
curl -X PUT 'https://api.rechargeapps.com/addresses/42420080/subscriptions-bulk' \
-H 'Content-Type: application/json' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"subscriptions": [
{
"id": 64993717,
"price": 23,
"quantity": 3
},
{
"id": 64993718,
"price": 24,
"quantity": 4
},
{
"id": 64993719,
"price": 25,
"quantity": 5
}
]
}'{
"subscriptions": [
{
"id": 89560571,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "30",
"created_at": "2020-07-10T10:39:00",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-16T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "30",
"order_interval_unit": "day",
"price": 7,
"product_title": "Orange Juice Auto renew",
"properties": [],
"quantity": 2,
"recharge_product_id": 1463299,
"shopify_product_id": 4578081833063,
"shopify_variant_id": 32309455192167,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:39:00",
"variant_title": "Squeezed"
},
{
"id": 89560572,
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "6",
"created_at": "2020-07-10T10:39:00",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": 4,
"has_queued_charges": 1,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-07-13T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "1",
"order_interval_unit": "month",
"price": 7,
"product_title": "Orange Juice Auto renew",
"properties": [],
"quantity": 1,
"recharge_product_id": 1463299,
"shopify_product_id": 4578081833063,
"shopify_variant_id": 32309455224935,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:39:00",
"variant_title": "Can"
},
{
"address_id": 48563471,
"analytics_data": {
"utm_params": []
},
"cancellation_reason": null,
"cancellation_reason_comments": null,
"cancelled_at": null,
"charge_interval_frequency": "4",
"created_at": "2020-07-10T10:39:00",
"customer_id": 43845860,
"email": "example@email.com",
"expire_after_specific_number_of_charges": null,
"has_queued_charges": 1,
"id": 89560574,
"max_retries_reached": 0,
"next_charge_scheduled_at": "2020-08-01T00:00:00",
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency": "4",
"order_interval_unit": "week",
"price": 5,
"product_title": "Powder Milk 50.00% Off Auto renew",
"properties": [],
"quantity": 1,
"recharge_product_id": 1422079,
"shopify_product_id": 4546063663207,
"shopify_variant_id": 32165284479079,
"sku": null,
"sku_override": false,
"status": "ACTIVE",
"updated_at": "2020-07-10T10:39:00",
"variant_title": "1 / Powder"
}
]
}#Bulk delete subscriptions
DELETE/addresses/{id}/subscriptions-bulk
Bulk delete subscriptions.
There is a limit of 20 subscriptions per request.
There is a limit of 20 subscriptions per request.
Scope
write_subscriptionsBody parameters
- Unique identifier of subscription.
- send_emailbooleanWhen your store setting indicates that cancellation emails should be sent, this value determines if subscription cancellation emails should be sent. If set to 1, cancellation emails will be sent for each of the specified subscriptions. If set to 0, cancellation emails will not be sent for any of the specified subscriptions.
curl -X DELETE 'https://api.rechargeapps.com/addresses/42420080/subscriptions-bulk' \
-H 'X-Recharge-Access-Token: your_api_token' \
-d '{
"subscriptions": [
{
"id": 64993717
},
{
"id": 64993718
},
{
"id": 64993719
}
],
"send_email": 0
}'{
"subscriptions": []
}