API
Core Resources

Subscriptions

Subscriptions are individual items a customer receives on a recurring basis.

A Subscription is a Product added to an Address.

92 additions in V2, marked New

Everything marked New also works when you send X-Recharge-Version: 2021-11.

How Subscriptions relate to other resources

#The subscription object

Subscriptions are individual items a customer benefit from on a recurring basis.
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

  • idinteger
    Unique numeric identifier for the subscription.
  • An object containing variant values stored on the Subscription. Each key holds an object with the stored value and an override boolean that is true when the value was set explicitly on the Subscription. The object is empty when no values are stored.
    Only returned by the retrieve and list endpoints for stores that have enhanced subscription responses enabled.
    Show child attributesHide child attributes55 new
    • The fulfillment service of the variant, as value and override.
    • gramsobjectNew
      The weight of the variant in grams, as value and override.
    • tax_codeobjectNew
      The tax code of the variant, as value and override.
    • taxableobjectNew
      Whether the variant is taxable, as value and override.
    • vendorobjectNew
      The vendor of the variant, as value and override.
  • address_idinteger
    Unique numeric identifier for the address the subscription is associated with.
  • Unique numeric identifier for the customer the subscription is tied to.
  • An object used to contain analytics data such as utm parameters.
    Show child attributesHide child attributes1
  • Reason provided for cancellation.
  • Additional comment for cancellation. Maximum length is 1024 characters.
  • cancelled_atdatetime
    The 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.
    Maximum 1000
    Charges must use the same unit types as orders.
  • includeobjectNew
    An object containing the related objects requested with the include query parameter.
    Only returned when the include query parameter is passed on the retrieve or list endpoints.
    Show child attributesHide child attributes917 new
    • addonsarray of objectsNew
      The add-on relationships of the Subscription with other subscriptions.
      Returned when include contains addons. Only populated for stores with add-on subscriptions enabled.
      Show child attributesHide child attributes33 new
      • typestringNew
        The role of the related subscription: child when the related subscription is an add-on of this Subscription, parent when this Subscription is an add-on of the related subscription.
        Possible values
        childparent
      • Unique numeric identifier of the parent Subscription in the relationship.
      • Unique numeric identifier of the add-on Subscription in the relationship.
    • addressobjectNew
      The Address the Subscription is associated with.
      Returned when include contains address.
    • bundle_productobject · nullableNew
      The bundle product that matches the product of the Subscription. null if the product is not a bundle.
      Returned when include contains bundle_product.
    • bundle_selectionsobject · nullableNew
      The BundleSelection linked to the Subscription. null if there is none.
      Returned when include contains bundle_selections.
    • The charge activity records created in the last 90 days for the Charges that contain the Subscription.
      Returned when include contains charge_activities.
    • customerobjectNew
      The Customer the Subscription is tied to.
      Returned when include contains customer.
    • customer_entitlementsarray of objectsNew
      The entitlements granted to the Customer by the Subscription.
      Returned when include contains customer_entitlements.
      Show child attributesHide child attributes55 new
      • idintegerNew
        Unique numeric identifier for the customer entitlement.
      • descriptionstring · nullableNew
        The description of the entitlement feature.
      • expires_atdatetime · nullableNew
        The time the entitlement expires. null if it does not expire.
      • lookup_keystringNew
        The lookup key of the entitlement feature.
      • namestringNew
        The name of the entitlement feature.
    • expires_atarrayNew
      A list containing the date on which the Subscription expires as an add-on, or null if it has no expiration.
      Returned when include contains expires_at. Only populated for stores with add-on subscriptions enabled.
    • metafieldsarrayNew
      The Metafields attached to the Subscription.
      Returned when include contains metafields.
  • is_digitalbooleanNew
    Value is true if the Subscription is for a digital item, meaning the item does not require shipping and its Plan grants at least one entitlement. Always false for stores that do not have digital subscriptions enabled.
  • locked_pending_charge_idinteger · nullableNew
    Unique numeric identifier of the Charge that is waiting for a payment confirmation for this Subscription. The Subscription cannot be modified while this value is set.
    Only returned for stores that have SEPA Direct Debit or iDEAL payments enabled.
  • plan_idinteger · nullableNew
    Unique numeric identifier of the Plan the Subscription is linked to.
    Only returned for stores that have plan IDs in subscription responses enabled.
  • created_atdatetime
    The time the subscription was created.
  • Set the number of charges until subscription expires.
  • An object containing the product id as it appears in external platforms.
    Show child attributesHide child attributes1
    • ecommercestring
      The product id as it appears in the external e-commerce platform. The external_product_id of the Product record in Recharge, linking a Plan to a Product.
  • An object containing the variant id as it appears in external platforms.
    Show child attributesHide child attributes1
    • ecommercestring
      The variant id as it appears in the external e-commerce platform. The external_variant_id of the Product record in Recharge, linking a Plan to a Product.
  • Retrieves true if there is queued charge. Otherwise, retrieves false.
  • is_prepaidboolean
    Value is set to true if it is a prepaid item.
  • Value is set to true if it is not a prepaid item
  • Value is set to true if it is not a prepaid item and if in Customer portal settings swap is allowed for customers.
  • Retrieves true if charge has an error max retries reached. Otherwise, retrieves false.
  • Date of the next charge for the subscription.
  • The 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”.
  • The 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.
  • The 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
    Maximum 1000
  • The frequency unit used to determine when a subscription's order is created.
    Possible values
    dayweekmonth
  • The presentment currency of the subscription.
  • pricestring
    The price of the item before discounts, taxes, or shipping have been applied.
  • The name of the product in a store's catalog.
  • propertiesarray of objects
    A 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.
    Show child attributesHide child attributes2
    • namestring
      The name of the property.
    • valuestring
      The value of the property.
  • quantityinteger
    The number of items in the subscription.
  • skustring
    A unique identifier of the item in the fulfillment. In cases where SKU is blank, it will be dynamically pulled whenever it is used.
  • Flag 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 external platform variant.
  • statusstring
    The status of the subscription.
    Possible values
    activecancelledexpired
    EXPIRED - This status occurs when the maximum number of charges for a product has been reached.
  • updated_atdatetime
    The date time at which the purchase_item record was last updated.
  • The name of the variant in a shop’s catalog.
The subscription object
{
  "subscription": {
    "id": 89559201,
    "address_id": 48563471,
    "customer_id": 43845860,
    "analytics_data": {
      "utm_params": []
    },
    "cancellation_reason": null,
    "cancellation_reason_comments": null,
    "cancelled_at": null,
    "charge_interval_frequency": "30",
    "created_at": "2021-02-25T21:27:19+00:00",
    "expire_after_specific_number_of_charges": null,
    "external_product_id": {
      "ecommerce": "2103271587891"
    },
    "external_variant_id": {
      "ecommerce": "18261278883891"
    },
    "has_queued_charges": true,
    "is_digital": false,
    "is_prepaid": true,
    "is_skippable": false,
    "is_swappable": false,
    "max_retries_reached": false,
    "next_charge_scheduled_at": "2020-07-15",
    "order_day_of_month": null,
    "order_day_of_week": null,
    "order_interval_frequency": 15,
    "order_interval_unit": "day",
    "presentment_currency": "USD",
    "price": 5,
    "product_title": "Powder Milk 50.00% Off Auto renew",
    "properties": [
      {
        "name": "Colour",
        "value": "White"
      },
      {
        "name": "Package Material",
        "value": "Paper"
      }
    ],
    "quantity": 3,
    "sku": null,
    "sku_override": false,
    "status": "active",
    "updated_at": "2020-07-10T10:30:51+00:00",
    "variant_title": "1 / Powder"
  }
}

#Create a subscription

POST/subscriptions
Scopewrite_subscriptions
When 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 Plans. The product, however, does need to have at least one Plan in order to be added to a subscription.

charge_interval_frequency, order_interval_frequency and order_interval_unit are only required when plan_id is not provided.

Query parameters

  • commitbooleanNew
    If set to true, the QUEUED charges linked to the Subscription are regenerated before the response is returned. If omitted or false, the charges are regenerated asynchronously.

Body parameters

  • address_idintegerRequired
    Unique numeric identifier of the customer’s address.
  • An object used to contain analytics data such as utm parameters.
    Show child attributesHide child attributes18 new
    • utm_paramsarray of objectsNew
      An array containing utm_param objects.
      Show child attributesHide child attributes77 new
  • Reason for cancellation. Can only be set when status is cancelled or expired.
  • cancelled_atdatetimeNew
    The time the subscription was cancelled. Can only be set when status is cancelled or expired. Defaults to the current time when status is cancelled.
  • The number of units, specified in order_interval_unit, between each charge.
  • custom_event_attributesarray of objectsNew
    A list of up to 10 custom key-value pairs to attach to the Events generated by this request. They are returned in the custom_attributes of those Events.
    Show child attributesHide child attributes22 new
    • keystringNew
      The name of the custom attribute.
    • valuestring · nullableNew
      The value of the custom attribute. Maximum length is 255 characters.
  • The number of charges until the subscription expires.
  • This will set the first charge date of a new subscription.
  • This is populated when order_interval_unit has value “month”. Default value is 0.
  • This is populated when order_interval_unit has value “week”.
  • The number of units, specified in order_interval_unit, between each order.
  • order_interval_unitstringRequired
    The frequency unit used to determine when a subscription order is created.
    Possible values
    dayweekmonth
  • plan_idinteger
    A Recharge Plan id that provides interval information. Automatically fills the following properties from the plan if they were not provided directly: charge_interval_frequency, expire_after_specific_number_of_charges, order_day_of_month, order_day_of_week, order_interval_frequency, order_interval_unit.
  • The presentment currency of the price. It must match the currency of the Address. Required when price is provided and the currency of the Address is not the store's default currency.
  • pricestring
    The price of the product.
  • Set to true to indicate that the price in the request was explicitly chosen by the caller instead of being calculated by Recharge.
  • The name of the product.
  • propertiesarray of objects
    A list of key/value pairs representing properties of the subscription.
    Show child attributesHide child attributes2
    • namestring
      The name of the property.
    • valuestring
      The value of the property.
  • quantityintegerRequired
    The quantity of the product.
  • Unique numeric identifier of the product id.
    Show child attributesHide child attributes1
    • ecommercestring
      The product id as it appears in the external e-commerce platform. The external_product_id of the Product record in Recharge, linking a Plan to a Product.
  • external_variant_idobjectRequired
    Unique numeric identifier of the product variant id.
    Show child attributesHide child attributes1
    • ecommercestring
      The variant id as it appears in the external e-commerce platform. The external_variant_id of the Product record in Recharge, linking a Plan to a Product.
  • skustringNew
    A unique identifier of the item in the fulfillment.
  • sku_overridebooleanNew
    When true, the sku stored on the Subscription is used instead of the SKU of the product variant.
  • statusstring
    Default is set to active.
    Possible values
    activecancelledexpired
  • variant_titlestringNew
    The name of the product variant.
POST/subscriptions
curl -X POST 'https://api.rechargeapps.com/subscriptions' \
  -H 'X-Recharge-Version: v2' \
  -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": "2021-12-17",
  "order_interval_frequency": "30",
  "order_interval_unit": "day",
  "properties": [
    {
      "name": "Colour",
      "value": "Yellow"
    },
    {
      "name": "Bottle Material",
      "value": "Glass"
    }
  ],
  "external_variant_id": {
    "ecommerce": "32165284380775"
  },
  "quantity": 3
}'
Response
{
  "subscription": {
    "id": 63898947,
    "address_id": 48563471,
    "customer_id": 37657002,
    "analytics_data": {
      "utm_params": {
        "utm_source": "facebook",
        "utm_medium": "cpc"
      }
    },
    "cancellation_reason": null,
    "cancellation_reason_comments": null,
    "cancelled_at": null,
    "charge_interval_frequency": 30,
    "created_at": "2020-02-19T17:40:09+00:00",
    "expire_after_specific_number_of_charges": null,
    "external_product_id": {
      "ecommerce": "4381728735283"
    },
    "external_variant_id": {
      "ecommerce": "32165284380775"
    },
    "has_queued_charges": true,
    "is_digital": false,
    "is_prepaid": false,
    "is_skippable": true,
    "is_swappable": false,
    "max_retries_reached": false,
    "next_charge_scheduled_at": "2021-12-17",
    "order_day_of_month": null,
    "order_day_of_week": null,
    "order_interval_frequency": 30,
    "order_interval_unit": "day",
    "presentment_currency": "USD",
    "price": "10.00",
    "product_title": "ABC Shirt",
    "properties": [
      {
        "name": "Color",
        "value": "Blue"
      },
      {
        "name": "Size",
        "value": "Large"
      }
    ],
    "quantity": 1,
    "sku": "TOM0001",
    "sku_override": false,
    "status": "active",
    "updated_at": "2020-02-19T17:40:10+00:00",
    "variant_title": "Blue star"
  }
}

#Retrieve a subscription

GET/subscriptions/{id}
Retrieve a subscription using the Recharge subscription_id.
Scoperead_subscriptions

Query parameters

  • includestringNew
    A comma-separated list of related objects to return in the include attribute of the Subscription. address, customer and customer_entitlements also require the read_customers scope, and charge_activities also requires the read_orders scope. addons and expires_at only return data for stores with add-on subscriptions enabled.
    Possible values
    addressaddonsbundle_productbundle_selectionscharge_activitiescustomercustomer_entitlementsexpires_atmetafields
GET/subscriptions/{id}
curl 'https://api.rechargeapps.com/subscriptions/27363808' \
  -H 'X-Recharge-Version: v2' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "subscription": {
    "id": 63898947,
    "address_id": 48563471,
    "customer_id": 37657002,
    "analytics_data": {
      "utm_params": {
        "utm_source": "facebook",
        "utm_medium": "cpc"
      }
    },
    "cancellation_reason": null,
    "cancellation_reason_comments": null,
    "cancelled_at": null,
    "charge_interval_frequency": 30,
    "created_at": "2020-02-19T17:40:09+00:00",
    "expire_after_specific_number_of_charges": null,
    "external_product_id": {
      "ecommerce": "4381728735283"
    },
    "external_variant_id": {
      "ecommerce": "32165284380775"
    },
    "has_queued_charges": true,
    "is_digital": false,
    "is_prepaid": false,
    "is_skippable": true,
    "is_swappable": false,
    "max_retries_reached": false,
    "next_charge_scheduled_at": "2021-12-17",
    "order_day_of_month": null,
    "order_day_of_week": null,
    "order_interval_frequency": 30,
    "order_interval_unit": "day",
    "presentment_currency": "USD",
    "price": "10.00",
    "product_title": "ABC Shirt",
    "properties": [
      {
        "name": "Color",
        "value": "Blue"
      },
      {
        "name": "Size",
        "value": "Large"
      }
    ],
    "quantity": 1,
    "sku": "TOM0001",
    "sku_override": false,
    "status": "active",
    "updated_at": "2020-02-19T17:40:10+00:00",
    "variant_title": "Blue star"
  }
}

#Update a subscription

PUT/subscriptions/{id}
Update an existing subscription.
Scopewrite_subscriptions
Updating parameters like frequency, charge_interval_frequency, order_interval_frequency, order_interval_unit will cause 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 required.

Query parameters

  • commitboolean
    Controls whether the QUEUED charges linked to the subscription should be regenerated upon subscription update. By default the flag is set to false which will delay charge regeneration 5 seconds. This enables running multiple calls to perform changes and receive responses much faster since the API won’t wait for a charge regeneration to complete. Setting this parameter to true will cause charge regeneration to complete before returning a response.
  • If set to True, updates will also be applied to CANCELLED subscriptions. If null or False, only ACTIVE subscriptions will be updated.

Body parameters

  • address_idintegerNew
    Unique numeric identifier of the Address to move the Subscription to. The Address must belong to the same Customer and use the same currency as the Subscription.
  • An object used to contain analytics data such as utm parameters. The UTM parameters passed are added to the ones already stored on the Subscription.
    Show child attributesHide child attributes18 new
    • utm_paramsarray of objectsNew
      An array containing utm_param objects.
      Show child attributesHide child attributes77 new
  • Reason for cancellation. Can only be set when status is passed as cancelled or expired in the same request.
  • Additional comment for cancellation. Maximum length is 1024 characters. Can only be set when status is passed as cancelled or expired in the same request.
  • cancelled_atdatetimeNew
    The time the subscription was cancelled. Can only be set when status is passed as cancelled or expired in the same request.
  • 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.
    Maximum 1000
  • custom_event_attributesarray of objectsNew
    A list of up to 10 custom key-value pairs to attach to the Events generated by this request. They are returned in the custom_attributes of those Events.
    Show child attributesHide child attributes22 new
    • keystringNew
      The name of the custom attribute.
    • valuestring · nullableNew
      The value of the custom attribute. Maximum length is 255 characters.
  • The number of charges until subscription expires.
  • An object containing the product id as it appears in external platforms.
    Show child attributesHide child attributes11 new
    • ecommercestringNew
      The product id as it appears in the external e-commerce platform.
  • Unique number identifier of the product variant in your external platform.
    Show child attributesHide child attributes1
    • ecommercestring
      The variant id as it appears in the external e-commerce platform. The external_variant_id of the Product record in Recharge, linking a Plan to a Product.
  • The date of the next charge for the Subscription. It cannot be in the past.
  • The day of the month the order is created on.

    WARNING: this update will remove skips and manually changed charges.
  • The 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 unit used to determine when a subscription order is created.

    WARNING: This update will remove skipped and manually changed charges.
    Possible values
    dayweekmonth
  • overridebooleanNew
    If set to true, allows interval changes that are otherwise rejected, such as changing the charge or order frequency of a prepaid Subscription, or changing a Subscription to a prepaid frequency.
  • plan_idinteger
    A Recharge Plan id that provides interval information. Automatically fills the following properties from the plan if they were not provided directly: charge_interval_frequency, expire_after_specific_number_of_charges, order_day_of_month, order_day_of_week, order_interval_frequency, order_interval_unit.
  • The presentment currency of the price. It must match the currency of the Subscription. Required when price is provided and the currency of the Subscription is not the store's default currency.
  • pricestring
    The price of the item before discounts, taxes, or shipping has been applied.
  • Set to true to indicate that the price in the request was explicitly chosen by the caller instead of being calculated by Recharge.
  • The name of the product.
  • propertiesarray of objects
    A list of key/value pairs representing properties of the subscription.
    Show child attributesHide child attributes2
    • namestring
      The name of the property.
    • valuestring
      The value of the property.
  • quantityinteger
    The number of items in the subscription.
  • skustring
    A unique identifier of the item in the fulfillment.
  • Flag 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 external platform variant.
  • statusstringNew
    The status of the Subscription. When set to cancelled without cancelled_at, the cancellation time is set to the current time.
    Possible values
    activecancelledexpired
  • Flag instructing to pull the price from the product variant passed.
    You need to pass the variant_id under external_variant_id.ecommerce and set this attribute to true in the request for the flag to work.
  • The name of the product variant.
PUT/subscriptions/{id}
curl -X PUT 'https://api.rechargeapps.com/subscriptions/27363808' \
  -H 'X-Recharge-Version: v2' \
  -H 'Content-Type: application/json' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -d '{
  "quantity": 4
}'
Response
{
  "subscription": {
    "id": 63898947,
    "address_id": 48563471,
    "customer_id": 37657002,
    "analytics_data": {
      "utm_params": {
        "utm_source": "facebook",
        "utm_medium": "cpc"
      }
    },
    "cancellation_reason": null,
    "cancellation_reason_comments": null,
    "cancelled_at": null,
    "charge_interval_frequency": 30,
    "created_at": "2020-02-19T17:40:09+00:00",
    "expire_after_specific_number_of_charges": null,
    "external_product_id": {
      "ecommerce": "4381728735283"
    },
    "external_variant_id": {
      "ecommerce": "32165284380775"
    },
    "has_queued_charges": true,
    "is_digital": false,
    "is_prepaid": false,
    "is_skippable": true,
    "is_swappable": false,
    "max_retries_reached": false,
    "next_charge_scheduled_at": "2021-12-17",
    "order_day_of_month": null,
    "order_day_of_week": null,
    "order_interval_frequency": 30,
    "order_interval_unit": "day",
    "presentment_currency": "USD",
    "price": "10.00",
    "product_title": "ABC Shirt",
    "properties": [
      {
        "name": "Color",
        "value": "Blue"
      },
      {
        "name": "Size",
        "value": "Large"
      }
    ],
    "quantity": 1,
    "sku": "TOM0001",
    "sku_override": false,
    "status": "active",
    "updated_at": "2020-02-19T17:40:10+00:00",
    "variant_title": "Blue star"
  }
}

#Delete a subscription

DELETE/subscriptions/{id}
We now have a feature for deleting a subscription.
Scopewrite_subscriptions

Query parameters

  • commitbooleanNew
    If set to true, the QUEUED charges linked to the Subscription are regenerated before the response is returned. If omitted or false, the charges are regenerated asynchronously.

Body parameters

  • send_emailboolean
    When 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 true, cancellation emails will be sent for the specified subscription cancellations. If set to false, cancellation emails will not be sent.
DELETE/subscriptions/{id}
curl -X DELETE 'https://api.rechargeapps.com/subscriptions/27363808' \
  -H 'X-Recharge-Version: v2' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{}

#List subscriptions

GET/subscriptions
Returns a list of all your subscriptions.

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>
Scoperead_subscriptions
When cursor is passed, limit is the only other query parameter that can be passed with it.

Query parameters

  • Return the subscriptions linked to the given address_id.
    Not compatible with address_ids.
  • Return the subscriptions linked to the given address_ids.
    Accepts a comma separated list of address_ids as value.
    Not compatible with address_id
  • bundles_onlybooleanNew
    If true, only return the subscriptions whose product variant belongs to an active, published bundle product. Only true is accepted; omit the parameter to list all subscriptions.
  • Return the subscriptions created before the given date.
  • Return the subscriptions created after the given date.
  • cursorstring
    Return either the next or previous page of subscriptions using next_cursor or previous_cursor attributes in the response.
  • Return the subscriptions linked to the given Recharge customer id.
  • Return the subscriptions linked to the customer with the given id in the external e-commerce platform.
  • Return the subscriptions linked to the given external_variant_id
  • idsstring
    Comma-separated list of subscription_ids to filter
  • includestringNew
    A comma-separated list of related objects to return in the include attribute of the Subscriptions. address, customer and customer_entitlements also require the read_customers scope, and charge_activities also requires the read_orders scope. addons and expires_at only return data for stores with add-on subscriptions enabled.
    Possible values
    addressaddonsbundle_productbundle_selectionscharge_activitiescustomercustomer_entitlementsexpires_atmetafields
  • If true, the response also contains an onetimes array with the Onetimes matching the same filters. Only applied when address_id, customer_id or external_customer_id is also passed.
    Only available for stores that have the option to include onetimes in the subscriptions list enabled.
  • limitstring
    The number of results.
    Default 50Maximum 250
  • pagestringDeprecated
    The page to show.
    Default 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.
  • sort_bystringNew
    Sort the results by the given attribute and direction. Defaults to id-desc.
    Possible values
    id-ascid-desccreated_at-asccreated_at-descupdated_at-ascupdated_at-desc
  • statusstring
    Return the subscriptions with specified status.
    Possible values
    activecancelledexpired
  • Return the subscriptions updated before the given date.
  • Return the subscriptions updated after the given date.
GET/subscriptions
curl 'https://api.rechargeapps.com/subscriptions?limit=3' \
  -H 'X-Recharge-Version: v2' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "next_cursor": "next_cursor",
  "previous_cursor": "previous_cursor",
  "subscriptions": [
    {
      "id": 63898947,
      "address_id": 42171447,
      "customer_id": 37657002,
      "analytics_data": {
        "utm_params": {
          "utm_source": "facebook",
          "utm_medium": "cpc"
        }
      },
      "cancellation_reason": null,
      "cancellation_reason_comments": null,
      "cancelled_at": null,
      "charge_interval_frequency": 1,
      "created_at": "2020-02-19T17:40:09+00:00",
      "expire_after_specific_number_of_charges": 5,
      "external_product_id": {
        "ecommerce": "4381728735283"
      },
      "external_variant_id": {
        "ecommerce": "32165284380775"
      },
      "has_queued_charges": false,
      "is_digital": false,
      "is_prepaid": false,
      "is_skippable": true,
      "is_swappable": false,
      "max_retries_reached": false,
      "next_charge_scheduled_at": "2021-12-17",
      "order_day_of_month": null,
      "order_day_of_week": null,
      "order_interval_frequency": 1,
      "order_interval_unit": "month",
      "presentment_currency": "USD",
      "price": "10.00",
      "product_title": "ABC Shirt",
      "properties": [
        {
          "name": "Color",
          "value": "Blue"
        },
        {
          "name": "Size",
          "value": "Large"
        }
      ],
      "quantity": 1,
      "sku": "TOM0001",
      "sku_override": false,
      "status": "active",
      "updated_at": "2020-02-19T17:40:10+00:00",
      "variant_title": "Blue star"
    }
  ]
}

#Change a subscription next charge date

POST/subscriptions/{id}/set_next_charge_date
Update an existing subscription’s next charge date.
Scopewrite_subscriptions
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 id

Query parameters

  • commitbooleanNew
    If set to true, the QUEUED charges linked to the Subscription are regenerated before the response is returned. If omitted or false, the charges are regenerated asynchronously.
  • pausebooleanNew
    If true, the date change is also recorded as a pause of the Subscription and the subscription/paused webhook is sent.

Body parameters

  • datedateRequired
    The next charge date desired.
  • custom_event_attributesarray of objectsNew
    A list of up to 10 custom key-value pairs to attach to the Events generated by this request. They are returned in the custom_attributes of those Events.
    Show child attributesHide child attributes22 new
    • keystringNew
      The name of the custom attribute.
    • valuestring · nullableNew
      The value of the custom attribute. Maximum length is 255 characters.
POST/subscriptions/{id}/set_next_charge_date
curl -X POST 'https://api.rechargeapps.com/subscriptions/27363808/set_next_charge_date' \
  -H 'X-Recharge-Version: v2' \
  -H 'Content-Type: application/json' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -d '{
  "date": "2021-08-05"
}'
Response
{
  "subscription": {
    "id": 27363808,
    "address_id": 42171447,
    "customer_id": 37657002,
    "analytics_data": {
      "utm_params": {
        "utm_source": "facebook",
        "utm_medium": "cpc"
      }
    },
    "cancellation_reason": null,
    "cancellation_reason_comments": null,
    "cancelled_at": null,
    "charge_interval_frequency": 1,
    "created_at": "2020-02-19T17:40:09+00:00",
    "expire_after_specific_number_of_charges": null,
    "external_product_id": {
      "ecommerce": "4381728735283"
    },
    "external_variant_id": {
      "ecommerce": "32309455192167"
    },
    "has_queued_charges": true,
    "is_digital": false,
    "is_prepaid": false,
    "is_skippable": true,
    "is_swappable": false,
    "max_retries_reached": false,
    "next_charge_scheduled_at": "2021-08-05",
    "order_day_of_month": null,
    "order_day_of_week": null,
    "order_interval_frequency": 1,
    "order_interval_unit": "month",
    "presentment_currency": "USD",
    "price": "10.00",
    "product_title": "ABC Shirt",
    "properties": [
      {
        "name": "Color",
        "value": "Blue"
      },
      {
        "name": "Size",
        "value": "Large"
      }
    ],
    "quantity": 1,
    "sku": "TOM0001",
    "sku_override": false,
    "status": "active",
    "updated_at": "2020-02-19T17:40:10+00:00",
    "variant_title": "Blue star"
  }
}

#Change a subscription address

POST/subscriptions/{id}/change_address
New
Update an existing subscription’s address.
Scopewrite_subscriptions

Body parameters

POST/subscriptions/{id}/change_address
curl -X POST 'https://api.rechargeapps.com/subscriptions/27363808/change_address' \
  -H 'X-Recharge-Version: v2' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -H 'Content-Type: application/json' \
  -d '{
  "address_id": 23397943
}'
Response
{
  "subscription": {
    "id": 27363808,
    "address_id": 42171447,
    "customer_id": 37657002,
    "analytics_data": {
      "utm_params": {
        "utm_source": "facebook",
        "utm_medium": "cpc"
      }
    },
    "cancellation_reason": null,
    "cancellation_reason_comments": null,
    "cancelled_at": null,
    "charge_interval_frequency": 1,
    "created_at": "2020-02-19T17:40:09+00:00",
    "expire_after_specific_number_of_charges": null,
    "external_product_id": {
      "ecommerce": "4381728735283"
    },
    "external_variant_id": {
      "ecommerce": "32309455192167"
    },
    "has_queued_charges": true,
    "is_digital": false,
    "is_prepaid": false,
    "is_skippable": true,
    "is_swappable": false,
    "max_retries_reached": false,
    "next_charge_scheduled_at": "2021-08-05",
    "order_day_of_month": null,
    "order_day_of_week": null,
    "order_interval_frequency": 1,
    "order_interval_unit": "month",
    "presentment_currency": "USD",
    "price": "10.00",
    "product_title": "ABC Shirt",
    "properties": [
      {
        "name": "Color",
        "value": "Blue"
      },
      {
        "name": "Size",
        "value": "Large"
      }
    ],
    "quantity": 1,
    "sku": "TOM0001",
    "sku_override": false,
    "status": "active",
    "updated_at": "2020-02-19T17:40:10+00:00",
    "variant_title": "Blue star"
  }
}

#Cancel a subscription

POST/subscriptions/{id}/cancel
Cancel an active subscription.
Scopewrite_subscriptions
An involuntary subscription cancelled due to max retries reached will trigger the charge/max_retries_reached webhook.

Query parameters

  • commitbooleanNew
    If set to true, the QUEUED charges linked to the Subscription are regenerated before the response is returned. If omitted or false, the charges are regenerated asynchronously.

Body parameters

  • Reason for subscription cancellation.
  • Cancellation reason comment. Maximum length is 1024 characters.
  • send_emailboolean
    If 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
  • overridebooleanNew
    If set to true, the cancellation reason and comments can be replaced on a Subscription that was already cancelled after reaching the maximum number of charge attempts.
POST/subscriptions/{id}/cancel
curl -X POST 'https://api.rechargeapps.com/subscriptions/27363808/cancel' \
  -H 'X-Recharge-Version: v2' \
  -H 'Content-Type: application/json' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -d '{
  "cancellation_reason": "other reason"
}'
Response
{
  "subscription": {
    "id": 27363808,
    "address_id": 42171447,
    "customer_id": 37657002,
    "analytics_data": {
      "utm_params": {
        "utm_source": "facebook",
        "utm_medium": "cpc"
      }
    },
    "cancellation_reason": null,
    "cancellation_reason_comments": null,
    "cancelled_at": null,
    "charge_interval_frequency": 1,
    "created_at": "2020-02-19T17:40:09+00:00",
    "expire_after_specific_number_of_charges": null,
    "external_product_id": {
      "ecommerce": "4381728735283"
    },
    "external_variant_id": {
      "ecommerce": "32309455192167"
    },
    "has_queued_charges": true,
    "is_digital": false,
    "is_prepaid": false,
    "is_skippable": true,
    "is_swappable": false,
    "max_retries_reached": false,
    "next_charge_scheduled_at": "2021-08-05",
    "order_day_of_month": null,
    "order_day_of_week": null,
    "order_interval_frequency": 1,
    "order_interval_unit": "month",
    "presentment_currency": "USD",
    "price": "10.00",
    "product_title": "ABC Shirt",
    "properties": [
      {
        "name": "Color",
        "value": "Blue"
      },
      {
        "name": "Size",
        "value": "Large"
      }
    ],
    "quantity": 1,
    "sku": "TOM0001",
    "sku_override": false,
    "status": "active",
    "updated_at": "2020-02-19T17:40:10+00:00",
    "variant_title": "Blue star"
  }
}

#Activate a subscription

POST/subscriptions/{id}/activate
Activate a cancelled subscription.
Scopewrite_subscriptions
When activating subscription, following attributes will be set to null: cancelled_at, cancellation_reason and cancellation_reason_comments.

Query parameters

  • commitbooleanNew
    If set to true, the QUEUED charges linked to the Subscription are regenerated before the response is returned. If omitted or false, the charges are regenerated asynchronously.

Body parameters

  • custom_event_attributesarray of objectsNew
    A list of up to 10 custom key-value pairs to attach to the Events generated by this request. They are returned in the custom_attributes of those Events.
    Show child attributesHide child attributes22 new
    • keystringNew
      The name of the custom attribute.
    • valuestring · nullableNew
      The value of the custom attribute. Maximum length is 255 characters.
POST/subscriptions/{id}/activate
curl -X POST 'https://api.rechargeapps.com/subscriptions/27363808/activate' \
  -H 'X-Recharge-Version: v2' \
  -H 'Content-Type: application/json' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -d '{}'
Response
{
  "subscription": {
    "id": 27363808,
    "address_id": 42171447,
    "customer_id": 37657002,
    "analytics_data": {
      "utm_params": {
        "utm_source": "facebook",
        "utm_medium": "cpc"
      }
    },
    "cancellation_reason": null,
    "cancellation_reason_comments": null,
    "cancelled_at": null,
    "charge_interval_frequency": 1,
    "created_at": "2020-02-19T17:40:09+00:00",
    "expire_after_specific_number_of_charges": null,
    "external_product_id": {
      "ecommerce": "4381728735283"
    },
    "external_variant_id": {
      "ecommerce": "32309455192167"
    },
    "has_queued_charges": true,
    "is_digital": false,
    "is_prepaid": false,
    "is_skippable": true,
    "is_swappable": false,
    "max_retries_reached": false,
    "next_charge_scheduled_at": "2021-08-05",
    "order_day_of_month": null,
    "order_day_of_week": null,
    "order_interval_frequency": 1,
    "order_interval_unit": "month",
    "presentment_currency": "USD",
    "price": "10.00",
    "product_title": "ABC Shirt",
    "properties": [
      {
        "name": "Color",
        "value": "Blue"
      },
      {
        "name": "Size",
        "value": "Large"
      }
    ],
    "quantity": 1,
    "sku": "TOM0001",
    "sku_override": false,
    "status": "active",
    "updated_at": "2020-02-19T17:40:10+00:00",
    "variant_title": "Blue star"
  }
}

#Gift a skipped subscription

POST/subscriptions/skip_gift
Gift a skipped Subscription to a recipient.
Scopewrite_subscriptions
Only available for stores that have gifting of skipped shipments enabled; other stores receive a 401 error. The response contains the Onetimes created for the recipient in an onetimes array.

Body parameters

  • purchase_item_idsarrayRequired
    A list containing the Subscription IDs to be skipped.
  • recipient_addressobjectRequired
    An object that contains information associated with the giftee's Address
    Show child attributesHide child attributes11
    • address1stringRequired
      The street associated with the giftee Address.
    • address2string
      Any additional information associated with the giftee Address.
    • citystringRequired
      The city associated with the giftee address.
    • companystring
      The company associated with the giftee address.
    • country_codestringRequired
      2-letter country code.
    • first_namestringRequired
      The giftee's first name associated with the address.
    • last_namestringRequired
      The giftee's last name associated with the address.
    • phonestring
      The giftee's phone number associated with the address.
    • provincestringRequired
      The state or province associated with the giftee address.
    • zipstringRequired
      The zip or postal code associated with the giftee address.
    • emailstringRequired
      Email address for the giftee.
      will be required for sending the notification to the giftee.

Response attributes

  • idinteger
    Unique numeric identifier for the Onetime purchase.
  • address_idinteger
    Unique numeric identifier for the address the Onetime Purchase is associated with (cannot be used with next_charge_scheduled_at)
  • created_atdatetime
    The time the Onetime item was first created.
  • Unique numeric identifier for the customer the Onetime purchase is tied to.
  • An object containing the product id as it appears in external platforms.
    Show child attributesHide child attributes1
    • ecommercestring
      The product id as it appears in the external e-commerce platform. The external_product_id of the Product record in Recharge, linking a Plan to a Product.
  • An object containing the variant id as it appears in external platforms.
    Show child attributesHide child attributes1
    • ecommercestring
      The variant id as it appears in the external e-commerce platform. The external_variant_id of the Product record in Recharge, linking a Plan to a Product.
  • Flag indicating if the the onetime is cancelled.
  • Date of the Onetime purchase execution.
    Cannot be used with add_to_next_charge
  • pricestring
    The price of the item before discounts, taxes, or shipping have been applied.
  • The name of the product in a shop’s catalog.
  • propertiesarray of objects
    An array containing key value pairs for any supplementary data.
    Show child attributesHide child attributes2
    • namestring
      The name of the property.
    • valuestring
      The value of the property.
  • quantityinteger
    The number of items in the Onetime purchase.
  • skustring
    A unique identifier of the item in the fulfillment.
  • Flag that is automatically updated to true when SKU is passed on POST or PUT.
    When sku_override is true, the sku on the Onetime will be used to generate Charges and Orders.
    When sku_override is false, Recharge will dynamically fetch the sku from the corresponding external_platform_variant.
  • The time the Onetime purchase was last updated.
  • The name of the variant in a shop’s catalog.
POST/subscriptions/skip_gift
curl -X POST 'https://api.rechargeapps.com/subscriptions/skip_gift' \
  -H 'X-Recharge-Version: v2' \
  -H 'Content-Type: application/json' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -d '{
  "recipient_address": {
    "address1": "1776 Washington Street",
    "address2": "",
    "city": "Los Angeles",
    "company": "Recharge",
    "country_code": "US",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "5551234567",
    "province": "California",
    "zip": "90404",
    "email": "fake@example.com"
  },
  "purchase_item_ids": [
    27363808,
    27363809
  ]
}'
Response
{
  "onetimes": [
    {
      "id": 16909886,
      "address_id": 45154492,
      "created_at": "2021-05-24T19:14:25+00:00",
      "customer_id": 40565990,
      "external_product_id": {
        "ecommerce": "4950280863846"
      },
      "external_variant_id": {
        "ecommerce": "32139793137766"
      },
      "is_cancelled": false,
      "is_digital": false,
      "next_charge_scheduled_at": "2021-12-17T05:00:00+00:00",
      "price": "6.00",
      "product_title": "ABC Shirt",
      "properties": [
        {
          "name": "Color",
          "value": "Blue"
        }
      ],
      "quantity": 1,
      "sku": "TOM0001",
      "sku_override": false,
      "updated_at": "2021-05-24T19:30:14+00:00",
      "variant_title": "Blue star"
    }
  ]
}

#Skip a future charge for a subscriptionNew

POST/subscriptions/{id}/charges/skip
Skip an upcoming charge date of a Subscription for which no Charge exists yet. A Charge with the status skipped is created for the date, or the Subscription is added to a Charge that is already skipped on that date. If a Charge containing the Subscription already exists on the date, use the skip a charge endpoint instead.
Scopewrite_orders

Body parameters

  • datedateRequired
    The date of the upcoming charge to skip. It must be at least one day in the future, match a date in the customer's upcoming delivery schedule, and be within the number of days the store allows charges to be skipped in advance (90 by default).
POST/subscriptions/{id}/charges/skip
curl -X POST 'https://api.rechargeapps.com/subscriptions/129593/charges/skip' \
  -H 'X-Recharge-Version: v2' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "charge": {
    "id": 880000001,
    "address_id": 120000001,
    "status": "skipped",
    "type": "recurring",
    "scheduled_at": "2027-01-15"
  }
}

#Preview skipping the next charge of a subscriptionNew

GET/subscriptions/{id}/charges/skip/preview
Retrieve the date of the next charge of a Subscription and the date its following charge would be scheduled on if the next charge were skipped. Nothing is changed by this request. A 400 error is returned when the Subscription has no upcoming charge.
Scoperead_subscriptions
GET/subscriptions/{id}/charges/skip/preview
curl 'https://api.rechargeapps.com/subscriptions/129593/charges/skip/preview' \
  -H 'X-Recharge-Version: v2' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "subscription_id": 510000001,
  "current_next_charge_date": "2027-01-15",
  "expected_next_charge_date": "2027-02-15"
}

#Bulk change subscription addressesNew

POST/addresses/{address_id}/subscriptions-bulk-change-address
Move several Subscriptions from the Address in the path to other addresses of the same Customer in one request. Every Subscription must currently belong to the Address in the path, and each destination Address must use the same currency.
Scopewrite_subscriptions

Query parameters

  • commitboolean
    If set to true, the QUEUED charges linked to the Subscription are regenerated before the response is returned. If omitted or false, the charges are regenerated asynchronously.

Body parameters

  • subscriptionsarray of objectsRequired
    The list of subscriptions to move.
    Show child attributesHide child attributes3
    • idintegerRequired
      Unique numeric identifier of the Subscription to move.
    • address_idintegerRequired
      Unique numeric identifier of the Address the Subscription is moved to.
    • The next charge date desired for the Subscription on the new Address. It must be in the future.
POST/addresses/{address_id}/subscriptions-bulk-change-address
curl -X POST 'https://api.rechargeapps.com/addresses/191897/subscriptions-bulk-change-address' \
  -H 'X-Recharge-Version: v2' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "subscriptions": [
    {
      "id": 510000001,
      "address_id": 120000002,
      "customer_id": 90000001,
      "status": "active",
      "next_charge_scheduled_at": "2027-01-15"
    }
  ]
}

#Update a bundle subscription and its contentsNew

PUT/bundles/{purchase_item_id}
Update a Subscription or Onetime for a bundle product and the contents of its BundleSelection in a single request. The request accepts the same body parameters as the update a subscription endpoint, plus items. It can only be used when the current or the new product is a bundle product, and only for items with the status active or onetime.
Scopewrite_subscriptions

Query parameters

  • commitboolean
    If set to true, the QUEUED charges linked to the Subscription are regenerated before the response is returned. If omitted or false, the charges are regenerated asynchronously.

Body parameters

  • An object containing the product id as it appears in external platforms.
    Show child attributesHide child attributes1
    • ecommercestring
      The product id as it appears in the external e-commerce platform.
  • An object containing the variant id as it appears in external platforms.
    Show child attributesHide child attributes1
    • ecommercestring
      The variant id as it appears in the external e-commerce platform.
  • itemsarray of objects
    The list of items that make up the contents of the bundle.
    Show child attributesHide child attributes5
    • collection_idstringRequired
      The id of the collection the item belongs to.
    • external_product_idstringRequired
      The product id of the item as it appears in the external e-commerce platform.
    • external_variant_idstringRequired
      The variant id of the item as it appears in the external e-commerce platform.
    • pricestring
      The price of the item. It cannot be negative.
    • quantityintegerRequired
      The quantity of the item.
  • plan_idinteger
    A Recharge Plan id that provides interval information for the Subscription.
PUT/bundles/{purchase_item_id}
curl -X PUT 'https://api.rechargeapps.com/bundles/241376' \
  -H 'X-Recharge-Version: v2' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "subscription": {
    "id": 510000001,
    "address_id": 120000001,
    "customer_id": 90000001,
    "status": "active",
    "quantity": 1,
    "price": "45.00",
    "items": [
      {
        "id": 7700001,
        "collection_id": "400000000001",
        "external_product_id": "8000000000001",
        "external_variant_id": "44000000000001",
        "quantity": 2,
        "price": "0.00"
      }
    ]
  }
}