API
GuidesGet API token
Core Resources

Bundle Selections

Plus planSCIRCS
A bundle selection represents the contents within a Bundle linked to an individual Subscription. It can represent the selection for upcoming orders or past orders. A BundleSelection is associated with a corresponding Subscription and a BundleVariant (the BundleVariant is used to validate contents in the selection). When a new order for the associated Subscription occurs, it will extract the current contents of the BundleSelection for the Bundle item in the order.

#The bundle selection object

Plus planRCSSCI
A bundle selection represents the contents within a Bundle linked to an individual Subscription. It can represent the selection for upcoming orders or past orders. A BundleSelection is associated with a corresponding Subscription and a BundleVariant (the BundleVariant is used to validate contents in the selection).

Attributes

  • idinteger
    The unique numeric identifier for the BundleSelection.
  • The ID of the BundleVariant associated with the BundleSelection.
  • The ID of the PurchaseItem associated with the BundleSelection.
  • created_atdatetime
    The date and time when the contents were selected.
  • The product id as it appears in the external e-commerce platform. The external_product_id of the Product record in Recharge, linking the BundleSelection to a Product associated with a Bundle.
  • The variant id as it appears in the external e-commerce platform. The external_variant_id of the Product record in Recharge, linking the BundleSelection to a Product associated with a Bundle.
  • itemsarray of objects
    A list of item objects, each containing information about a distinct product selected as part of the Bundle.
    Show child attributesHide child attributes8
    • idinteger
      The unique numeric identifier for the item selection.
    • The collection id as it appears in the external e-commerce platform.
    • The identifier of the external e-commerce platform.
    • created_atdatetime
      The date and time when this item was selected.
    • The product id as it appears in the external e-commerce platform. This is the item which is going to be extracted when the Bundle is processed.
    • The variant id as it appears in the external e-commerce platform. This is the item which is going to be extracted when the Bundle is processed.
    • quantityinteger
      The quantity of this product.
    • updated_atdatetime
      The date and time at which the item selection was most recently updated.
  • updated_atdatetime
    The date and time at which the BundleSelection was most recently updated.
The bundle selection object
{
  "bundle_selection": {
    "id": 100714428,
    "bundle_variant": 382417,
    "purchase_item_id": 199820883,
    "created_at": "2022-08-26T18:31:28+00:00",
    "external_product_id": "7121697210548",
    "external_variant_id": "41450875650228",
    "items": [
      {
        "id": 541,
        "collection_id": "287569608884",
        "collection_source": "shopify",
        "created_at": "2022-08-26T18:31:28+00:00",
        "external_product_id": "7121693671604",
        "external_variant_id": "41450853105844",
        "quantity": 3,
        "updated_at": "2022-08-26T18:52:41+00:00"
      }
    ],
    "updated_at": "2022-08-26T18:31:28+00:00"
  }
}

#List bundle selections

GET/bundle_selections
Plus planRCSSCI
Returns a list of BundleSelections.

HTTP request examples

GET /bundle_selections?purchase_item_ids=:purchase_item_id_1,:purchase_item_id_2

GET /bundle_selections?bundle_variant_ids=:bundle_variant_id_1,:bundle_variant_id_2

GET /bundle_selections?limit=1

GET /bundle_selections?limit=1&page=2

GET /bundle_selections?sort_by=updated_at-desc

Returned BundleSelections are sorted descending by ID value by default.
Scoperead_subscriptions
BundleSelections endpoints are available for Recharge Plus merchants. If you’re interested in leveraging the Recharge bundle_selections endpoints, reach out to your account manager or our Support team.
Learn more about Recharge Plus.

Query parameters

  • Filter BundleSelections by Subscription or Onetime ID.
    If passing multiple values, must be comma separated. Non-integer values will result in a 422 error.
  • Filter BundleSelections by BundleVariants.
    If passing multiple values, must be comma separated. Non-integer values will result in a 422 error.
  • limitstring
    The amount 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_bystring
    Sort listed BundleSelections in a specific order.
    Available sort options: id-asc, id-desc, updated_at-asc, updated_at-desc.
  • Bundle selections are not directly linked to Subscriptions. By default, the endpoint returns Bundle Selections, even those associated with cancelled subscriptions, unless the Bundle Selection has been deleted.
    To exclude cancelled subscriptions from your results, include active_purchase_items=true in your query.
GET/bundle_selections
curl 'https://api.rechargeapps.com/bundle_selections?limit=3' \
  -H 'X-Recharge-Version: 2021-11' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "next_cursor": null,
  "previous_cursor": null,
  "bundle_selections": [
    {
      "id": 100714428,
      "bundle_variant": 382417,
      "purchase_item_id": 199820883,
      "created_at": "2022-08-26T18:31:28+00:00",
      "external_product_id": "7121697210548",
      "external_variant_id": "41450875650228",
      "items": [
        {
          "id": 541,
          "collection_id": "287569608884",
          "collection_source": "shopify",
          "created_at": "2022-08-26T18:31:28+00:00",
          "external_product_id": "7121693671604",
          "external_variant_id": "41450853105844",
          "quantity": 3,
          "updated_at": "2022-08-26T18:52:41+00:00"
        }
      ],
      "updated_at": "2022-08-26T18:31:28+00:00"
    }
  ]
}

#Retrieve a bundle selection

GET/bundle_selections/{id}
Plus planRCSSCI
Retrieve a BundleSelection using the bundle_selection_id.
Scoperead_subscriptions
BundleSelections endpoints are available for Recharge Plus merchants. If you’re interested in leveraging the Recharge bundle_selections endpoints, reach out to your account manager or our Support team.
Learn more about Recharge Plus.

Response attributes

  • errorstring
    Error message
  • messagestring
    Details about the error
GET/bundle_selections/{id}
curl 'https://api.rechargeapps.com/bundle_selections/100714428' \
  -H 'X-Recharge-Version: 2021-11' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{
  "bundle_selection": {
    "id": 100714428,
    "bundle_variant": 382417,
    "purchase_item_id": 199820883,
    "created_at": "2022-08-26T18:31:28+00:00",
    "external_product_id": "7121697210548",
    "external_variant_id": "41450875650228",
    "items": [
      {
        "id": 541,
        "collection_id": "287569608884",
        "collection_source": "shopify",
        "created_at": "2022-08-26T18:31:28+00:00",
        "external_product_id": "7121693671604",
        "external_variant_id": "41450853105844",
        "quantity": 3,
        "updated_at": "2022-08-26T18:52:41+00:00"
      }
    ],
    "updated_at": "2022-08-26T18:31:28+00:00"
  }
}

#Create a bundle selection

POST/bundle_selections
Plus planRCSSCI
Create a BundleSelection.
Scopewrite_subscriptions
BundleSelections endpoints are available for Recharge Plus merchants. If you’re interested in leveraging the Recharge bundle_selections endpoints, reach out to your account manager or our Support team.
Learn more about Recharge Plus.

Body parameters

  • purchase_item_idintegerRequired
    The ID of the PurchaseItem associated with the BundleSelection.
  • plan_idinteger
    A Recharge Plan ID. If provided in a dynamically-priced Bundle, the unit price of each product variant will be inferred from the plan associated with the ID; otherwise, it will be inferred from the plan with the greatest discount for each product in the selection. This is not used in fixed-priced Bundles.
  • itemsarray of objectsRequired
    A list of item objects, each containing information about a distinct product selected as part of the Bundle.
    Show child attributesHide child attributes5
    • The collection id as it appears in the external e-commerce platform.
    • The identifier of the external e-commerce platform.
    • The product id as it appears in the external e-commerce platform. This is the item which is going to be extracted when the Bundle is processed.
    • The variant id as it appears in the external e-commerce platform. This is the item which is going to be extracted when the Bundle is processed.
    • quantityinteger
      The quantity of this product.

Response attributes

POST/bundle_selections
curl -X POST 'https://api.rechargeapps.com/bundle_selections' \
  -H 'X-Recharge-Version: 2021-11' \
  -H 'Content-Type: application/json' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -d '{
  "purchase_item_id": 199820883,
  "items": [
    {
      "collection_id": "287569608884",
      "collection_source": "shopify",
      "external_product_id": "7121693671604",
      "external_variant_id": "41450853105844",
      "quantity": 3
    }
  ]
}'
Response
{
  "bundle_selection": {
    "id": 100714428,
    "bundle_variant": 382417,
    "purchase_item_id": 199820883,
    "created_at": "2022-08-26T18:31:28+00:00",
    "external_product_id": "7121697210548",
    "external_variant_id": "41450875650228",
    "items": [
      {
        "id": 541,
        "collection_id": "287569608884",
        "collection_source": "shopify",
        "created_at": "2022-08-26T18:31:28+00:00",
        "external_product_id": "7121693671604",
        "external_variant_id": "41450853105844",
        "quantity": 3,
        "updated_at": "2022-08-26T18:52:41+00:00"
      }
    ],
    "updated_at": "2022-08-26T18:31:28+00:00"
  }
}

#Update a bundle selection

PUT/bundle_selections/{id}
Plus planRCSSCI
Modify an existing BundleSelection to match the specified parameters.
Scopewrite_subscriptions
BundleSelections endpoints are available for Recharge Plus merchants. If you’re interested in leveraging the Recharge bundle_selections endpoints, reach out to your account manager or our Support team.
Learn more about Recharge Plus.

Body parameters

  • The ID of the PurchaseItem associated with the BundleSelection.
  • plan_idinteger
    A Recharge Plan ID. If provided in a dynamically-priced Bundle, the unit price of each product variant will be inferred from the plan associated with the ID; otherwise, it will be inferred from the plan with the greatest discount for each product in the selection. This is not used in fixed-priced Bundles.
  • itemsarray
    A list of item objects, each containing information about a distinct product selected as part of the Bundle.

Response attributes

  • errorstring
    Error message
  • messagestring
    Details about the error
PUT/bundle_selections/{id}
curl -X PUT 'https://api.rechargeapps.com/bundle_selections/100714428' \
  -H 'X-Recharge-Version: 2021-11' \
  -H 'Content-Type: application/json' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -d '{
  "purchase_item_id": 199820883,
  "items": [
    {
      "collection_id": "287569608884",
      "collection_source": "shopify",
      "external_product_id": "7121693671604",
      "external_variant_id": "41450853105844",
      "quantity": 3
    }
  ]
}'
Response
{
  "bundle_selection": {
    "id": 100714428,
    "bundle_variant": 382417,
    "purchase_item_id": 199820883,
    "created_at": "2022-08-26T18:31:28+00:00",
    "external_product_id": "7121697210548",
    "external_variant_id": "41450875650228",
    "items": [
      {
        "id": 541,
        "collection_id": "287569608884",
        "collection_source": "shopify",
        "created_at": "2022-08-26T18:31:28+00:00",
        "external_product_id": "7121693671604",
        "external_variant_id": "41450853105844",
        "quantity": 3,
        "updated_at": "2022-08-26T18:52:41+00:00"
      }
    ],
    "updated_at": "2022-08-26T18:31:28+00:00"
  }
}

#Delete a bundle selection

DELETE/bundle_selections/{id}
Plus planRCSSCI
Delete a BundleSelection
Scopewrite_subscriptions
BundleSelections endpoints are available for Recharge Plus merchants. If you’re interested in leveraging the Recharge bundle_selections endpoints, reach out to your account manager or our Support team.
Learn more about Recharge Plus.

Response attributes

  • errorstring
    Error message
  • messagestring
    Details about the error
DELETE/bundle_selections/{id}
curl -X DELETE 'https://api.rechargeapps.com/bundle_selections/100714428' \
  -H 'X-Recharge-Version: 2021-11' \
  -H 'X-Recharge-Access-Token: your_api_token'
Response
{}