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.25 additions in V2, marked New
Everything marked New also works when you send X-Recharge-Version: 2021-11.
#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 attributes91 new
- 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.
- The price of the item.
- 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. - The ID of the
Chargeassociated with theBundleSelection, when the selection applies to a specific upcoming charge. - The ID of the
Orderassociated with theBundleSelection. - The item count of the
BundleVariantassociated with theBundleSelection. - Whether the selection is the default selection of the
BundleVariant, returned because no selection has been made for thePurchaseItem. Fallback selections have anullid.Fallback selections are only returned when filtering bypurchase_item_idson stores that have default bundle selections enabled; otherwise the value is alwaysfalse.
{
"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",
"price": "10.00",
"quantity": 3,
"updated_at": "2022-08-26T18:52:41+00:00"
}
],
"updated_at": "2022-08-26T18:31:28+00:00",
"charge_id": null,
"order_id": null,
"items_count": 3
}
}#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. - Show
BundleSelectionsupdated after the given date. - Show
BundleSelectionsupdated before the given date. - Return either the next or previous page of bundle selections using the
next_cursororprevious_cursorvalue from a previous response. Onlylimitcan be passed together withcursor. - Filter
BundleSelectionsbyChargeID. If passing multiple values, must be comma separated.Only available to stores that can manage bundle selections for individual upcoming charges; other stores receive a 403. - Filter
BundleSelectionsthat contain an item with one of the given external product IDs. If passing multiple values, must be comma separated.Only available to stores that have item filters enabled for bundle selections; other stores receive a 403. - Filter
BundleSelectionsthat contain an item with one of the given external variant IDs. If passing multiple values, must be comma separated.Only available to stores that have item filters enabled for bundle selections; other stores receive a 403.
curl 'https://api.rechargeapps.com/bundle_selections?limit=3' \
-H 'X-Recharge-Version: v2' \
-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",
"price": "10.00",
"quantity": 3,
"updated_at": "2022-08-26T18:52:41+00:00"
}
],
"updated_at": "2022-08-26T18:31:28+00:00",
"charge_id": null,
"order_id": null,
"items_count": 3
}
]
}#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: v2' \
-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",
"price": "10.00",
"quantity": 3,
"updated_at": "2022-08-26T18:52:41+00:00"
}
],
"updated_at": "2022-08-26T18:31:28+00:00",
"charge_id": null,
"order_id": null,
"items_count": 3
}
}#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.
Returns
201. Items with a quantity of zero or less are ignored.Query parameters
- Controls whether the
QUEUEDcharges linked to the purchase item are regenerated before the response is returned (true, default) or in the background (false). - If
true, the selected items are not validated against the external e-commerce platform.Only honored for stores that have been enabled to skip remote validation; ignored otherwise.
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 attributes61 new
- The collection id as it appears in the external e-commerce platform.
- collection_sourcestringThe 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.
- The price of the item. Must not be negative.Only applied to dynamically priced bundles that allow custom prices; ignored for other bundles.
- The quantity of this product.
- The ID of the upcoming
ChargetheBundleSelectionapplies to. The charge must be inQUEUEDstatus.Only available to stores that can manage bundle selections for individual upcoming charges; other stores receive a 403. - The ID of the
OrdertheBundleSelectionapplies to. Requirescharge_id, and the order must belong to that charge.Only available to stores that can manage bundle selections for individual upcoming charges.
Response attributes
- errorsobjectError object
curl -X POST 'https://api.rechargeapps.com/bundle_selections' \
-H 'X-Recharge-Version: v2' \
-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",
"price": "10.00",
"quantity": 3,
"updated_at": "2022-08-26T18:52:41+00:00"
}
],
"updated_at": "2022-08-26T18:31:28+00:00",
"charge_id": null,
"order_id": null,
"items_count": 3
}
}#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.
The
items list replaces the current selection: items sent with an id are updated, items sent without an id are created, and existing items that are not in the list are removed.Query parameters
- Controls whether the
QUEUEDcharges linked to the purchase item are regenerated before the response is returned (true, default) or in the background (false). - If
true, the selected items are not validated against the external e-commerce platform.Only honored for stores that have been enabled to skip remote validation; ignored otherwise.
Body parameters
- 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.
- itemsarray of objectsA list of
itemobjects, each containing information about a distinct product selected as part of the Bundle.Show child attributesHide child attributes66 new
- The unique numeric identifier of an existing item selection to update. Items sent without an
idare created. - The collection id as it appears in the external e-commerce platform.
- The product id as it appears in the external e-commerce platform.
- The variant id as it appears in the external e-commerce platform.
- The price of the item. Must not be negative.Only applied to dynamically priced bundles that allow custom prices; ignored for other bundles.
- The quantity of this product.
Response attributes
curl -X PUT 'https://api.rechargeapps.com/bundle_selections/100714428' \
-H 'X-Recharge-Version: v2' \
-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",
"price": "10.00",
"quantity": 3,
"updated_at": "2022-08-26T18:52:41+00:00"
}
],
"updated_at": "2022-08-26T18:31:28+00:00",
"charge_id": null,
"order_id": null,
"items_count": 3
}
}#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.
Query parameters
- Controls whether the
QUEUEDcharges linked to the purchase item are regenerated before the response is returned (true, default) or in the background (false).
Response attributes
curl -X DELETE 'https://api.rechargeapps.com/bundle_selections/100714428' \
-H 'X-Recharge-Version: v2' \
-H 'X-Recharge-Access-Token: your_api_token'{}