Skip to main content
Tangiblee
 > 
Help Center
 > 
 > 
 > 
 > 

Multi-Cart Bundling Specification: Shopify

Shopify

If your storefront is located in Shopify, we’ll take the Ajax API. Below is information on how we’ll send requests and push the data into the cart. No action items are required for our clients on Shopify.

How it works

1. We’ll use the following API to retrieve product variants:

GET: <client.domain>/products/<product_handle>.js

(where product_handle is a product handle)

2. Then we push selected items into the cart:

POST: <client.domain>/cart/add.js

3. And finally pass the data in Request Body to the ATC endpoint:

items: [ 
{ 
quantity: 1, 
id: <variant ID> 
} 
]

References:

Fetch Variations API: Product API reference (shopify.dev)

Add-to-cart API: Cart API reference (shopify.dev)

Other Engines and Custom APIs

For non-SFCC and non-Shopify clients, we are happy to adapt to any custom APIs. If this is the case for your site, please provide the following:

Requirements

1. Provide API endpoint to fetch variations by product ID.

The example of data structure API should return (it should include a list of variations with prices, colors, sizes and stock availability):

type Variation = {
    id: string;
    name: string;
    price: number;
    available: boolean;
    options: {[key: string]: string|number};
};

type API_RESPONSE = {
    options: string[];
    items: Variation[];
};

const exampleEndpoint = () => {
    return {
        options: ['color', 'size'],
        items: [
            {id: 1, name: 'Ring X', price: 1000, available: true, options: {color: 'red', size: 'M'}},
            {id: 2, name: 'Ring X', price: 1000, available: true, options: {color: 'red', size: 'L'}},
            {id: 3, name: 'Ring X', price: 1000, available: true, options: {color: 'blue', size: 'M'}},
            {id: 4, name: 'Ring X', price: 1000, available: true, options: {color: 'blue', size: 'L'}},
        ]
    };
};

2. Provide API to add items into the cart by variant ID.

Related articles

Multi-cart Bundling Specifications for SFCC