Skip to main content

Cart API (3D Product Configurator)

Summary​

  1. Overview

  2. Cart API

    2.1 Preview image

    2.2 Configuration attributes

    2.3 Design

    2.4 Product price

    2.5 MOQ (Minimum Order Quantity)

  3. Edit configuration

1. Overview​

This API allows you to seamlessly integrate configured product information directly into your standard shopping cart page, enhancing user engagement and satisfaction. Here's what the Configurator Cart API brings to the table:

  • Configured Product Preview (A):​

    Provide users with a visual preview of each configured product directly within the shopping cart. This feature ensures that customers can see a detailed representation of their unique products, fostering clarity and minimizing any confusion between the standard and customized versions.

  • Updated Price (B):​

    Harness the flexibility of Zakeke's Configurator to assign prices to individual options, enabling the calculation of a final price based on the chosen customization. The Configurator Cart API ensures the accurate display of the updated product price in the shopping cart, reflecting the dynamic pricing determined by the combination of selected options.

  • Attributes and Options List (C):​

    Show a comprehensive list of attributes and options selected by the customers during the configuration process to create their own version of the product. This list is called "Composition" in Zakeke.

  • Edit Functionality (D):​

    Add an 'Edit' button for each customized product, redirecting buyers back to the Zakeke Configurator. This functionality enables users to make additional modifications before finalizing their purchase, ensuring a personalized and flexible shopping experience.

Integrate the Configurator Cart API effortlessly and transform your shopping cart into a dynamic and user-friendly space for personalized product exploration and customization.

add-to-cart

2. Cart API​

To enrich the display of the configured product in the cart, Zakeke provides a set of information which can be obtained via the following API call:

GET https://api.zakeke.com/v2/compositions/{compositionId}/cartinfo

See the Compositions API reference for the request and response fields.

The compositionId is the configuration identifier that the Zakeke iframe sends to the host page in the Configurator Add to cart message.

Pass the cart line quantity as the optional quantity query parameter. It must be a positive integer and defaults to 1. Zakeke uses it to select the applicable prices and returns a price per unit.

GET https://api.zakeke.com/v2/compositions/{compositionId}/cartinfo?quantity=4
warning

The API must be called server to server (S2S).

warning

To make the API call you need to authenticate in Zakeke and obtain an authorization token of S2S type. For all the details see the Authentication and Authorization section.

The API call returns a JSON object with the following structure:

{
"preview": "https://...",
"price": 19.99,
"currency": "EUR",
"items": [
{
"attributeCode": "{\"id\":\"242422342\",\"label\":\"Color\",\"zakekePlatform\":true}",
"attributeName": "Color",
"selectedOptionCode": "{\"id\":\"537564567\",\"label\":\"White\",\"zakekePlatform\":true}",
"selectedOptionName": "White"
}
],
"designID": "000-2vXWy19gyU6jK3Wamdpm6A",
"minQuantity": 50,
"quantityStep": 10,
"quantityPackages": null,
"quantityRuleType": "variant"
}

where:

PropertyData typeDescription
previewstringUrl to image preview of the configured product.
pricemoneyUnit price calculated by Zakeke for the requested quantity. See Product price.
currencystring or nullCurrency code of price when the sales channel supplies one, for example EUR.
itemsarrayThe list of attributes and respective chosen option.
designIDstringThe optional designID associated to the composition.
minQuantitynumber | nullThe minimum quantity required for this cart line. null when no MOQ rule is configured.
quantityStepnumber | nullThe fixed quantity increment. null when the rule does not use a fixed step.
quantityPackagesnumber[] | nullThe allowed predefined quantities. null when the rule does not use packages.
quantityRuleTypestring | nullAlways "variant" when a MOQ rule is configured for the configurator. The rule applies to the individual cart line. null when no MOQ rule is configured.

2.1 Previw image​

The preview property is the URL to the image preview of the configured product. Zakeke generates the preview image starting from a screenshot of the 3D model representing the configured product. You can set the angle of the screenshot by configuring a specific camera named "buy_screenshot_camera" in the Scene Editor section of the back office. For more information, please refer to this link.

2.2 Configuration attributes​

The items property contains the list of all the attributes of the configuration with the respective values selected by the user. Specifically, for each attribute the array will contain an object of the following type:

{
"attributeCode": "{\"id\":\"242422342\",\"label\":\"Color\",\"zakekePlatform\":true}",
"attributeName": "Color",
"selectedOptionCode": "{\"id\":\"537564567\",\"label\":\"White\",\"zakekePlatform\":true}",
"selectedOptionName": "White"
}

For attributes that are linked to attributes on the store, attributeCode and selectedOptionCode contain JSON strings with the zakekePlatform flag and the ID of the attribute or option in the ecommerce system.

2.3 Design​

What about the designID property? Zakeke offers a hybrid 3D product configuration and 2D design customization feature, seamlessly integrating both functionalities into a single user interface. This capability enables end users to configure products in a three-dimensional space, providing a realistic view of the product from various angles and perspectives. Simultaneously, it allows for the application of two-dimensional custom designs or personalizations directly onto the 3D model. Users can thus visualize how their custom designs, artworks or text overlays will appear on the product in real-time, offering a comprehensive and interactive customization experience. The designID property is the unique identifier of the customization created by the user.

2.4 Product price​

price is the amount per unit for the requested cart quantity. It includes the base price configured in Zakeke and the selected option prices when configurator pricing is enabled, plus any applicable design charge allocated across the units. If you leave the Zakeke base price at zero and manage the base price in your store, add price to the store's base unit price. If you set the base price in Zakeke, price already includes it.

Call the endpoint again when the cart quantity changes. The quantity can change the applicable pricing tier and how a one-time setup charge is spread across the units. For example, with a Zakeke base price of 10.00, selected options of 2.00 per unit, and a design setup charge of 6.00 for four units, price is 13.50 per unit. The line amount is 54.00 before any store taxes or discounts.

Sales channel pricing and currency​

Authenticate in the context of the sales channel where the customer is shopping. If the channel has a price override for a selected option, that price replaces the option's configured pricing, including any generic attribute price. An override of zero is valid. Options without an override use their configured pricing rules, including quantity tiers.

When sales channel pricing applies and the channel supplies a currency, Zakeke converts the price components as needed and returns that currency in currency. Use the amount as returned when your cart uses the same currency. If currency is null, Zakeke has not applied a channel currency conversion. Interpret price in the currency used to configure the prices in Zakeke. Apply your store's taxes and discounts as usual.

2.5 MOQ (Minimum Order Quantity)​

The minQuantity, quantityStep, quantityPackages and quantityRuleType properties expose the MOQ rule assigned to the product in the Zakeke back-office. These are top-level response properties, corresponding to the fields inside message.moqInfo in the configurator's Add to Cart message.

When the quantity of a configured product changes in the cart, call this API again with the new quantity to update both the price and the MOQ rule. Validate the quantity for each cart line independently:

  • The quantity must be at least minQuantity.
  • When quantityStep is set, valid quantities are minQuantity, minQuantity + quantityStep, minQuantity + 2 * quantityStep, and so on.
  • When quantityPackages is non-null and non-empty, the quantity must be one of the listed values.

Before registering the order, retrieve the current rule server to server and reject quantities that do not satisfy it. Do not combine quantities from different cart lines to satisfy the rule: quantityRuleType is always "variant" for the configurator.

When no MOQ rule is configured, all four properties are null. quantityPackages is also null when the rule does not use packages. These nullable properties extend the existing response without changing its other fields.

For activation and the Add to Cart payload, see MOQ (Minimum Order Quantity).

3 Edit configuration​

To allow the user to modify the configuration of a product, recall the page containing the Zakeke configurator IFrame, initialized as explained in Configurator UI API - IFrame configuration and making sure to set the compositionId property to the id relating to the configuration to be modified.