Offering discounts for bundles
You may want to offer bundle-specific or quantity-based discounts on bundles. By default, dynamically priced bundles will use the subscription or one-time price associated with the bundle selection product. However, you can accomplish custom discounting - bundle discounts or quantity-based discounts - by using the bundle selections API and overriding the price of each bundle selection.
Before creating discounts, the Bundles team must enable the feature. To enable this feature, reach out to [email protected].
Platforms:
- Shopify Checkout Integration
- Migrated Shopify Checkout Integration
Creating discounts for bundles
Note:Creating discounts for Bundles requires custom coding and use of the Recharge API. Custom coding is not supported by the Recharge support team as per our design and integration policy. You can work with a developer, contact a Recharge Partner, or if eligible, take advantage of Recharge's Merchant Development Program to implement these changes.
To create discounts for bundles, you must retrieve a JSON object with information about the bundle, items, and prices. Then you must override each item's price in the bundle with the discounted prices. Refer to the following steps and code snippets to create discount for bundles:
- Make a
GETrequest to/bundle_selectionswith thepurchase_items_idsparameter set to the subscription ID. In the following example, theGETrequest is retrieving thepurchase_items_idsof 346359203:
curl 'https://api.rechargeapps.com/bundle_selections?purchase_item_ids=346359203' \
-H 'X-Recharge-Version: 2021-11' \
-H "X-Recharge-Access-Token: $TOKEN"- Use the returned JSON object to view the information about the bundle, items, and prices.
- Make a
PUTrequest to/bundle_selections/:idwith the updated item prices. In the following example, thePUTrequest sets the price for each select to $1.00 per item, resulting in a total bundle cost of $12:
curl -X PUT 'https://api.rechargeapps.com/bundle_selections/324474' \
-H 'X-Recharge-Version: 2021-11' \
-H 'Content-Type: application/json' \
-H "X-Recharge-Access-Token: $TOKEN" \
-d '{
"items": [
{
"id": 4176688,
"collection_id": "437254881586",
"collection_source": "shopify",
"created_at": "2023-03-27T21:38:04+00:00",
"external_product_id": "8152797053234",
"external_variant_id": "44580980588850",
"price": "1.00",
"quantity": 6,
"updated_at": "2023-03-27T21:38:04+00:00"
},
{
"id": 4176687,
"collection_id": "437254881586",
"collection_source": "shopify",
"created_at": "2023-03-27T21:38:04+00:00",
"external_product_id": "8152798560562",
"external_variant_id": "44580987142450",
"price": "1.00",
"quantity": 6,
"updated_at": "2023-03-27T21:38:04+00:00"
}
]
}'The bundle_selections/:id endpoint requires the ID of the bundle selection to be updated. You can retrieve the ID by making a GET request to the /bundle_selections endpoint with the purchase_item_ids parameter set to the subscription ID, as shown in the previous example.
Updated 4 months ago
