> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fourthwall.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Change Cart Quantity



## OpenAPI

````yaml /openapi/storefront.json POST /v1/carts/{cartId}/change
openapi: 3.1.0
info:
  title: Fourthwall APIs
  description: Service used for management of orders, carts, and payments.
  termsOfService: https://fourthwall.com/terms-of-service
  contact:
    name: Backend team
    url: https://fourthwall.com
    email: backend@fourthwall.com
  version: unspecified
servers:
  - url: https://storefront-api.fourthwall.com
    description: Production server
security: []
externalDocs:
  description: OpenAPI documentation
  url: https://docs.fourthwall.com
paths:
  /v1/carts/{cartId}/change:
    post:
      tags:
        - headless_carts
      summary: Change cart items quantity
      operationId: change-cart-quantity
      parameters:
        - name: storefront_token
          in: query
          required: true
          schema:
            type: string
            example: ptkn_xxxxxxxxxxxxxxxxxx
        - name: cartId
          in: path
          required: true
          schema:
            type: string
        - name: currency
          in: query
          required: false
          schema:
            type: string
            enum:
              - USD
              - EUR
              - CAD
              - GBP
              - AUD
              - NZD
              - SEK
              - NOK
              - DKK
              - PLN
              - INR
              - JPY
              - MYR
              - SGD
              - MXN
              - BRL
              - CHF
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/com.fourthwall.app.headless.endpoint.HeadlessCart.XRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/com.fourthwall.app.headless.model.CartV1'
        '400':
          description: >-
            Possible errors: `CART_FORBIDDEN_MEMBERS_ONLY_OFFERS_ERROR`,
            `CART_INCOMPLETE_BUNDLE_ERROR`,
            `CART_ITEM_NOT_FOUND_FOR_SHOP_ERROR`, `CART_OFFER_NOT_AVAILABLE`,
            `CART_OFFER_NOT_PURCHASABLE_ERROR`, `CART_QUANTITY_TOO_HIGH`
          content:
            application/json:
              examples:
                cart-forbidden-members-only-offers-error:
                  value:
                    code: CART_FORBIDDEN_MEMBERS_ONLY_OFFERS_ERROR
                    offerIds: <set>
                cart-incomplete-bundle-error:
                  value:
                    code: CART_INCOMPLETE_BUNDLE_ERROR
                    bundleId: <offerid>
                    details: <string>
                cart-item-not-found-for-shop-error:
                  value:
                    code: CART_ITEM_NOT_FOUND_FOR_SHOP_ERROR
                    shopId: <shopid>
                    variantId: <offervariantid>
                cart-offer-not-available:
                  value:
                    code: CART_OFFER_NOT_AVAILABLE
                    variantId: <offervariantid>
                cart-offer-not-purchasable-error:
                  value:
                    code: CART_OFFER_NOT_PURCHASABLE_ERROR
                    variantId: <offervariantid>
                cart-quantity-too-high:
                  value:
                    code: CART_QUANTITY_TOO_HIGH
                    variantId: <offervariantid>
                    quantity: <int>
        '404':
          description: >-
            Possible errors: `CART_NOT_FOUND`, `CART_OFFER_NOT_FOUND`,
            `OFFER_VARIANT_NOT_FOUND_ERROR`
          content:
            application/json:
              examples:
                cart-not-found:
                  value:
                    code: CART_NOT_FOUND
                    cartId: <cartid>
                cart-offer-not-found:
                  value:
                    code: CART_OFFER_NOT_FOUND
                    variantId: <offervariantid?>
                    groupedId: <cartitemgroupedid?>
                offer-variant-not-found-error:
                  value:
                    code: OFFER_VARIANT_NOT_FOUND_ERROR
                    offerVariantId: <offervariantid>
      externalDocs:
        url: >-
          https://docs.fourthwall.com/api-reference/storefront/carts/change-cart-quantity
components:
  schemas:
    com.fourthwall.app.headless.endpoint.HeadlessCart.XRequest:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/com.fourthwall.app.headless.endpoint.HeadlessCart.RequestItem
        metadata:
          type: object
          additionalProperties:
            type: string
          description: >-
            Custom metadata key-value pairs. Max 10 keys, keys must be
            alphanumeric with underscores, max 256 chars per key, max 512 bytes
            per value, max 2KB total.
          example:
            asset_id: abc123
            campaign: summer_2026
      required:
        - items
      title: X Request
    com.fourthwall.app.headless.model.CartV1:
      type: object
      properties:
        id:
          type: string
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/com.fourthwall.app.headless.model.CartV1.CartItemV1
        metadata:
          type: object
          additionalProperties:
            type: string
      required:
        - id
        - items
      title: Cart
    com.fourthwall.app.headless.endpoint.HeadlessCart.RequestItem:
      type: object
      properties:
        variantId:
          type: string
          format: uuid
          example: 000009c2-0c75-0024-0000-09c20c750024
        quantity:
          type: integer
          format: int32
          example: 1
          maximum: 1000
          minimum: 0
      required:
        - quantity
        - variantId
      title: Request Item
    com.fourthwall.app.headless.model.CartV1.CartItemV1:
      type: object
      properties:
        variant:
          $ref: >-
            #/components/schemas/com.fourthwall.app.headless.model.CartProductVariantV1
        quantity:
          type: integer
          format: int32
        groupedBy:
          oneOf:
            - $ref: >-
                #/components/schemas/com.fourthwall.app.headless.model.CartItemGroupedByV1.Bundle
      required:
        - quantity
        - variant
      title: Cart Item
    com.fourthwall.app.headless.model.CartProductVariantV1:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        sku:
          type: string
        unitPrice:
          $ref: '#/components/schemas/Money'
        compareAtPrice:
          $ref: '#/components/schemas/Money'
        attributes:
          $ref: >-
            #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Attributes
        stock:
          oneOf:
            - $ref: >-
                #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Stock.Limited
            - $ref: >-
                #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Stock.Unlimited
        weight:
          $ref: >-
            #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Weight
        dimensions:
          $ref: >-
            #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Dimensions
        images:
          type: array
          items:
            $ref: '#/components/schemas/com.fourthwall.openapi.model.Image'
        product:
          $ref: '#/components/schemas/com.fourthwall.app.headless.model.ProductStubV1'
      required:
        - attributes
        - dimensions
        - id
        - images
        - name
        - product
        - sku
        - stock
        - unitPrice
        - weight
      title: Cart Product Variant
    com.fourthwall.app.headless.model.CartItemGroupedByV1.Bundle:
      allOf:
        - $ref: >-
            #/components/schemas/com.fourthwall.app.headless.model.CartItemGroupedByV1
        - type: object
          properties:
            bundleId:
              type: string
            groupedId:
              type: string
      required:
        - bundleId
        - groupedId
      title: Bundle
    Money:
      type: object
      properties:
        value:
          type: number
          example: 10
          minimum: 0
        currency:
          type: string
          example: USD
      required:
        - currency
        - value
      title: Money
    com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Attributes:
      type: object
      properties:
        description:
          type: string
          example: Black, L
        color:
          $ref: >-
            #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Attributes.Color
        size:
          $ref: >-
            #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Attributes.Size
      required:
        - description
      title: Attributes
    com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Stock.Limited:
      allOf:
        - $ref: >-
            #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Stock
        - type: object
          properties:
            inStock:
              type: integer
              format: int32
              example: 5
        - type: object
          properties:
            type:
              type: string
              const: LIMITED
      required:
        - inStock
      title: Limited
    com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Stock.Unlimited:
      allOf:
        - $ref: >-
            #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Stock
        - type: object
          properties:
            type:
              type: string
              const: UNLIMITED
      title: Unlimited
    com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Weight:
      type: object
      properties:
        value:
          type: number
          example: '1.0'
        unit:
          type: string
          example: kg
      required:
        - unit
        - value
      title: Weight
    com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Dimensions:
      type: object
      properties:
        length:
          type: number
          example: '1.0'
        width:
          type: number
          example: '2.0'
        height:
          type: number
          example: '3.0'
        unit:
          type: string
          example: cm
      required:
        - height
        - length
        - unit
        - width
      title: Dimensions
    com.fourthwall.openapi.model.Image:
      type: object
      properties:
        id:
          type: string
          example: 00aa4abd-5778-4199-8161-0b49b2f212e5
        url:
          type: string
          example: https://fourthwall.com/image.png
        width:
          type: integer
          format: int32
          description: The original width of the image in pixels.
          example: 800
        height:
          type: integer
          format: int32
          description: The original height of the image in pixels.
          example: 600
        transformedUrl:
          type: string
          description: >-
            Transformed URL with applied image processing (e.g., resizing,
            optimization)
          example: https://fourthwall.com/image.png
      required:
        - height
        - id
        - transformedUrl
        - url
        - width
      title: Image
    com.fourthwall.app.headless.model.ProductStubV1:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
      required:
        - id
        - name
        - slug
      title: Product Stub
    com.fourthwall.app.headless.model.CartItemGroupedByV1:
      discriminator:
        propertyName: type
      properties:
        type:
          type: string
      required:
        - type
      title: Cart Item Grouped By
    com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Attributes.Color:
      type: object
      properties:
        name:
          type: string
          example: Black
        swatch:
          type: string
          example: '#000000'
      required:
        - name
        - swatch
      title: Color
    com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Attributes.Size:
      type: object
      properties:
        name:
          type: string
          example: L
      required:
        - name
      title: Size
    com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Stock:
      discriminator:
        propertyName: type
        mapping:
          UNLIMITED:
            $ref: >-
              #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Stock.Unlimited
          LIMITED:
            $ref: >-
              #/components/schemas/com.fourthwall.openapi.model.OfferAbstractV1.OfferVariantAbstractV1.Stock.Limited
      properties:
        type:
          type: string
      required:
        - type
      title: Stock

````