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

# Update Subscription

> Update Subscription items and handle proration behavior.
    Can modify prices, quantities, and add/remove items.



## OpenAPI

````yaml /api-reference/api-docs.yaml patch /v0/subscriptions/{subscriptionIdOrNumber}/update
openapi: 3.1.0
info:
  title: Fungies API v0
  version: 0.3.5
servers:
  - url: https://api.fungies.io
security: []
tags:
  - name: discounts
    description: Discounts related endpoints
  - name: keys
    description: Offer product keys related endpoints
  - name: orders
    description: Orders related endpoints
  - name: payments
    description: Payments related endpoints
  - name: offers
    description: Offers related endpoints
  - name: products
    description: Products related endpoints
  - name: subscriptions
    description: Subscriptions related endpoints
  - name: users
    description: Users related endpoints
  - name: variants
    description: Product variants related endpoints
  - name: plans
    description: Product plans related endpoints
  - name: elements
    description: Elements related endpoints
paths:
  /v0/subscriptions/{subscriptionIdOrNumber}/update:
    patch:
      tags:
        - subscriptions
      summary: Update Subscription
      description: |-
        Update Subscription items and handle proration behavior.
            Can modify prices, quantities, and add/remove items.
      operationId: PatchV0SubscriptionsSubscriptionIdOrNumberUpdate
      parameters:
        - name: subscriptionIdOrNumber
          in: path
          required: true
          description: Subscription ID or order number
          schema:
            $ref: >-
              #/components/schemas/PatchV0SubscriptionsSubscriptionIdOrNumberUpdateParameterSubscriptionIdOrNumber
      requestBody:
        description: PATCH /v0/subscriptions/:subscriptionIdOrNumber/update Request body
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/PatchV0SubscriptionsSubscriptionIdOrNumberUpdateRequestBody
      responses:
        '200':
          description: >-
            PATCH /v0/subscriptions/:subscriptionIdOrNumber/update Positive
            response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PatchV0SubscriptionsSubscriptionIdOrNumberUpdatePositiveResponse
        '400':
          description: >-
            PATCH /v0/subscriptions/:subscriptionIdOrNumber/update Negative
            response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PatchV0SubscriptionsSubscriptionIdOrNumberUpdateNegativeResponse
              examples:
                example1:
                  value:
                    status: error
                    error:
                      message: Sample error message
      security:
        - APIKEY_1: []
          APIKEY_2: []
components:
  schemas:
    PatchV0SubscriptionsSubscriptionIdOrNumberUpdateParameterSubscriptionIdOrNumber:
      type: string
      pattern: ^#?([0-9A-Za-z]{12,32}|[0-9]+)(-[0-9]+)?$
      description: Subscription ID or order number
    PatchV0SubscriptionsSubscriptionIdOrNumberUpdateRequestBody:
      type: object
      properties:
        prorationBehavior:
          type: string
          enum:
            - none
            - create_prorations
            - always_invoice
          default: none
        items:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: >-
                  Name of the Item. Required if Offer ID is not provided. Can be
                  used to override the Offer name.
                examples:
                  - Premium Plan
              unitPrice:
                type: integer
                format: int64
                exclusiveMinimum: 100
                maximum: 9007199254740991
                description: >-
                  New unit price in cents (min: 100). Required if Offer ID is
                  not provided. Can be used to override the Offer price.
                examples:
                  - 10000
              currency:
                type: string
                enum:
                  - AFN
                  - ALL
                  - DZD
                  - AOA
                  - ARS
                  - AMD
                  - AWG
                  - AUD
                  - AZN
                  - BSD
                  - BDT
                  - BBD
                  - BZD
                  - BMD
                  - BOB
                  - BAM
                  - BWP
                  - BRL
                  - BHD
                  - GBP
                  - BND
                  - BGN
                  - BIF
                  - BYN
                  - KHR
                  - CAD
                  - CVE
                  - KYD
                  - KWD
                  - XAF
                  - XPF
                  - CLP
                  - CNY
                  - COP
                  - KMF
                  - CDF
                  - CRC
                  - HRK
                  - CZK
                  - DKK
                  - DJF
                  - DOP
                  - XCD
                  - EGP
                  - ETB
                  - EUR
                  - FKP
                  - FJD
                  - GMD
                  - GEL
                  - GIP
                  - GTQ
                  - GNF
                  - GYD
                  - HTG
                  - HNL
                  - HKD
                  - HUF
                  - ISK
                  - INR
                  - IDR
                  - ILS
                  - JMD
                  - JPY
                  - JOD
                  - KZT
                  - KES
                  - KGS
                  - LAK
                  - LBP
                  - LSL
                  - LRD
                  - MOP
                  - MKD
                  - MGA
                  - MWK
                  - MYR
                  - MVR
                  - MRO
                  - MUR
                  - MXN
                  - MDL
                  - MNT
                  - MAD
                  - MZN
                  - MMK
                  - NAD
                  - NPR
                  - ANG
                  - TWD
                  - NZD
                  - NIO
                  - NGN
                  - NOK
                  - OMR
                  - PKR
                  - PAB
                  - PGK
                  - PYG
                  - PEN
                  - PHP
                  - PLN
                  - QAR
                  - RON
                  - RUB
                  - RWF
                  - SHP
                  - SVC
                  - WST
                  - STD
                  - SAR
                  - RSD
                  - SCR
                  - SLL
                  - SGD
                  - SBD
                  - SOS
                  - ZAR
                  - KRW
                  - LKR
                  - SRD
                  - SZL
                  - SEK
                  - CHF
                  - TJS
                  - TZS
                  - THB
                  - TND
                  - TOP
                  - TTD
                  - TRY
                  - UGX
                  - UAH
                  - AED
                  - UYU
                  - USD
                  - UZS
                  - VUV
                  - VEF
                  - VND
                  - XOF
                  - YER
                  - ZMW
                  - SLE
                  - XCG
                  - SSP
                  - VES
                  - MRU
                  - STN
                  - VED
                description: >-
                  Valid currency code. Required if value is provided. Required
                  if Offer ID is not provided. Can be used to override the Offer
                  currency.
                          
                          Note: Currently needs to match Workspace currency.
                examples:
                  - USD
              quantity:
                type: number
                format: double
                minimum: 1
                maximum: 1.7976931348623157e+308
                default: 1
                description: 'Optional quantity (default: 1).'
                examples:
                  - 1
              offerId:
                type: string
                format: uuid
                description: |-
                  Optional valid Offer ID. Adds Offer reference to the Item. 
                        
                        Note: name, value and currency are derived from the Offer if not provided.
                        - name: Offer name with full specification
                        - value: Offer price
                        - currency: Offer currency
                examples:
                  - 123e4567-e89b-12d3-a456-426614174000
              price:
                type: number
                format: double
                minimum: 100
                maximum: 1.7976931348623157e+308
                description: Deprecated. Use value instead.
              value:
                type: number
                format: double
                minimum: 100
                maximum: 1.7976931348623157e+308
                description: Deprecated. Use unitPrice instead.
          minItems: 1
          maxItems: 1
      required:
        - items
    PatchV0SubscriptionsSubscriptionIdOrNumberUpdatePositiveResponse:
      type: object
      properties:
        status:
          type: string
          const: success
        data:
          type: object
          properties:
            success:
              type: boolean
          required:
            - success
      required:
        - status
        - data
    PatchV0SubscriptionsSubscriptionIdOrNumberUpdateNegativeResponse:
      type: object
      properties:
        status:
          type: string
          const: error
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - status
        - error
  securitySchemes:
    APIKEY_1:
      type: apiKey
      in: header
      name: x-fngs-public-key
    APIKEY_2:
      type: apiKey
      in: header
      name: x-fngs-secret-key

````