Core Resources
Bundle Selections
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
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
- idintegerThe unique numeric identifier for the
BundleSelection. - bundle_variant_idintegerThe ID of the
BundleVariantassociated with theBundleSelection. - purchase_item_idintegerThe ID of the
PurchaseItemassociated with theBundleSelection. - created_atdatetimeThe date and time when the contents were selected.
- external_product_idstringThe product id as it appears in the external e-commerce platform. The
external_product_idof theProductrecord in Recharge, linking theBundleSelectionto aProductassociated with a Bundle. - external_variant_idstringThe variant id as it appears in the external e-commerce platform. The
external_variant_idof theProductrecord in Recharge, linking theBundleSelectionto aProductassociated with a Bundle. - itemsarray of objectsA list of
itemobjects, each containing information about a distinct product selected as part of the Bundle.Show child attributesHide child attributes8
- idintegerThe unique numeric identifier for the item selection.
- collection_idstringThe collection id as it appears in the external e-commerce platform.
- collection_sourcestringThe identifier of the external e-commerce platform.
- created_atdatetimeThe date and time when this item was selected.
- external_product_idstringThe 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.
- external_variant_idstringThe 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.
- quantityintegerThe quantity of this product.
- updated_atdatetimeThe date and time at which the item selection was most recently updated.
- updated_atdatetimeThe date and time at which the
BundleSelectionwas most recently updated.
{
"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
Returns a list of
BundleSelections.HTTP request examples
GET /bundle_selections?purchase_item_ids=:purchase_item_id_1,:purchase_item_id_2GET /bundle_selections?bundle_variant_ids=:bundle_variant_id_1,:bundle_variant_id_2GET /bundle_selections?limit=1GET /bundle_selections?limit=1&page=2GET /bundle_selections?sort_by=updated_at-descReturned
BundleSelections are sorted descending by ID value by default.Scope
read_subscriptionsBundleSelections 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
- purchase_item_idsstringFilter
BundleSelectionsbySubscriptionorOnetimeID.If passing multiple values, must be comma separated. Non-integer values will result in a422error. - bundle_variant_idsstringFilter
BundleSelectionsbyBundleVariants.If passing multiple values, must be comma separated. Non-integer values will result in a422error. - limitstringThe amount of results.
- The page to show.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_bystringSort listed
BundleSelectionsin a specific order.
Available sort options:id-asc,id-desc,updated_at-asc,updated_at-desc. - active_purchase_itemsbooleanBundle 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, includeactive_purchase_items=truein your query.
curl 'https://api.rechargeapps.com/bundle_selections?limit=3' \
-H 'X-Recharge-Version: 2021-11' \
-H 'X-Recharge-Access-Token: your_api_token'{
"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}
Retrieve a
BundleSelection using the bundle_selection_id.Scope
read_subscriptionsBundleSelections 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
curl 'https://api.rechargeapps.com/bundle_selections/100714428' \
-H 'X-Recharge-Version: 2021-11' \
-H 'X-Recharge-Access-Token: your_api_token'{
"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
Create a
BundleSelection.Scope
write_subscriptionsBundleSelections 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
PurchaseItemassociated with theBundleSelection. - plan_idintegerA 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.
- A list of
itemobjects, each containing information about a distinct product selected as part of the Bundle.Show child attributesHide child attributes5
- collection_idstringThe collection id as it appears in the external e-commerce platform.
- collection_sourcestringThe identifier of the external e-commerce platform.
- external_product_idstringThe 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.
- external_variant_idstringThe 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.
- quantityintegerThe quantity of this product.
Response attributes
- errorsobjectError object
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
}
]
}'{
"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}
Modify an existing
BundleSelection to match the specified parameters.Scope
write_subscriptionsBundleSelections 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_idintegerThe ID of the
PurchaseItemassociated with theBundleSelection. - plan_idintegerA 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.
- itemsarrayA list of
itemobjects, each containing information about a distinct product selected as part of the Bundle.
Response attributes
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
}
]
}'{
"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}
Delete a
BundleSelectionScope
write_subscriptionsBundleSelections 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
curl -X DELETE 'https://api.rechargeapps.com/bundle_selections/100714428' \
-H 'X-Recharge-Version: 2021-11' \
-H 'X-Recharge-Access-Token: your_api_token'{}