Shopify Storefront Cart

Schema for a Shopify cart as managed by the Storefront GraphQL API

CommerceE-CommerceHeadlessGraphQLStorefrontProductCartCheckout

Properties

Name Type Description
id string Global cart ID in gid://shopify/Cart/{token} format
checkoutUrl string URL to proceed to the Shopify-hosted checkout
totalQuantity integer Total number of items across all cart lines
createdAt string When the cart was created
updatedAt string When the cart was last updated
note stringnull A note that the buyer provides on the cart
attributes array Custom attributes for the cart
discountCodes array Discount codes applied to the cart
cost object The costs that the buyer will pay at checkout
lines object Items in the cart
View JSON Schema on GitHub

JSON Schema

shopify-storefront-cart-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://api-evangelist.github.io/shopify-storefront/json-schema/shopify-storefront-cart-schema.json",
  "title": "Shopify Storefront Cart",
  "description": "Schema for a Shopify cart as managed by the Storefront GraphQL API",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Global cart ID in gid://shopify/Cart/{token} format"
    },
    "checkoutUrl": {
      "type": "string",
      "format": "uri",
      "description": "URL to proceed to the Shopify-hosted checkout"
    },
    "totalQuantity": {
      "type": "integer",
      "description": "Total number of items across all cart lines"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the cart was created"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the cart was last updated"
    },
    "note": {
      "type": ["string", "null"],
      "description": "A note that the buyer provides on the cart"
    },
    "attributes": {
      "type": "array",
      "description": "Custom attributes for the cart",
      "items": {
        "type": "object",
        "properties": {
          "key": { "type": "string" },
          "value": { "type": "string" }
        }
      }
    },
    "discountCodes": {
      "type": "array",
      "description": "Discount codes applied to the cart",
      "items": {
        "type": "object",
        "properties": {
          "code": { "type": "string" },
          "applicable": { "type": "boolean" }
        }
      }
    },
    "cost": {
      "type": "object",
      "description": "The costs that the buyer will pay at checkout",
      "properties": {
        "totalAmount": {
          "type": "object",
          "properties": {
            "amount": { "type": "string" },
            "currencyCode": { "type": "string" }
          }
        },
        "subtotalAmount": {
          "type": "object",
          "properties": {
            "amount": { "type": "string" },
            "currencyCode": { "type": "string" }
          }
        },
        "totalTaxAmount": {
          "type": ["object", "null"],
          "properties": {
            "amount": { "type": "string" },
            "currencyCode": { "type": "string" }
          }
        },
        "totalDutyAmount": {
          "type": ["object", "null"],
          "properties": {
            "amount": { "type": "string" },
            "currencyCode": { "type": "string" }
          }
        }
      }
    },
    "lines": {
      "type": "object",
      "description": "Items in the cart",
      "properties": {
        "edges": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "node": {
                "type": "object",
                "description": "A cart line item",
                "properties": {
                  "id": { "type": "string" },
                  "quantity": { "type": "integer" },
                  "merchandise": {
                    "type": "object",
                    "description": "The product variant",
                    "properties": {
                      "id": { "type": "string" },
                      "title": { "type": "string" },
                      "price": {
                        "type": "object",
                        "properties": {
                          "amount": { "type": "string" },
                          "currencyCode": { "type": "string" }
                        }
                      },
                      "product": {
                        "type": "object",
                        "properties": {
                          "id": { "type": "string" },
                          "title": { "type": "string" },
                          "handle": { "type": "string" }
                        }
                      }
                    }
                  },
                  "cost": {
                    "type": "object",
                    "properties": {
                      "totalAmount": {
                        "type": "object",
                        "properties": {
                          "amount": { "type": "string" },
                          "currencyCode": { "type": "string" }
                        }
                      },
                      "amountPerQuantity": {
                        "type": "object",
                        "properties": {
                          "amount": { "type": "string" },
                          "currencyCode": { "type": "string" }
                        }
                      }
                    }
                  },
                  "attributes": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "key": { "type": "string" },
                        "value": { "type": "string" }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/shopify-storefront-cart"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.