Fourthwall Storefront Carts API

The Storefront Carts API from Fourthwall — 5 operation(s) for storefront carts.

OpenAPI Specification

fourthwall-storefront-carts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Fourthwall Collections Storefront Carts API
  description: 'Representative OpenAPI description of Fourthwall''s public creator commerce APIs. Fourthwall exposes two HTTP surfaces: a public Storefront API (authenticated with a storefront token) for building headless shops, and a Platform / Open API (authenticated with a shop API key via HTTP Basic Auth, or OAuth 2.0 for multi-shop apps) for managing orders, products, collections, promotions, gifting, memberships, and webhooks. This document is a faithful, representative subset for cataloging; consult https://docs.fourthwall.com for the complete, authoritative reference.'
  termsOfService: https://fourthwall.com/terms-of-service
  contact:
    name: Fourthwall
    url: https://fourthwall.com
  version: v1
servers:
- url: https://storefront-api.fourthwall.com
  description: Storefront API (public storefront token)
- url: https://api.fourthwall.com
  description: Platform / Open API (shop API key or OAuth)
tags:
- name: Storefront Carts
paths:
  /v1/carts:
    post:
      operationId: createCart
      tags:
      - Storefront Carts
      summary: Create cart
      security:
      - storefrontToken: []
      parameters:
      - name: storefront_token
        in: query
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CartCreateRequest'
      responses:
        '200':
          description: The created cart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
  /v1/carts/{cartId}:
    get:
      operationId: getCart
      tags:
      - Storefront Carts
      summary: Get cart by id
      security:
      - storefrontToken: []
      parameters:
      - name: cartId
        in: path
        required: true
        schema:
          type: string
      - name: storefront_token
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: The cart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
  /v1/carts/{cartId}/add:
    post:
      operationId: addToCart
      tags:
      - Storefront Carts
      summary: Add to cart
      security:
      - storefrontToken: []
      parameters:
      - name: cartId
        in: path
        required: true
        schema:
          type: string
      - name: storefront_token
        in: query
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CartItemsRequest'
      responses:
        '200':
          description: The updated cart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
  /v1/carts/{cartId}/change:
    post:
      operationId: changeCartItems
      tags:
      - Storefront Carts
      summary: Change cart items quantity
      security:
      - storefrontToken: []
      parameters:
      - name: cartId
        in: path
        required: true
        schema:
          type: string
      - name: storefront_token
        in: query
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CartItemsRequest'
      responses:
        '200':
          description: The updated cart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
  /v1/carts/{cartId}/remove:
    post:
      operationId: removeFromCart
      tags:
      - Storefront Carts
      summary: Remove from cart
      security:
      - storefrontToken: []
      parameters:
      - name: cartId
        in: path
        required: true
        schema:
          type: string
      - name: storefront_token
        in: query
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CartItemsRequest'
      responses:
        '200':
          description: The updated cart.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
components:
  schemas:
    CartItem:
      type: object
      properties:
        variantId:
          type: string
        quantity:
          type: integer
    Cart:
      type: object
      properties:
        id:
          type: string
        items:
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
    CartCreateRequest:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
    CartItemsRequest:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/CartItem'
  securitySchemes:
    storefrontToken:
      type: apiKey
      in: query
      name: storefront_token
      description: Public storefront token obtained from Settings > For Developers, passed as the storefront_token query parameter on Storefront API requests.
    basicAuth:
      type: http
      scheme: basic
      description: Shop API key used with HTTP Basic Authentication against the Platform (Open) API.
    oauth:
      type: oauth2
      description: OAuth 2.0 for multi-shop platform apps.
      flows:
        authorizationCode:
          authorizationUrl: https://auth.fourthwall.com/auth/realms/Fourthwall/protocol/openid-connect/auth
          tokenUrl: https://api.fourthwall.com/open-api/v1.0/platform/token
          scopes:
            order_read: Read orders
            order_write: Write orders and fulfillments
            offer_read: Read products, collections, and gifting
            offer_write: Write products, collections, and gifting
            promotions_read: Read promotions
            promotions_write: Write promotions
            giveaway_read: Read giveaways
            giveaway_write: Write giveaways
            memberships_read: Read memberships
            memberships_write: Write memberships
            webhook_read: Read webhooks
            webhook_write: Write webhooks
            donation_read: Read donations
            shop_read: Read shop information