Cart Service Tutorials

How to create a new cart

To create a new cart, you need to send a request to the Creating a new cart endpoint.
Loading...

How to add custom attributes to a cart

You can define custom attributes for a cart through mixins.

Define your custom attributes schema

First, define your custom attributes schema in the form of a JSON schema.

Copy
Copied
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
      "cartInstructions": {
        "type": "object",
        "properties": {
          "instruction": {
            "type": "string"
          }
        }
      }
    }
}

Upload your schema to a hosting service and save its URL

Update a cart with custom attributes

To add custom attributes to a cart, you need to send a request to the Updating a cart endpoint.
Loading...

How to merge carts

info

To learn more about merging carts, check out Cart merging in the Carts guide.

To merge an anomyous cart with a customer cart, you need to send a request to the Merging carts endpoint. Provide the customer cart's ID in the cartId path parameter and the anonymous cart's ID in the request body.
Loading...