Build-a-Box & Bundles
Update subscription bundling configuration
Updates the configuration for one or more subscription bundles (Build-a-Box). This endpoint allows bulk updates to bundle product selections, quantities, and configurations.
Subscription Bundling/Build-a-Box: Subscription bundling allows customers to create custom product bundles that are delivered on a recurring basis. Customers can select multiple products to be included in each delivery, creating a personalized subscription box.
Update Capabilities:
- Modify product selections within a bundle
- Update product quantities
- Change bundle configuration settings
- Bulk update multiple bundles at once
Use Cases:
- Customer updates their bundle product selections
- Swap products in an existing bundle
- Adjust quantities for products in the bundle
- Programmatically manage bundle configurations
Important Notes:
- Updates are identified by bundle handle (unique identifier)
- Only active bundles can be updated
- Product availability is validated before update
Authentication: Requires valid X-API-Key header
PUT
/
api
/
external
/
v2
/
subscription-bundling
/
update
Update subscription bundling configuration
curl --request PUT \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update \
--header 'Content-Type: application/json' \
--data '
[
{
"babHandle": "<string>",
"sourceProducts": [
{
"addSubProductIds": [
123
],
"addSubVariantIds": [
123
],
"deleteSubProductIds": [
123
],
"deleteSubVariantIds": [
123
],
"sourceProductId": 123
}
]
}
]
'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update"
payload = [
{
"babHandle": "<string>",
"sourceProducts": [
{
"addSubProductIds": [123],
"addSubVariantIds": [123],
"deleteSubProductIds": [123],
"deleteSubVariantIds": [123],
"sourceProductId": 123
}
]
}
]
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
babHandle: '<string>',
sourceProducts: [
{
addSubProductIds: [123],
addSubVariantIds: [123],
deleteSubProductIds: [123],
deleteSubVariantIds: [123],
sourceProductId: 123
}
]
}
])
};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update';
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
babHandle: '<string>',
sourceProducts: [
{
addSubProductIds: [123],
addSubVariantIds: [123],
deleteSubProductIds: [123],
deleteSubVariantIds: [123],
sourceProductId: 123
}
]
}
])
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'babHandle' => '<string>',
'sourceProducts' => [
[
'addSubProductIds' => [
123
],
'addSubVariantIds' => [
123
],
'deleteSubProductIds' => [
123
],
'deleteSubVariantIds' => [
123
],
'sourceProductId' => 123
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update"
payload := strings.NewReader("[\n {\n \"babHandle\": \"<string>\",\n \"sourceProducts\": [\n {\n \"addSubProductIds\": [\n 123\n ],\n \"addSubVariantIds\": [\n 123\n ],\n \"deleteSubProductIds\": [\n 123\n ],\n \"deleteSubVariantIds\": [\n 123\n ],\n \"sourceProductId\": 123\n }\n ]\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"babHandle\": \"<string>\",\n \"sourceProducts\": [\n {\n \"addSubProductIds\": [\n 123\n ],\n \"addSubVariantIds\": [\n 123\n ],\n \"deleteSubProductIds\": [\n 123\n ],\n \"deleteSubVariantIds\": [\n 123\n ],\n \"sourceProductId\": 123\n }\n ]\n }\n]"
response = http.request(request)
puts response.read_body{
"active": true,
"bundleHandle": "custom-coffee-bundle-123",
"bundleName": "My Custom Coffee Bundle",
"frequency": "MONTH",
"frequencyCount": 1,
"id": 12345,
"products": [
{
"productTitle": "Medium Roast Coffee",
"quantity": 2,
"variantId": 11111
},
{
"productTitle": "Dark Roast Coffee",
"quantity": 1,
"variantId": 22222
}
],
"shop": "example-shop.myshopify.com",
"token": "abc123xyz"
}{
"detail": "One or more products in the bundle are not available",
"status": 400,
"title": "Invalid bundle configuration",
"type": "https://example.com/errors/bad-request"
}{
"shop": "<string>",
"allowOneTimePurchase": true,
"appliesOn": "PRODUCT",
"buildABoxType": "CLASSIC",
"bundleBottomHtml": "<string>",
"bundleRedirect": "CART",
"bundleTopHtml": "<string>",
"chooseProductsText": "<string>",
"collectionData": "<string>",
"customRedirectURL": "<string>",
"discount": 123,
"discountedVariants": "<string>",
"groupName": "<string>",
"id": 123,
"inventoryTrackingMode": "ADD_CHILD_PRODUCT_ON_ORDER",
"maxProductCount": 123,
"minOrderAmount": 123,
"minProductCount": 123,
"minUniqueProductCheck": true,
"name": "<string>",
"proceedToCheckoutButtonText": "<string>",
"productDiscountType": "SELECTED_PRODUCT",
"productSelectionType": "PRODUCT",
"productViewStyle": "QUICK_ADD",
"sections": "<string>",
"selectionType": "FIXED",
"sellingPlanIds": "<string>",
"singleProductSettings": "<string>",
"subscriptionBundleLink": "<string>",
"subscriptionBundlingEnabled": true,
"subscriptionGroup": "<string>",
"subscriptionId": 123,
"thirdPartyRule": true,
"tieredDiscount": "<string>",
"trackInventory": true,
"uniqueRef": "<string>",
"variants": "<string>"
}{
"shop": "<string>",
"allowOneTimePurchase": true,
"appliesOn": "PRODUCT",
"buildABoxType": "CLASSIC",
"bundleBottomHtml": "<string>",
"bundleRedirect": "CART",
"bundleTopHtml": "<string>",
"chooseProductsText": "<string>",
"collectionData": "<string>",
"customRedirectURL": "<string>",
"discount": 123,
"discountedVariants": "<string>",
"groupName": "<string>",
"id": 123,
"inventoryTrackingMode": "ADD_CHILD_PRODUCT_ON_ORDER",
"maxProductCount": 123,
"minOrderAmount": 123,
"minProductCount": 123,
"minUniqueProductCheck": true,
"name": "<string>",
"proceedToCheckoutButtonText": "<string>",
"productDiscountType": "SELECTED_PRODUCT",
"productSelectionType": "PRODUCT",
"productViewStyle": "QUICK_ADD",
"sections": "<string>",
"selectionType": "FIXED",
"sellingPlanIds": "<string>",
"singleProductSettings": "<string>",
"subscriptionBundleLink": "<string>",
"subscriptionBundlingEnabled": true,
"subscriptionGroup": "<string>",
"subscriptionId": 123,
"thirdPartyRule": true,
"tieredDiscount": "<string>",
"trackInventory": true,
"uniqueRef": "<string>",
"variants": "<string>"
}{
"detail": "No bundle found with the specified handle",
"status": 404,
"title": "Bundle not found",
"type": "https://example.com/errors/not-found"
}Headers
Response
Subscription bundling successfully updated
Available options:
PRODUCT, COLLECTION, BOTH, ONE_TIME, SUBSCRIPTION Available options:
CLASSIC, SINGLE_PRODUCT, MIX_AND_MATCH, INFINITE, CUSTOMIZE_BUNDLE, CLASSIC_BUILD_A_BOX, SINGLE_PRODUCT_BUILD_A_BOX, VOLUME_DISCOUNT, DISCOUNTED_PRICING, SHIPPING_DISCOUNT, BUY_X_GET_Y, SECTIONED_BUNDLE Available options:
CART, CHECKOUT, CUSTOM, NONE Available options:
ADD_CHILD_PRODUCT_ON_ORDER, ADD_CHILD_PRODUCT_ON_CHECKOUT Available options:
SELECTED_PRODUCT, EACH_PRODUCT Available options:
PRODUCT, COLLECTION Available options:
QUICK_ADD, VIEW_DETAILS Available options:
FIXED, FLEXIBLE ⌘I
Update subscription bundling configuration
curl --request PUT \
--url https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update \
--header 'Content-Type: application/json' \
--data '
[
{
"babHandle": "<string>",
"sourceProducts": [
{
"addSubProductIds": [
123
],
"addSubVariantIds": [
123
],
"deleteSubProductIds": [
123
],
"deleteSubVariantIds": [
123
],
"sourceProductId": 123
}
]
}
]
'import requests
url = "https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update"
payload = [
{
"babHandle": "<string>",
"sourceProducts": [
{
"addSubProductIds": [123],
"addSubVariantIds": [123],
"deleteSubProductIds": [123],
"deleteSubVariantIds": [123],
"sourceProductId": 123
}
]
}
]
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
babHandle: '<string>',
sourceProducts: [
{
addSubProductIds: [123],
addSubVariantIds: [123],
deleteSubProductIds: [123],
deleteSubVariantIds: [123],
sourceProductId: 123
}
]
}
])
};
fetch('https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update';
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
babHandle: '<string>',
sourceProducts: [
{
addSubProductIds: [123],
addSubVariantIds: [123],
deleteSubProductIds: [123],
deleteSubVariantIds: [123],
sourceProductId: 123
}
]
}
])
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'babHandle' => '<string>',
'sourceProducts' => [
[
'addSubProductIds' => [
123
],
'addSubVariantIds' => [
123
],
'deleteSubProductIds' => [
123
],
'deleteSubVariantIds' => [
123
],
'sourceProductId' => 123
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update"
payload := strings.NewReader("[\n {\n \"babHandle\": \"<string>\",\n \"sourceProducts\": [\n {\n \"addSubProductIds\": [\n 123\n ],\n \"addSubVariantIds\": [\n 123\n ],\n \"deleteSubProductIds\": [\n 123\n ],\n \"deleteSubVariantIds\": [\n 123\n ],\n \"sourceProductId\": 123\n }\n ]\n }\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://subscription-admin.appstle.com/api/external/v2/subscription-bundling/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"babHandle\": \"<string>\",\n \"sourceProducts\": [\n {\n \"addSubProductIds\": [\n 123\n ],\n \"addSubVariantIds\": [\n 123\n ],\n \"deleteSubProductIds\": [\n 123\n ],\n \"deleteSubVariantIds\": [\n 123\n ],\n \"sourceProductId\": 123\n }\n ]\n }\n]"
response = http.request(request)
puts response.read_body{
"active": true,
"bundleHandle": "custom-coffee-bundle-123",
"bundleName": "My Custom Coffee Bundle",
"frequency": "MONTH",
"frequencyCount": 1,
"id": 12345,
"products": [
{
"productTitle": "Medium Roast Coffee",
"quantity": 2,
"variantId": 11111
},
{
"productTitle": "Dark Roast Coffee",
"quantity": 1,
"variantId": 22222
}
],
"shop": "example-shop.myshopify.com",
"token": "abc123xyz"
}{
"detail": "One or more products in the bundle are not available",
"status": 400,
"title": "Invalid bundle configuration",
"type": "https://example.com/errors/bad-request"
}{
"shop": "<string>",
"allowOneTimePurchase": true,
"appliesOn": "PRODUCT",
"buildABoxType": "CLASSIC",
"bundleBottomHtml": "<string>",
"bundleRedirect": "CART",
"bundleTopHtml": "<string>",
"chooseProductsText": "<string>",
"collectionData": "<string>",
"customRedirectURL": "<string>",
"discount": 123,
"discountedVariants": "<string>",
"groupName": "<string>",
"id": 123,
"inventoryTrackingMode": "ADD_CHILD_PRODUCT_ON_ORDER",
"maxProductCount": 123,
"minOrderAmount": 123,
"minProductCount": 123,
"minUniqueProductCheck": true,
"name": "<string>",
"proceedToCheckoutButtonText": "<string>",
"productDiscountType": "SELECTED_PRODUCT",
"productSelectionType": "PRODUCT",
"productViewStyle": "QUICK_ADD",
"sections": "<string>",
"selectionType": "FIXED",
"sellingPlanIds": "<string>",
"singleProductSettings": "<string>",
"subscriptionBundleLink": "<string>",
"subscriptionBundlingEnabled": true,
"subscriptionGroup": "<string>",
"subscriptionId": 123,
"thirdPartyRule": true,
"tieredDiscount": "<string>",
"trackInventory": true,
"uniqueRef": "<string>",
"variants": "<string>"
}{
"shop": "<string>",
"allowOneTimePurchase": true,
"appliesOn": "PRODUCT",
"buildABoxType": "CLASSIC",
"bundleBottomHtml": "<string>",
"bundleRedirect": "CART",
"bundleTopHtml": "<string>",
"chooseProductsText": "<string>",
"collectionData": "<string>",
"customRedirectURL": "<string>",
"discount": 123,
"discountedVariants": "<string>",
"groupName": "<string>",
"id": 123,
"inventoryTrackingMode": "ADD_CHILD_PRODUCT_ON_ORDER",
"maxProductCount": 123,
"minOrderAmount": 123,
"minProductCount": 123,
"minUniqueProductCheck": true,
"name": "<string>",
"proceedToCheckoutButtonText": "<string>",
"productDiscountType": "SELECTED_PRODUCT",
"productSelectionType": "PRODUCT",
"productViewStyle": "QUICK_ADD",
"sections": "<string>",
"selectionType": "FIXED",
"sellingPlanIds": "<string>",
"singleProductSettings": "<string>",
"subscriptionBundleLink": "<string>",
"subscriptionBundlingEnabled": true,
"subscriptionGroup": "<string>",
"subscriptionId": 123,
"thirdPartyRule": true,
"tieredDiscount": "<string>",
"trackInventory": true,
"uniqueRef": "<string>",
"variants": "<string>"
}{
"detail": "No bundle found with the specified handle",
"status": 404,
"title": "Bundle not found",
"type": "https://example.com/errors/not-found"
}