Build-a-Box & Bundles
Retrieve a Build-A-Box bundle by ID
Reads a Build-A-Box by its numeric id, the id that POST /api/external/v2/build-a-box returns. The response is the box itself: the fields of bundle in the by-handle response, plus groupName and subscriptionBundleLink. subscriptionBundleLink is the link to the box page while the box is on, and null while it is off. groupName is always null in this response. To change the box, edit the fields you need and send the whole response to PUT /api/external/v2/build-a-box.
Behavior:
- The call also reads a box that is off.
GET /api/external/v2/build-a-box/{handle}answers404for such a box. - An
idthat isn’t one of your boxes answers404. - A value made only of digits is read as an
id, and any other value as auniqueRef. Read a box whoseuniqueRefis only digits by itsid.
Authentication: Requires a valid X-API-Key header.
GET
/
api
/
external
/
v2
/
build-a-box
/
{id}
Retrieve a Build-A-Box bundle by ID
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/build-a-box/{id}import requests
url = "https://subscription-admin.appstle.com/api/external/v2/build-a-box/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://subscription-admin.appstle.com/api/external/v2/build-a-box/{id}', 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/{id}';
const options = {method: 'GET'};
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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/build-a-box/{id}"
req, _ := http.NewRequest("GET", url, nil)
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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"buildABoxType": "SINGLE_PRODUCT",
"bundleRedirect": "CART",
"groupName": null,
"id": 21116,
"name": "Roasters choice box",
"shop": "your-store.myshopify.com",
"singleProductSettings": "[{\"sourceProduct\":{\"id\":15386745176368,\"title\":\"Ethiopia Coffee\",\"handle\":\"ethiopia-coffee\"},\"minQuantity\":\"1\",\"maxQuantity\":\"4\",\"products\":[{\"id\":15386745078064,\"type\":\"PRODUCT\",\"title\":\"Colombia Coffee\",\"productHandle\":\"colombia-coffee\"}]}]",
"subscriptionBundleLink": null,
"subscriptionBundlingEnabled": false,
"subscriptionId": 80297427248,
"uniqueRef": "7cnkdqwi"
}Response
The box. Every field is in the response, with null where the box has no value. The example shows only some of them.
⌘I
Retrieve a Build-A-Box bundle by ID
curl --request GET \
--url https://subscription-admin.appstle.com/api/external/v2/build-a-box/{id}import requests
url = "https://subscription-admin.appstle.com/api/external/v2/build-a-box/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://subscription-admin.appstle.com/api/external/v2/build-a-box/{id}', 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/{id}';
const options = {method: 'GET'};
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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://subscription-admin.appstle.com/api/external/v2/build-a-box/{id}"
req, _ := http.NewRequest("GET", url, nil)
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/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"buildABoxType": "SINGLE_PRODUCT",
"bundleRedirect": "CART",
"groupName": null,
"id": 21116,
"name": "Roasters choice box",
"shop": "your-store.myshopify.com",
"singleProductSettings": "[{\"sourceProduct\":{\"id\":15386745176368,\"title\":\"Ethiopia Coffee\",\"handle\":\"ethiopia-coffee\"},\"minQuantity\":\"1\",\"maxQuantity\":\"4\",\"products\":[{\"id\":15386745078064,\"type\":\"PRODUCT\",\"title\":\"Colombia Coffee\",\"productHandle\":\"colombia-coffee\"}]}]",
"subscriptionBundleLink": null,
"subscriptionBundlingEnabled": false,
"subscriptionId": 80297427248,
"uniqueRef": "7cnkdqwi"
}