Skip to content

Reactivate

GEThttps://rebuyengine.com/api/v1/recharge/reactivate

Use Cases

Use this endpoint to build one-click reactive subscription workflows. Use the data returned by this endpoint to create personalized one-click reactive emails and web pages. Use the returned rebuy_reactivate_link(s) as your call to actions to enable one-click reactivations.

Query Parameters

recharge_customer_id · string
The Recharge Customer ID to build the reactivate context object for. Example: 498633534
campaign_id · string
The Rebuy Recharge Reactivate Campaign ID. Example: 7
recharge_subscription_ids · string
Comma separated list of Recharge Subscription IDs or the keyword "all". This tells the system which subscription(s) to build the reactivate context object for. Using the keyword "all" builds the context based on all inactive subscriptions.
recharge_discount_code · string
The Recharge Discount Code to use when activating the subscription(s). Example: reactivate-and-save.
tk · string
A tracking key value to include in the rebuy_reactivate_link(s). Cannot exceed 40 characters in length. Example: ar52Za6542.
request_type · string
Valid values: preview, live. Pass preview to create preview reactivate links, live for live reactivate links.
bust_cache · string
Valid values: yes. Deletes cached response and generates a new one.
format · string
Valid values: pretty. Use pretty to make the response easy to read.

Code Example

// GET https://rebuyengine.com/api/v1/recharge/reactivate
const params = new URLSearchParams({
  recharge_customer_id: "YOUR_VALUE",
  campaign_id: "YOUR_VALUE"
});

fetch(`https://rebuyengine.com/api/v1/recharge/reactivate?${params}`)
  .then(response => response.json())
  .then(data => console.log(data));

Response Examples

200 - 200

{
  "data": {
    "rebuy_reactivate_all_link": "https://rebuyengine.com/recharge/reactivate?merchant_token=dqH%2FDonlX%2BSbHV3pSD7ry0%2FSjbttgGwuzpf5oysIzdJu0RSSYJa5YVGWA%2BUMv2mvwINdqsqixm7tSFx3j6lU%2FQ%3D%3D&recharge_customer_id=99369539&recharge_subscription_ids=all&recharge_discount_code=REBUY-REACTIVATE-FREE-SHIPPING&request_type=live",
    "recharge_customer": {
      "id": 99369539,
      "hash": "993695398e2dd0025e551aa0",
      "shopify_customer_id": "858872774718",
      "email": "timanderson@gmail.com",
      "created_at": "2018-11-21T19:32:03",
      "updated_at": "2019-11-24T15:55:53",
      "first_name": "Tim",
      "last_name": "Anderson",
      "billing_address1": "5837 Saint Tims Ave",
      "billing_address2": "",
      "billing_zip": "55424",
      "billing_city": "Edina",
      "billing_company": "",
      "billing_province": "Minnesota",
      "billing_country": "United States",
      "billing_phone": "6126369173",
      "processor_type": "stripe",
      "status": "INACTIVE",
      "has_valid_payment_method": true,
      "reason_payment_method_not_valid": null,
      "has_card_error_in_dunning": false,
      "number_active_subscriptions": 0,
      "number_subscriptions": 2,
      "first_charge_processed_at": "2018-11-21T19:32:06"
    },
    "recharge_subscriptions": [
      {
        "address_id": 21947148,
        "cancellation_reason": "I need it sooner",
        "cancellation_reason_comments": "",
        "cancelled_at": "2019-11-24T15:55:52",
        "charge_interval_frequency": "1",
        "created_at": "2019-11-24T05:53:34",
        "customer_id": 99369539,
        "expire_after_specific_number_of_charges": null,
        "has_queued_charges": 0,
        "id": 55271958,
        "is_skippable": true,
        "is_swappable": false,
        "max_retries_reached": 0,
        "next_charge_scheduled_at": null,
        "order_day_of_month": null,
        "order_day_of_week": null,
        "order_interval_frequency": "1",
        "order_interval_unit": "month",
        "price": 44.96,
        "product_title": "Primal Fuel Protein Powder - Vanilla or Coconut  10.00% Off Auto renew",
        "properties": [],
        "quantity": 1,
        "recharge_product_id": 647506,
        "shopify_product_id": 173792002060,
        "shopify_variant_id": 1781273526284,
        "sku": null,
        "sku_override": false,
        "status": "CANCELLED",
        "updated_at": "2019-11-24T15:55:52",
        "variant_title": "Vanilla Coconut",
        "rebuy_reactivate_link": "https://rebuyengine.com/recharge/reactivate?merchant_token=dqH%2FDonlX%2BSbHV3pSD7ry0%2FSjbttgGwuzpf5oysIzdJu0RSSYJa5YVGWA%2BUMv2mvwINdqsqixm7tSFx3j6lU%2FQ%3D%3D&recharge_customer_id=99369539&recharge_subscription_ids=55271958&recharge_discount_code=REBUY-REACTIVATE-FREE-SHIPPING&request_type=live",
        "shopify_product": {
          "id": 173792002060,
          "title": "Primal Fuel: Vanilla Coconut Whey Protein Drink Mix",
          "body_html": "Gluten free protein powder with 1g of sugar*\u2020? No way. Yes, whey! PRIMAL FUEL\u00ae Protein Powder in Vanilla Coconut is the creamy, delicious drink mix of your dreams. Simply shake, blend, stir, or mix this powder into coffee, smoothies, or milk for 10g of protein* per serving.\u00a0\n\u00a0\n*See nutrition facts panel for saturated fat content.\n\u2020Not a low-calorie food.\u00a0",
          "vendor": "Primal Kitchen",
          "product_type": "Whey Protein",
          "created_at": "2018-02-02T13:51:58-08:00",
          "handle": "primal-fuel-protein-powder-vanilla",
          "updated_at": "2019-11-24T02:53:15-08:00",
          "published_at": "2018-02-02T13:51:55-08:00",
          "template_suffix": "",
          "tags": "banned-ca, banned-ch, banned-de, banned-gb, banned-gi, banned-ie, banned-nl, banned-no, banned-nz, banned-sg, banned-sw, BCAA, gluten-free, paleo_friendly, Protein, protein shake, protein shakes, Shakes, soy-free, whey, whey isolate, whey protein",
          "published_scope": "web",
          "admin_graphql_api_id": "gid://shopify/Product/173792002060",
          "variants": [
            {
              "id": 1781273526284,
              "product_id": 173792002060,
              "title": "Vanilla Coconut",
              "price": "49.95",
              "sku": "PKFUEL-VAN",
              "position": 1,
              "inventory_policy": "continue",
              "compare_at_price": null,
              "fulfillment_service": "manual",
              "inventory_management": "shopify",
              "option1": "Vanilla Coconut",
              "option2": null,
              "option3": null,
              "created_at": "2018-02-02T13:51:58-08:00",
              "updated_at": "2019-11-24T02:53:15-08:00",
              "taxable": false,
              "barcode": "863699000177",
              "grams": 1179,
              "image_id": 4578142650429,
              "weight": 2.5993,
              "weight_unit": "lb",
              "inventory_item_id": 1888970080268,
              "inventory_quantity": 26787,
              "old_inventory_quantity": 26787,
              "tax_code": "",
              "requires_shipping": true,
              "admin_graphql_api_id": "gid://shopify/ProductVariant/1781273526284"
            }
          ],
          "options": [
            {
              "id": 280884969484,
              "product_id": 173792002060,
              "name": "Flavor Option",
              "position": 1,
              "values": [
                "Vanilla Coconut"
              ]
            }
          ],
          "images": [
            {
              "id": 4578142650429,
              "product_id": 173792002060,
              "position": 1,
              "created_at": "2019-02-07T12:11:09-08:00",
              "updated_at": "2019-10-03T10:36:55-07:00",
              "alt": null,
              "width": 960,
              "height": 960,
              "src": "https://cdn.shopify.com/s/files/1/2358/4793/products/Primal_Fuel_Vanilla.jpeg?v=1570124215",
              "variant_ids": [
                1781273526284
              ],
              "admin_graphql_api_id": "gid://shopify/ProductImage/4578142650429"
            },
            {
              "id": 11935919341629,
              "product_id": 173792002060,
              "position": 2,
              "created_at": "2019-07-03T13:18:47-07:00",
              "updated_at": "2019-10-03T10:36:55-07:00",
              "alt": "",
              "width": 1280,
              "height": 720,
              "src": "https://cdn.shopify.com/s/files/1/2358/4793/products/blend.png?v=1570124215",
              "variant_ids": [],
              "admin_graphql_api_id": "gid://shopify/ProductImage/11935919341629"
            }
          ],
          "image": {
            "id": 4578142650429,
            "product_id": 173792002060,
            "position": 1,
            "created_at": "2019-02-07T12:11:09-08:00",
            "updated_at": "2019-10-03T10:36:55-07:00",
            "alt": null,
            "width": 960,
            "height": 960,
            "src": "https://cdn.shopify.com/s/files/1/2358/4793/products/Primal_Fuel_Vanilla.jpeg?v=1570124215",
            "variant_ids": [
              1781273526284
            ],
            "admin_graphql_api_id": "gid://shopify/ProductImage/4578142650429"
          }
        },
        "shopify_variant": {
          "id": 1781273526284,
          "product_id": 173792002060,
          "title": "Vanilla Coconut",
          "price": "49.95",
          "sku": "PKFUEL-VAN",
          "position": 1,
          "inventory_policy": "continue",
          "compare_at_price": null,
          "fulfillment_service": "manual",
          "inventory_management": "shopify",
          "option1": "Vanilla Coconut",
          "option2": null,
          "option3": null,
          "created_at": "2018-02-02T13:51:58-08:00",
          "updated_at": "2019-11-24T02:53:15-08:00",
          "taxable": false,
          "barcode": "863699000177",
          "grams": 1179,
          "image_id": 4578142650429,
          "weight": 2.5993,
          "weight_unit": "lb",
          "inventory_item_id": 1888970080268,
          "inventory_quantity": 26787,
          "old_inventory_quantity": 26787,
          "tax_code": "",
          "requires_shipping": true,
          "admin_graphql_api_id": "gid://shopify/ProductVariant/1781273526284"
        }
      },
      {
        "address_id": 21947148,
        "cancellation_reason": "Other Reason",
        "cancellation_reason_comments": null,
        "cancelled_at": "2019-11-24T15:55:34",
        "charge_interval_frequency": "3",
        "created_at": "2018-11-21T19:32:06",
        "customer_id": 99369539,
        "expire_after_specific_number_of_charges": null,
        "has_queued_charges": 0,
        "id": 28159591,
        "is_skippable": true,
        "is_swappable": false,
        "max_retries_reached": 0,
        "next_charge_scheduled_at": null,
        "order_day_of_month": null,
        "order_day_of_week": null,
        "order_interval_frequency": "3",
        "order_interval_unit": "month",
        "price": 5.39,
        "product_title": "Organic Unsweetened Ketchup  10.00% Off Auto renew",
        "properties": [
          {
            "name": "_subscription_interval_frequencies",
            "value": "1,2,3"
          },
          {
            "name": "_subscription_interval_unit",
            "value": "Months"
          },
          {
            "name": "_subscription_product_url",
            "value": "/products/organic-unsweetened-ketchup"
          },
          {
            "name": "shipping_interval_frequency",
            "value": "3"
          },
          {
            "name": "shipping_interval_unit_type",
            "value": "Months"
          }
        ],
        "quantity": 1,
        "recharge_product_id": 759973,
        "shopify_product_id": 783834054775,
        "shopify_variant_id": 8686656290935,
        "sku": "PKKET-11OZ01",
        "sku_override": false,
        "status": "CANCELLED",
        "updated_at": "2019-11-24T15:55:34",
        "variant_title": "",
        "rebuy_reactivate_link": "https://rebuyengine.com/recharge/reactivate?merchant_token=dqH%2FDonlX%2BSbHV3pSD7ry0%2FSjbttgGwuzpf5oysIzdJu0RSSYJa5YVGWA%2BUMv2mvwINdqsqixm7tSFx3j6lU%2FQ%3D%3D&recharge_customer_id=99369539&recharge_subscription_ids=28159591&recharge_discount_code=REBUY-REACTIVATE-FREE-SHIPPING&request_type=live",
        "shopify_product": {
          "id": 783834054775,
          "title": "Organic Unsweetened Ketchup",
          "body_html": "Primal Kitchen Organic Unsweetened Ketchup is infused with USDA organic ingredients and packed with the all-American taste this iconic condiment is famous for, without the added sugar (not even dates, honey, or maple syrup).\u00a0Net Wt. 11.3oz",
          "vendor": "Primal Kitchen",
          "product_type": "Ketchup",
          "created_at": "2018-06-05T15:40:10-07:00",
          "handle": "organic-unsweetened-ketchup",
          "updated_at": "2019-11-24T10:39:16-08:00",
          "published_at": "2018-06-05T23:23:17-07:00",
          "template_suffix": "",
          "tags": "agave-honey-cane-sugar, banned-ca, certified-non-gmo, gluten-free, keto-paleo-friendly, usda_organic, vegan-product-tag, whole30-approved",
          "published_scope": "web",
          "admin_graphql_api_id": "gid://shopify/Product/783834054775",
          "variants": [
            {
              "id": 8686656290935,
              "product_id": 783834054775,
              "title": "Default Title",
              "price": "5.99",
              "sku": "PKKET-11OZ01",
              "position": 1,
              "inventory_policy": "deny",
              "compare_at_price": null,
              "fulfillment_service": "manual",
              "inventory_management": "shopify",
              "option1": "Default Title",
              "option2": null,
              "option3": null,
              "created_at": "2018-06-05T15:40:10-07:00",
              "updated_at": "2019-11-24T10:39:16-08:00",
              "taxable": true,
              "barcode": "",
              "grams": 635,
              "image_id": null,
              "weight": 635,
              "weight_unit": "g",
              "inventory_item_id": 8828713074807,
              "inventory_quantity": 321495,
              "old_inventory_quantity": 321495,
              "tax_code": "",
              "requires_shipping": true,
              "admin_graphql_api_id": "gid://shopify/ProductVariant/8686656290935"
            }
          ],
          "options": [
            {
              "id": 1419403067511,
              "product_id": 783834054775,
              "name": "Title",
              "position": 1,
              "values": [
                "Default Title"
              ]
            }
          ],
          "images": [
            {
              "id": 12006244843581,
              "product_id": 783834054775,
              "position": 1,
              "created_at": "2019-08-07T15:58:37-07:00",
              "updated_at": "2019-08-07T15:58:47-07:00",
              "alt": null,
              "width": 2048,
              "height": 2048,
              "src": "https://cdn.shopify.com/s/files/1/2358/4793/products/2019_PK_Ketchup_Shopify.jpg?v=1565218727",
              "variant_ids": [],
              "admin_graphql_api_id": "gid://shopify/ProductImage/12006244843581"
            },
            {
              "id": 2696824782967,
              "product_id": 783834054775,
              "position": 2,
              "created_at": "2018-06-05T15:40:10-07:00",
              "updated_at": "2019-08-07T15:58:47-07:00",
              "alt": null,
              "width": 2048,
              "height": 2048,
              "src": "https://cdn.shopify.com/s/files/1/2358/4793/products/PK_Ketchup_Label_V1_0_11oz_Front_2048x2048_df633679-48c9-40d7-b476-0f1e7a44e28e.jpg?v=1565218727",
              "variant_ids": [],
              "admin_graphql_api_id": "gid://shopify/ProductImage/2696824782967"
            },
            {
              "id": 2696824815735,
              "product_id": 783834054775,
              "position": 3,
              "created_at": "2018-06-05T15:40:10-07:00",
              "updated_at": "2019-08-07T15:58:47-07:00",
              "alt": null,
              "width": 2048,
              "height": 2048,
              "src": "https://cdn.shopify.com/s/files/1/2358/4793/products/PK_Ketchup_Label_V1_0_11oz_Back_2048x2048_6382cd96-e4f5-4ae9-a4aa-249bc0a75a5a.jpg?v=1565218727",
              "variant_ids": [],
              "admin_graphql_api_id": "gid://shopify/ProductImage/2696824815735"
            },
            {
              "id": 2696824848503,
              "product_id": 783834054775,
              "position": 4,
              "created_at": "2018-06-05T15:40:10-07:00",
              "updated_at": "2019-08-07T15:58:47-07:00",
              "alt": null,
              "width": 1080,
              "height": 1080,
              "src": "https://cdn.shopify.com/s/files/1/2358/4793/products/KetchupMustardMayo-SecretSauce-24May18-IG_810eb1ae-e8ff-4edc-b2cc-3014a378e3bc.jpg?v=1565218727",
              "variant_ids": [],
              "admin_graphql_api_id": "gid://shopify/ProductImage/2696824848503"
            }
          ],
          "image": {
            "id": 12006244843581,
            "product_id": 783834054775,
            "position": 1,
            "created_at": "2019-08-07T15:58:37-07:00",
            "updated_at": "2019-08-07T15:58:47-07:00",
            "alt": null,
            "width": 2048,
            "height": 2048,
            "src": "https://cdn.shopify.com/s/files/1/2358/4793/products/2019_PK_Ketchup_Shopify.jpg?v=1565218727",
            "variant_ids": [],
            "admin_graphql_api_id": "gid://shopify/ProductImage/12006244843581"
          }
        },
        "shopify_variant": {
          "id": 8686656290935,
          "product_id": 783834054775,
          "title": "Default Title",
          "price": "5.99",
          "sku": "PKKET-11OZ01",
          "position": 1,
          "inventory_policy": "deny",
          "compare_at_price": null,
          "fulfillment_service": "manual",
          "inventory_management": "shopify",
          "option1": "Default Title",
          "option2": null,
          "option3": null,
          "created_at": "2018-06-05T15:40:10-07:00",
          "updated_at": "2019-11-24T10:39:16-08:00",
          "taxable": true,
          "barcode": "",
          "grams": 635,
          "image_id": null,
          "weight": 635,
          "weight_unit": "g",
          "inventory_item_id": 8828713074807,
          "inventory_quantity": 321495,
          "old_inventory_quantity": 321495,
          "tax_code": "",
          "requires_shipping": true,
          "admin_graphql_api_id": "gid://shopify/ProductVariant/8686656290935"
        }
      }
    ]
  }
}

400 - 400

{
  "error": "Invalid Rebuy Recharge Reactivate Campaign ID given via campaign_id: 1"
}