This guide explains how to use the Skio Static Build-a-Box feature with a custom frontend flow via API, rather than using Skio's default Build-a-Box interface.
For documentation on the standard Static Build-a-Box setup, see: Static Build-a-Box setup guide.
This guide involves custom coding and API integration. Developer experience is required to implement this solution.
Fetching Static Build-a-Box data from the API
Endpoint: https://api.skio.com/storefront-http/get-classic-box-v2
Send a POST request with a JSON body like the example below:
{
"productVariantPlatformId": "7194276266047",
"sellingPlanPlatformId": "878510112"
}The
sellingPlanPlatformIdparameter is optional and can beundefined.
Example function for fetching Static Build a Box data
const fetchClassicBoxV2Information = async(boxParentProductId, sellingPlanId) => {
return new Promise((resolve, reject) => {
fetch('https://api.skio.com/storefront-http/get-classic-box-v2',
{
method: 'POST',
body: JSON.stringify(
{
'productVariantPlatformId': boxParentProductId,
'sellingPlanPlatformId': sellingPlanId
}
)
}).then(
(response) => response.json()
).then(
(response) => {
if(!response.ok) throw new Error('Failed to get box');
const { ClassicBoxV2 } = response;
resolve(ClassicBoxV2);
}
).catch((error) => {
console.error(error);
reject(error);
})
});
}Data structure of the endpoint response
{
platformId: string;
size: number;
title: string;
price: number;
sellingPlan?: string;
currencyCode: string;
imageSrc: string;
selectableProductVariants: SelectableProductVariantDisplay[];
}
SelectableProductVariantDisplay = {
platformId: string;
quantity: number;
productTitle: string;
productVariantTitle: string;
imageSrc: string;
price: number;
};
Note:
selectableProductVariantsonly lists selectable items for Customizable boxes. For a Preset box, an emptyselectableProductVariantslist is expected.
How do I add a Preset box to the cart?
For a Preset box, add only the box variant to the cart with the _isClassicBoxV2: true line item property. Skio handles everything else when the order is processed.
Line item properties: Send
_isClassicBoxV2: trueand nothing else. Don't send_pvgidentries or_presetBoxVersion. Skio ignores_pvgidfor Preset boxes and sets_presetBoxVersionautomatically.Subscriptions: If the box is sold as a subscription, include its
selling_planID.Child items: After checkout, Skio adds the $0 child items from the preset you configured. You don't need to add them to the cart.
Example /cart/add item
{
"id": <boxVariantId>,
"quantity": 1,
"selling_plan": <sellingPlanId>,
"properties": {
"_isClassicBoxV2": true
}
}Building your custom flow and passing customer selections through checkout
As the third-party developer, you'll need to implement the user experience for selecting box items. Once the customer has made their selections, call the Shopify cart API to add the items with custom properties for each child item.
Example cart payload
{
"_pvgid://shopify/ProductVariant/44658179670306": 2,
"_pvgid://shopify/ProductVariant/44658179703074": 1,
"_pvgid://shopify/ProductVariant/44658179735842": 2
}This structure passes the customer's box selections through checkout with the proper quantities for each variant.
