API ReferenceCommerce

Carts

Carts and their items, discount codes and messages, open to visitors with no credentials.

Carts in Postman

About carts

A cart is a record, not session data, so it can be restored from a link and merged into an account at sign-in. Every route but the list is open to visitors, with no credentials and no CSRF token. Each has two forms: with the cart’s uuid, /cdna-api/cart/{uuid}/…, for a headless client, and without it, for the visitor’s current cart, found from the cart cookie, which the response sets.

A cart is saved only once something is added: adding an item without a uuid creates it, and its uuid is in the response. Every response returns the whole cart under data.cart. A business failure, such as an unknown SKU or code, is not an HTTP error: the answer is 200, with the reason in data.cart.messages.

Access Visitors

Open with no credentials and no CSRF token; only the list needs an admin user.

The cart
Identified by uuid or cookie

A uuid in the path, or the visitor’s cart cookie.

The cart
Failures In messages

An unknown SKU or code answers 200 with an error in data.cart.messages.

The cart

List carts#

GET /cdna-api/cart/carts

Lists carts. Admin users only, unlike every other cart route. Without limit every match comes back.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Cart, in the Reference

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,uuid,total}.
filtersquery
name=value
Any stored field, or a relation with a dot, such as parent.id=12. Prefix the name with !, >, <, % or |. Use stored field names exactly as in the model, and compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List carts
GET /cdna-api/cart/carts?limit=2&properties={id,uuid,total} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 5,
  "data": [
    {
      "id": 1,
      "uuid": "05245d57-8b72-4522-841f-b6e022f85a87",
      "total": "0.0000"
    },
    {
      "id": 2,
      "uuid": "38f24f3f-4258-4e5e-b7ef-2a7d2e9cd488",
      "total": "0.0000"
    }
  ]
}
Open in Postman docs Real response from this documentation site

Add an item to the current cart#

POST /cdna-api/cart/item/{sku}

Adds a product or variant, by its SKU, to the visitor’s current cart, and creates that cart if there is none: this is how a cart comes into being. The response sets the cart cookie and holds the new cart’s uuid.

Access
Anyone. The route takes no credentials, by design.
Returns
The whole cart under data.cart, with an info message for the item added.

Parameters

skupathrequired
string
The product’s or variant’s SKU, its code.
quantitybody
integer
How many; 1 when left out.
attributesbody
object
Choices recorded on the item, such as an engraving, as names and scalar values.
currencybody
string
The cart’s currency, as a three-letter code.

Example

Add an item to the current cart
POST /cdna-api/cart/item/API-SANDBOX-MUG HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Content-Type: application/json

{
  "quantity": 2
}
Response 200 OK
{
  "result": "success",
  "data": {
    "cart": {
      "id": 5,
      "uuid": "f6b4ec7c-8192-43ca-9327-1ba9add89fe3",
      "discountCodes": [],
      "appliedDiscounts": [],
      "total": "24.00",
      "discountTotal": "0",
      "taxTotal": "0",
      "created": "2026-10-18T01:26:57+00:00",
      "modified": "2026-10-18T01:26:57+00:00",
      "currency": {
        "id": 142,
        "shortName": "USD",
        "symbol": "$",
        "symbolLocation": "left",
        "decimalPlaces": 2
      },
      "person": {
        "email": "person@example.com",
        "restricted": false
      },
      "messages": [
        {
          "status": "info",
          "text": "Item has been added",
          "data": {
            "item": {
              "id": null,
              "name": "API sandbox mug"
            }
          },
          "expiry": "2026-10-18T01:27:02+00:00",
          "item": 1
        }
      ],
      "items": [
        {
          "id": 1,
          "productCode": "API-SANDBOX-MUG",
          "name": "API sandbox mug",
          "available": true,
          "quantity": 2,
          "amount": "24.00",
          "tax": "0",
          "discount": "0",
          "attributes": [],
          "created": "2026-10-18T01:26:57+00:00",
          "modified": "2026-10-18T01:26:57+00:00"
        }
      ]
    }
  }
}
Open in Postman docs Real response from this documentation site

Add an item#

POST /cdna-api/cart/{uuid}/item/{sku}

Adds a product or variant to a cart by its SKU. An unknown or unpublished SKU, or one with no price in the cart’s currency, still answers 200: the item is missing and messages says why. Without the uuid, /cdna-api/cart/…, it acts on the visitor’s current cart.

Access
Anyone. The route takes no credentials, by design.
Returns
The whole cart under data.cart.

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.
skupathrequired
string
The product’s or variant’s SKU.
quantitybody
integer
How many; 1 when left out.
attributesbody
object
Choices recorded on the item, as names and scalar values.

Example

Add an item
POST /cdna-api/cart/f6b4ec7c-8192-43ca-9327-1ba9add89fe3/item/API-SANDBOX-MUG-BLUE HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Content-Type: application/json

{
  "quantity": 1
}
Response
{
  "result": "success",
  "data": {
    "cart": {
      "uuid": "f6b4ec7c-8192-43ca-9327-1ba9add89fe3",
      "total": "38.00",
      "messages": [
        {
          "status": "info",
          "text": "Item has been added",
          "data": {
            "item": {
              "id": null,
              "name": "API sandbox mug, blue"
            }
          },
          "expiry": "2026-10-18T01:27:13+00:00",
          "item": 2
        }
      ],
      "items": [
        {
          "id": 1,
          "productCode": "API-SANDBOX-MUG",
          "name": "API sandbox mug",
          "available": true,
          "quantity": 2,
          "amount": "24.0000",
          "tax": "0.0000",
          "discount": "0",
          "attributes": [],
          "created": "2026-10-18T01:26:57+00:00",
          "modified": "2026-10-18T01:27:08+00:00"
        },
        {
          "id": 2,
          "productCode": "API-SANDBOX-MUG-BLUE",
          "name": "API sandbox mug, blue",
          "available": true,
          "quantity": 1,
          "amount": "14.00",
          "tax": "0",
          "discount": "0",
          "attributes": [],
          "created": "2026-10-18T01:27:08+00:00",
          "modified": "2026-10-18T01:27:08+00:00"
        }
      ]
    }
  }
}
{
  "result": "success",
  "data": {
    "cart": {
      "uuid": "f6b4ec7c-8192-43ca-9327-1ba9add89fe3",
      "total": "50.0000",
      "messages": [
        {
          "status": "error",
          "text": "Item is not available",
          "data": {},
          "expiry": "2026-10-18T01:27:26+00:00",
          "item": null
        }
      ]
    }
  }
}
Open in Postman docs Real response from this documentation site, shortened

Change an item#

PUT /cdna-api/cart/{uuid}/item/{item.id}

Changes an item’s quantity and attributes. A quantity of 0 removes it. The path takes the cart item’s id, not the product’s. Without the uuid, /cdna-api/cart/…, it acts on the visitor’s current cart.

Access
Anyone. The route takes no credentials, by design.
Returns
The whole cart under data.cart.

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.
item.idpathrequired
integer
The cart item’s id.
quantitybody
integer
The new quantity; 0 removes the item.
attributesbody
object
The item’s attributes; send them every time, or they are cleared.

Example

Change an item
PUT /cdna-api/cart/f6b4ec7c-8192-43ca-9327-1ba9add89fe3/item/1 HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Content-Type: application/json

{
  "quantity": 3
}
Response 200 OK
{
  "result": "success",
  "data": {
    "cart": {
      "id": 5,
      "uuid": "f6b4ec7c-8192-43ca-9327-1ba9add89fe3",
      "discountCodes": [],
      "appliedDiscounts": [],
      "total": "50.00",
      "discountTotal": "0",
      "taxTotal": "0.0000",
      "created": "2026-10-18T01:26:57+00:00",
      "modified": "2026-10-18T01:27:09+00:00"
    }
  }
}
Open in Postman docs Real response from this documentation site, shortened

Remove an item#

DELETE /cdna-api/cart/{uuid}/item/{item.id}

Removes an item from a cart. Without the uuid, /cdna-api/cart/…, it acts on the visitor’s current cart.

Access
Anyone. The route takes no credentials, by design.
Returns
The whole cart under data.cart.

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.
item.idpathrequired
integer
The cart item’s id.

Example

Remove an item
DELETE /cdna-api/cart/3f8e5c2a-7b1d-4e9f-a6c0-5d2b8e1f4a97/item/4 HTTP/1.1
Host: hub.coredna.com
Accept: application/json

Show a cart#

GET /cdna-api/cart/{uuid}

Reads a cart. A cart that has not been saved yet answers 404. Without the uuid, /cdna-api/cart/…, it acts on the visitor’s current cart.

Access
Anyone. The route takes no credentials, by design.
Model
Cart, in the Reference

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.
propertiesquery
selector
The fields to return, under the cart key: {cart{uuid,total,items{id,productCode,quantity,amount}}}.

Example

Show a cart
GET /cdna-api/cart/f6b4ec7c-8192-43ca-9327-1ba9add89fe3?properties={cart{uuid,total,items{id,productCode,quantity,amount}}} HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "cart": {
      "uuid": "f6b4ec7c-8192-43ca-9327-1ba9add89fe3",
      "total": "44.0000",
      "items": [
        {
          "id": 1,
          "productCode": "API-SANDBOX-MUG",
          "quantity": 3,
          "amount": "30.0000"
        },
        {
          "id": 2,
          "productCode": "API-SANDBOX-MUG-BLUE",
          "quantity": 1,
          "amount": "14.0000"
        }
      ]
    }
  }
}
Open in Postman docs Real response from this documentation site

Start a cart#

POST /cdna-api/cart

Returns a new cart with a uuid, but does not save it or set the cookie, and the body is ignored. Until an item is added the uuid finds nothing, so start a cart with Add an item to the current cart instead.

Access
Anyone. The route takes no credentials, by design.
Returns
A new, unsaved cart under data.cart.

Example

Start a cart
POST /cdna-api/cart HTTP/1.1
Host: hub.coredna.com
Accept: application/json

Set the cart’s email#

PUT /cdna-api/cart/{uuid}

Records the shopper’s email on the cart, the only field this route changes. An address that belongs to an account is refused unless it is the signed-in caller’s own. Without the uuid, /cdna-api/cart/…, it acts on the visitor’s current cart.

Access
Anyone. The route takes no credentials, by design.
Returns
The cart under data.cart.

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.
personbodyrequired
object
{"email": …}.

Example

Set the cart’s email
PUT /cdna-api/cart/3f8e5c2a-7b1d-4e9f-a6c0-5d2b8e1f4a97 HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Content-Type: application/json

{
  "person": {
    "email": "alex@example.com"
  }
}

Evaluate a cart#

PUT /cdna-api/cart/{uuid}/evaluate

Prices the cart again: availability, prices, discounts and tax, as they are now. There is no body. Without the uuid, /cdna-api/cart/…, it acts on the visitor’s current cart.

Access
Anyone. The route takes no credentials, by design.
Returns
The whole cart under data.cart.

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.

Example

Evaluate a cart
PUT /cdna-api/cart/f6b4ec7c-8192-43ca-9327-1ba9add89fe3/evaluate HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "cart": {
      "id": 5,
      "uuid": "f6b4ec7c-8192-43ca-9327-1ba9add89fe3",
      "discountCodes": [],
      "appliedDiscounts": [],
      "total": "50.0000",
      "discountTotal": "0",
      "taxTotal": "0.0000",
      "created": "2026-10-18T01:26:57+00:00",
      "modified": "2026-10-18T01:27:10+00:00"
    }
  }
}
Open in Postman docs Real response from this documentation site, shortened

Apply a discount code#

POST /cdna-api/cart/{uuid}/discount/{code}

Applies a discount code, given in the path. A code that does not exist, or does not apply, answers 200 with an error in messages, as here. Without the uuid, /cdna-api/cart/…, it acts on the visitor’s current cart.

Access
Anyone. The route takes no credentials, by design.
Returns
The whole cart under data.cart.

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.
codepathrequired
string
The discount code.

Example

Apply a discount code
POST /cdna-api/cart/f6b4ec7c-8192-43ca-9327-1ba9add89fe3/discount/SAVE10 HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Response 200 OKUnknown code
{
  "result": "success",
  "data": {
    "cart": {
      "uuid": "f6b4ec7c-8192-43ca-9327-1ba9add89fe3",
      "total": "50.0000",
      "discountCodes": [],
      "appliedDiscounts": [],
      "messages": [
        {
          "status": "error",
          "text": "Code is not found",
          "data": {},
          "expiry": "2026-10-18T01:27:38+00:00",
          "item": null
        }
      ]
    }
  }
}
Open in Postman docs Real response from this documentation site, shortened

Remove a discount code#

DELETE /cdna-api/cart/{uuid}/discount/{code}

Removes a discount code from a cart. Without the uuid, /cdna-api/cart/…, it acts on the visitor’s current cart.

Access
Anyone. The route takes no credentials, by design.
Returns
The whole cart under data.cart.

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.
codepathrequired
string
The discount code.

Example

Remove a discount code
DELETE /cdna-api/cart/3f8e5c2a-7b1d-4e9f-a6c0-5d2b8e1f4a97/discount/SAVE10 HTTP/1.1
Host: hub.coredna.com
Accept: application/json

Dismiss a message#

DELETE /cdna-api/cart/{uuid}/message/{message.id}

Removes a message from a cart, once it has been shown. Without the uuid, /cdna-api/cart/…, it acts on the visitor’s current cart.

Access
Anyone. The route takes no credentials, by design.
Returns
The whole cart under data.cart.

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.
message.idpathrequired
integer
The message’s id.

Example

Dismiss a message
DELETE /cdna-api/cart/3f8e5c2a-7b1d-4e9f-a6c0-5d2b8e1f4a97/message/3 HTTP/1.1
Host: hub.coredna.com
Accept: application/json

Empty a cart#

PUT /cdna-api/cart/{uuid}/clear

Removes every item and keeps the cart. Without the uuid, /cdna-api/cart/…, it acts on the visitor’s current cart.

Access
Anyone. The route takes no credentials, by design.
Returns
The emptied cart under data.cart.

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.

Example

Empty a cart
PUT /cdna-api/cart/3f8e5c2a-7b1d-4e9f-a6c0-5d2b8e1f4a97/clear HTTP/1.1
Host: hub.coredna.com
Accept: application/json

Delete a cart#

DELETE /cdna-api/cart/{uuid}

Deletes a cart and its items. Only with a uuid: there is no current-cart form.

Access
Anyone. The route takes no credentials, by design.

Parameters

uuidpathrequired
string
The cart’s uuid, from any cart response.

Example

Delete a cart
DELETE /cdna-api/cart/3f8e5c2a-7b1d-4e9f-a6c0-5d2b8e1f4a97 HTTP/1.1
Host: hub.coredna.com
Accept: application/json