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

# Update Item

> Set exact quantity for a cart item.



## OpenAPI

````yaml https://api.vellaro.io/openapi.json patch /api/v1/cart/items/{item_id}
openapi: 3.1.0
info:
  title: Vellaro API
  description: Vellaro 2026 — E-commerce API
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags: []
paths:
  /api/v1/cart/items/{item_id}:
    patch:
      tags:
        - cart
      summary: Update Item
      description: Set exact quantity for a cart item.
      operationId: update_item_api_v1_cart_items__item_id__patch
      parameters:
        - name: item_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Item Id
        - name: cx_cart
          in: cookie
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cx Cart
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateItemRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_CartOut_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateItemRequest:
      properties:
        quantity:
          type: integer
          title: Quantity
      type: object
      required:
        - quantity
      title: UpdateItemRequest
    ApiResponse_CartOut_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/CartOut'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/PaginationMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ApiResponse[CartOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CartOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        session_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Token
        items:
          items:
            $ref: '#/components/schemas/CartItemOut'
          type: array
          title: Items
          default: []
        subtotal:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Subtotal
          default: '0'
        item_count:
          type: integer
          title: Item Count
          default: 0
      type: object
      required:
        - id
        - user_id
        - session_token
      title: CartOut
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total:
          type: integer
          title: Total
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - page
        - page_size
        - total
        - total_pages
      title: PaginationMeta
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CartItemOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        variant_id:
          type: string
          format: uuid
          title: Variant Id
        quantity:
          type: integer
          title: Quantity
        created_at:
          type: string
          format: date-time
          title: Created At
        variant:
          $ref: '#/components/schemas/CartItemVariantOut'
        line_total:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Line Total
          default: '0'
      type: object
      required:
        - id
        - variant_id
        - quantity
        - created_at
        - variant
      title: CartItemOut
    CartItemVariantOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        sku:
          type: string
          title: Sku
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Price
        sale_price:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Sale Price
        sale_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sale Start
        sale_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sale End
        stock:
          type: integer
          title: Stock
        allow_backorder:
          type: boolean
          title: Allow Backorder
        attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Attributes
        barcode:
          anyOf:
            - type: string
            - type: 'null'
          title: Barcode
        product_name:
          type: string
          title: Product Name
          default: ''
        product_slug:
          type: string
          title: Product Slug
          default: ''
        primary_image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Primary Image Url
      type: object
      required:
        - id
        - sku
        - name
        - price
        - sale_price
        - sale_start
        - sale_end
        - stock
        - allow_backorder
        - attributes
        - barcode
      title: CartItemVariantOut
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````