Skip to main content
PUT
/
api
/
external
/
v2
/
build-a-box
Update an existing Build-A-Box subscription bundle
curl --request PUT \
  --url https://subscription-admin.appstle.com/api/external/v2/build-a-box \
  --header 'Content-Type: application/json' \
  --data '
{
  "shop": "<string>"
}
'
import requests

url = "https://subscription-admin.appstle.com/api/external/v2/build-a-box"

payload = { "shop": "<string>" }
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({shop: '<string>'})
};

fetch('https://subscription-admin.appstle.com/api/external/v2/build-a-box', 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/build-a-box';
const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({shop: '<string>'})
};

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/build-a-box",
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([
'shop' => '<string>'
]),
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/build-a-box"

payload := strings.NewReader("{\n \"shop\": \"<string>\"\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/build-a-box")

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 \"shop\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "active": true,
  "allowOneTimePurchase": true,
  "availableProducts": [
    {
      "price": "14.99",
      "productId": 111111,
      "title": "Medium Roast Coffee - 12oz",
      "variantId": 222222
    },
    {
      "price": "15.99",
      "productId": 111111,
      "title": "Dark Roast Coffee - 12oz",
      "variantId": 333333
    },
    {
      "price": "16.99",
      "productId": 111111,
      "title": "Espresso Roast Coffee - 12oz",
      "variantId": 444444
    }
  ],
  "buildABoxType": "SINGLE_PRODUCT",
  "buildBoxVersion": "V2",
  "bundleHandle": "premium-coffee-selection",
  "bundleName": "Premium Coffee Selection - Updated",
  "createdAt": "2024-03-15T10:30:00Z",
  "description": "Choose from our expanded selection of artisan coffee blends",
  "discount": 15,
  "discountType": "PERCENTAGE",
  "frequencies": [
    {
      "displayName": "Monthly",
      "interval": "MONTH",
      "intervalCount": 1
    },
    {
      "displayName": "Bi-Weekly",
      "interval": "WEEK",
      "intervalCount": 2
    }
  ],
  "id": 45678,
  "maxProductCount": 6,
  "minProductCount": 3,
  "pricingType": "PER_PRODUCT",
  "shop": "example-shop.myshopify.com",
  "uniqueRef": "bab_abc123xyz",
  "updatedAt": "2024-03-20T14:45:00Z"
}

Headers

X-API-Key
string

Query Parameters

api_key
string

API Key (Deprecated - Use Header X-API-Key instead)

Body

application/json
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

Response

Build-A-Box subscription bundle 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