Skip to main content
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,
"bundleBottomHtml": "<string>",
"bundleTopHtml": "<string>",
"chooseProductsText": "<string>",
"collectionData": "<string>",
"customRedirectURL": "<string>",
"discount": 123,
"discountedVariants": "<string>",
"groupName": "<string>",
"id": 123,
"maxProductCount": 123,
"minOrderAmount": 123,
"minProductCount": 123,
"minUniqueProductCheck": true,
"name": "<string>",
"proceedToCheckoutButtonText": "<string>",
"sections": "<string>",
"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,
"bundleBottomHtml": "<string>",
"bundleTopHtml": "<string>",
"chooseProductsText": "<string>",
"collectionData": "<string>",
"customRedirectURL": "<string>",
"discount": 123,
"discountedVariants": "<string>",
"groupName": "<string>",
"id": 123,
"maxProductCount": 123,
"minOrderAmount": 123,
"minProductCount": 123,
"minUniqueProductCheck": true,
"name": "<string>",
"proceedToCheckoutButtonText": "<string>",
"sections": "<string>",
"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

X-API-Key
string

Body

application/json
babHandle
string
sourceProducts
object[]

Response

Subscription bundling successfully updated

shop
string
required
allowOneTimePurchase
boolean
appliesOn
enum<string>
Available options:
PRODUCT,
COLLECTION,
BOTH,
ONE_TIME,
SUBSCRIPTION
buildABoxType
enum<string>
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
bundleBottomHtml
string
bundleRedirect
enum<string>
Available options:
CART,
CHECKOUT,
CUSTOM,
NONE
bundleTopHtml
string
chooseProductsText
string
collectionData
string
customRedirectURL
string
discount
number<double>
discountedVariants
string
groupName
string
id
integer<int64>
maxProductCount
integer<int32>
minOrderAmount
number<double>
minProductCount
integer<int32>
minUniqueProductCheck
boolean
name
string
proceedToCheckoutButtonText
string
productDiscountType
enum<string>
Available options:
SELECTED_PRODUCT,
EACH_PRODUCT
productSelectionType
enum<string>
Available options:
PRODUCT,
COLLECTION
productViewStyle
enum<string>
Available options:
QUICK_ADD,
VIEW_DETAILS
sections
string
selectionType
enum<string>
Available options:
FIXED,
FLEXIBLE
sellingPlanIds
string
singleProductSettings
string
subscriptionBundlingEnabled
boolean
subscriptionGroup
string
subscriptionId
integer<int64>
thirdPartyRule
boolean
tieredDiscount
string
trackInventory
boolean
uniqueRef
string
variants
string