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

# Update Item Quantity

> Updates the quantity of an item for a customer. Can increase or decrease quantities, with optional expiration and negative balance control.



## OpenAPI

````yaml /openapi/server.json post /payments/items/{customer_type}/{customer_id}/{item_id}/update-quantity
openapi: 3.1.0
info:
  title: Hexclave REST API
  version: 1.0.0
  description: >-
    The Hexclave REST API. All request headers are documented as canonical
    `X-Hexclave-*`; the equivalent `X-Stack-*` aliases are accepted on every
    endpoint for backwards compatibility. Response headers
    `X-Hexclave-actual-status`, `X-Hexclave-known-error`, and
    `X-Hexclave-request-id` are emitted alongside their legacy `X-Stack-*`
    equivalents.
servers:
  - url: https://api.hexclave.com/api/v1
    description: Hexclave REST API
security: []
paths:
  /payments/items/{customer_type}/{customer_id}/{item_id}/update-quantity:
    post:
      tags:
        - Payments
      summary: Update Item Quantity
      description: >-
        Updates the quantity of an item for a customer. Can increase or decrease
        quantities, with optional expiration and negative balance control.
      parameters:
        - name: allow_negative
          in: query
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
            example: 'false'
            description: Whether to allow the quantity to go negative
          description: Whether to allow the quantity to go negative
          required: true
        - name: customer_type
          in: path
          schema:
            type: string
            enum:
              - user
              - team
              - custom
            example: user
            description: The type of customer
          description: The type of customer
          required: true
        - name: customer_id
          in: path
          schema:
            type: string
            example: user_1234567890abcdef
            description: The ID of the customer
          description: The ID of the customer
          required: true
        - name: item_id
          in: path
          schema:
            type: string
            example: credits
            description: The ID of the item to update
          description: The ID of the item to update
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                delta:
                  type: integer
                  example: 100
                  description: >-
                    The amount to change the quantity by (positive to increase,
                    negative to decrease)
                expires_at:
                  type: string
                  example: '2024-12-31T23:59:59Z'
                  description: >-
                    Optional expiration date for this quantity change (ISO 8601
                    format)
                description:
                  type: string
                  example: Monthly subscription renewal
                  description: Optional description for this quantity change
              required:
                - delta
              example:
                delta: 100
                expires_at: '2024-12-31T23:59:59Z'
                description: Monthly subscription renewal
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}

````