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

# Update subscription item

> Used to update a subscription item.



## OpenAPI

````yaml openapi-customer.json PATCH /subscriptions/{subscriptionId}/items/{itemId}
openapi: 3.1.0
info:
  version: 8.15.0
  title: '@fastify/swagger'
servers:
  - url: https://api.juo.io/customer/v1
security:
  - DelegatedToken: []
  - AccessToken: []
paths:
  /subscriptions/{subscriptionId}/items/{itemId}:
    patch:
      tags:
        - api.customer.v1
      description: Updates a subscription item
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: subscriptionId
          required: true
          description: The subscription identifier
        - schema:
            format: uuid
            type: string
          in: path
          name: itemId
          required: true
          description: The subscription item identifier
        - $ref: '#/components/parameters/TenantHeader'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                quantity:
                  minimum: 1
                  description: Number of units ordered per billing cycle.
                  type: integer
                  example: 1
              required: []
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionItem'
components:
  parameters:
    TenantHeader:
      name: X-Tenant-ID
      x-speakeasy-name-override: tenant
      x-speakeasy-globals-hidden: true
      in: header
      schema:
        type: string
      required: true
      description: >-
        Unique identifier of the tenant in the system (usually a store
        identifier)
  schemas:
    SubscriptionItem:
      type: object
      properties:
        id:
          format: uuid
          description: Unique subscription item identifier (UUID).
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        resource:
          type: string
          enum:
            - subscription-item
        title:
          minLength: 1
          description: Product title.
          type: string
          example: Monthly Coffee Blend
        subtitle:
          minLength: 1
          description: Variant title. Matches the variant title in most cases.
          type:
            - 'null'
            - string
          example: 250g / Ground
        quantity:
          minimum: 1
          description: Number of units ordered per billing cycle.
          type: integer
          example: 1
        totalPrice:
          minimum: 0
          description: >-
            Final item price per billing cycle including all applicable
            discounts.
          type: number
          example: 24.99
        recurringCycleLimit:
          minimum: 1
          description: >-
            Maximum number of billing cycles this item remains on the
            subscription. The item is automatically removed once this limit is
            reached. Null means no limit.
          type:
            - 'null'
            - integer
          example: 3
        canceledAt:
          format: date-time
          description: Cancellation date of the item.
          type:
            - 'null'
            - string
        billingPolicy:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                interval:
                  anyOf:
                    - type: string
                      enum:
                        - DAY
                    - type: string
                      enum:
                        - WEEK
                    - type: string
                      enum:
                        - MONTH
                    - type: string
                      enum:
                        - YEAR
                intervalCount:
                  minimum: 1
                  maximum: 365
                  type: integer
                anchors:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        anyOf:
                          - type: string
                            enum:
                              - WEEKDAY
                          - type: string
                            enum:
                              - MONTHDAY
                          - type: string
                            enum:
                              - YEARDAY
                      day:
                        minimum: 1
                        maximum: 31
                        type: integer
                      month:
                        minimum: 1
                        maximum: 12
                        type:
                          - 'null'
                          - integer
                      cutoffDay:
                        minimum: 1
                        maximum: 31
                        type:
                          - 'null'
                          - integer
                    required:
                      - type
                      - day
                      - month
                      - cutoffDay
                minCycles:
                  minimum: 1
                  type:
                    - 'null'
                    - integer
                maxCycles:
                  minimum: 1
                  type:
                    - 'null'
                    - integer
              required:
                - interval
                - intervalCount
                - anchors
                - minCycles
                - maxCycles
              title: BillingPolicy
        deliveryPolicy:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                interval:
                  anyOf:
                    - type: string
                      enum:
                        - DAY
                    - type: string
                      enum:
                        - WEEK
                    - type: string
                      enum:
                        - MONTH
                    - type: string
                      enum:
                        - YEAR
                intervalCount:
                  minimum: 1
                  maximum: 365
                  type: integer
                anchors:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        anyOf:
                          - type: string
                            enum:
                              - WEEKDAY
                          - type: string
                            enum:
                              - MONTHDAY
                          - type: string
                            enum:
                              - YEARDAY
                      day:
                        minimum: 1
                        maximum: 31
                        type: integer
                      month:
                        minimum: 1
                        maximum: 12
                        type:
                          - 'null'
                          - integer
                      cutoffDay:
                        minimum: 1
                        maximum: 31
                        type:
                          - 'null'
                          - integer
                    required:
                      - type
                      - day
                      - month
                      - cutoffDay
              required:
                - interval
                - intervalCount
                - anchors
              title: DeliveryPolicy
        customAttributes:
          description: >-
            Arbitrary key-value pairs attached to this subscription item. In the
            Customer API, attributes whose key starts with `_` are hidden and
            excluded.
          type: array
          items:
            type: object
            properties:
              key:
                minLength: 1
                type: string
              value:
                type: string
            required:
              - key
              - value
        variant:
          description: >-
            ProductVariant `id` when not expanded, or the full `ProductVariant`
            object when the field name is included in the `expand` query
            parameter. Can be null.
          anyOf:
            - minLength: 1
              type: string
            - $ref: '#/components/schemas/ProductVariant'
            - type: 'null'
        product:
          description: >-
            Product `id` when not expanded, or the full `Product` object when
            the field name is included in the `expand` query parameter. Can be
            null.
          anyOf:
            - minLength: 1
              type: string
            - $ref: '#/components/schemas/Product'
            - type: 'null'
      required:
        - id
        - resource
        - title
        - subtitle
        - quantity
        - totalPrice
        - recurringCycleLimit
        - canceledAt
        - billingPolicy
        - deliveryPolicy
        - customAttributes
        - variant
        - product
      title: SubscriptionItem
    ProductVariant:
      type: object
      properties:
        id:
          minLength: 1
          type: string
        title:
          minLength: 1
          type: string
        image:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                id:
                  minLength: 1
                  type: string
                url:
                  format: uri
                  type: string
                altText:
                  minLength: 1
                  type:
                    - 'null'
                    - string
              required:
                - id
                - url
                - altText
        price:
          type: number
        purchaseOptions:
          type: array
          items:
            type: object
            properties:
              name:
                minLength: 1
                type: string
              price:
                type: number
              interval:
                type: object
                properties:
                  intervalCount:
                    type: number
                  interval:
                    type: string
                    enum:
                      - DAY
                      - MONTH
                      - WEEK
                      - YEAR
                required:
                  - intervalCount
                  - interval
            required:
              - name
              - price
              - interval
      required:
        - id
        - title
        - image
        - price
        - purchaseOptions
      title: ProductVariant
    Product:
      type: object
      properties:
        id:
          minLength: 1
          type: string
        title:
          minLength: 1
          type: string
        image:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                id:
                  minLength: 1
                  type: string
                url:
                  format: uri
                  type: string
                altText:
                  minLength: 1
                  type:
                    - 'null'
                    - string
              required:
                - id
                - url
                - altText
        variants:
          type: array
          items:
            $ref: '#/components/schemas/ProductVariant'
        collections:
          type: array
          items:
            type: object
            properties:
              handle:
                minLength: 1
                type: string
            required:
              - handle
      required:
        - id
        - title
        - image
        - variants
        - collections
      title: Product
  securitySchemes:
    DelegatedToken:
      type: apiKey
      name: X-Delegated-Token
      in: header
    AccessToken:
      type: http
      scheme: bearer

````