Swell Cart API

Session-scoped shopping cart for the current visitor.

Operations 8

GET /api/cart Retrieve Current Cart #
PUT /api/cart Update Current Cart #
POST /api/cart/items Add Item To Cart #
PUT /api/cart/items/{itemId} Update Cart Item #
DELETE /api/cart/items/{itemId} Remove Cart Item #
PUT /api/cart/apply-coupon Apply Coupon To Cart #
PUT /api/cart/apply-giftcard Apply Gift Card To Cart #
GET /api/cart/recover/{token} Recover Cart #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API 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 apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • 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 API
curl "https://apis.io/api/v1/apis/swell-io-cart-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

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

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

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

OpenAPI Specification

swell-io-cart-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Swell Frontend Cart API
  version: 2025-01
  description: Swell Frontend API — the client-safe, public-key-authenticated REST surface used from storefronts, single-page apps, and headless commerce experiences. Exposes a curated subset of the Backend API authorized with a public key plus a session token. Powers Swell.js, the React/Vue/Next storefront kits (Origin, Horizon, Verswell), and any custom JAMstack or SSR storefront. Resources include products, categories, carts, accounts, orders, subscriptions, payments, coupons, gift cards, store settings, currencies, localization, menus, and content pages.
  contact:
    name: Swell Developer Support
    url: https://developers.swell.is/frontend-api/introduction
  license:
    name: API Profile — API Evangelist
    url: https://apievangelist.com
servers:
- url: https://{storeId}.swell.store
  description: Per-store Frontend API endpoint
  variables:
    storeId:
      default: my-store
      description: Your Swell store ID (subdomain).
security:
- SwellPublicKey: []
tags:
- name: Cart
  description: Session-scoped shopping cart for the current visitor.
paths:
  /api/cart:
    get:
      tags:
      - Cart
      summary: Retrieve Current Cart
      operationId: frontendGetCart
      responses:
        '200':
          description: Current cart for the session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
    put:
      tags:
      - Cart
      summary: Update Current Cart
      operationId: frontendUpdateCart
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Cart'
      responses:
        '200':
          description: Updated cart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
  /api/cart/items:
    post:
      tags:
      - Cart
      summary: Add Item To Cart
      operationId: frontendAddCartItem
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                product_id:
                  type: string
                quantity:
                  type: integer
                variant_id:
                  type: string
                options:
                  type: array
                  items:
                    type: object
      responses:
        '200':
          description: Updated cart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
  /api/cart/items/{itemId}:
    parameters:
    - name: itemId
      in: path
      required: true
      schema:
        type: string
    put:
      tags:
      - Cart
      summary: Update Cart Item
      operationId: frontendUpdateCartItem
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                quantity:
                  type: integer
      responses:
        '200':
          description: Updated.
    delete:
      tags:
      - Cart
      summary: Remove Cart Item
      operationId: frontendRemoveCartItem
      responses:
        '200':
          description: Removed.
  /api/cart/apply-coupon:
    put:
      tags:
      - Cart
      summary: Apply Coupon To Cart
      operationId: frontendApplyCoupon
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
      responses:
        '200':
          description: Coupon applied.
  /api/cart/apply-giftcard:
    put:
      tags:
      - Cart
      summary: Apply Gift Card To Cart
      operationId: frontendApplyGiftcard
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
      responses:
        '200':
          description: Gift card applied.
  /api/cart/recover/{token}:
    parameters:
    - name: token
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Cart
      summary: Recover Cart
      operationId: frontendRecoverCart
      responses:
        '200':
          description: Recovered cart.
components:
  schemas:
    Money:
      type: number
      format: float
    Cart:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
        account_id:
          type: string
        items:
          type: array
          items:
            type: object
        billing:
          type: object
        shipping:
          type: object
        sub_total:
          $ref: '#/components/schemas/Money'
        tax_total:
          $ref: '#/components/schemas/Money'
        discount_total:
          $ref: '#/components/schemas/Money'
        shipment_total:
          $ref: '#/components/schemas/Money'
        grand_total:
          $ref: '#/components/schemas/Money'
        coupon_code:
          type: string
        currency:
          type: string
  securitySchemes:
    SwellPublicKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'Public storefront key, prefixed with `pk_`. Pass as `Authorization: pk_...`.'