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

# Update a subscription

> Patches metadata on a subscription: name, description, trial period, billing flags, subscription-level discount, spending thresholds, price escalation, and tags. This endpoint does not modify the priced item set. To change items, see the [Updating a Subscription](/docs/api-reference/v2/examples/updating-a-subscription) examples.



## OpenAPI

````yaml /api-reference/v2/specs/2026-04-01.json patch /subscriptions/{id}
openapi: 3.1.0
info:
  title: Alguna Public API
  version: '2026-04-01'
servers:
  - url: https://api.alguna.io
security:
  - bearerAuth: []
tags:
  - name: Billing Events and Metrics
  - name: Credit Notes
  - name: Credits
  - name: Customer Portal Sessions
  - name: Customers
  - name: Insights
  - name: Invoices
  - name: Payments
  - name: Plans
  - name: Product Bundles
  - name: Products
  - name: Refunds
  - name: Revenue Schedules
  - name: Subscription Changes
  - name: Subscription Versions
  - name: Subscriptions
  - name: Wallet Grants
  - name: Wallets
paths:
  /subscriptions/{id}:
    patch:
      tags:
        - Subscriptions
      summary: Update a subscription
      description: >-
        Patches metadata on a subscription: name, description, trial period,
        billing flags, subscription-level discount, spending thresholds, price
        escalation, and tags. This endpoint does not modify the priced item set.
        To change items, see the [Updating a
        Subscription](/docs/api-reference/v2/examples/updating-a-subscription)
        examples.
      operationId: update-subscription
      parameters:
        - in: header
          name: Alguna-Version
          required: true
          schema:
            enum:
              - '2026-04-01'
            type: string
        - in: header
          name: Idempotency-Key
          schema:
            description: >-
              A unique string used to ensure the request is processed exactly
              once. If you retry a request with the same idempotency key within
              24 hours, the original response is returned without re-executing
              the operation.
            example: ik_a1b2c3d4e5f6
            maxLength: 255
            type: string
        - in: path
          name: id
          required: true
          schema:
            description: Unique identifier for the subscription
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionResponse'
          description: Success
          headers:
            Idempotency-Key:
              description: Echo of the idempotency key provided in the request
              schema:
                type: string
            Idempotent-Replayed:
              description: >-
                Whether this response was replayed from a previous request
                (true) or freshly executed (false)
              schema:
                type: boolean
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Conflict — a request with this idempotency key is currently being
            processed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    UpdateSubscriptionRequest:
      properties:
        billing:
          allOf:
            - $ref: '#/components/schemas/BillingInput'
          description: Billing configuration
          nullable: true
        description:
          description: Description
          example: Annual enterprise subscription
          nullable: true
          type: string
        discount:
          allOf:
            - $ref: '#/components/schemas/DiscountInput'
          description: Subscription-level discount (percentage only)
          nullable: true
        maximum_spend:
          allOf:
            - $ref: '#/components/schemas/SpendingThresholdInput'
          description: Maximum spend threshold
          nullable: true
        metadata:
          description: Key-value metadata (null value removes key)
          nullable: true
          type: object
        minimum_spend:
          allOf:
            - $ref: '#/components/schemas/SpendingThresholdInput'
          description: Minimum spend threshold
          nullable: true
        name:
          description: Subscription name
          example: Acme Corp - Enterprise
          nullable: true
          type: string
        price_escalation:
          allOf:
            - $ref: '#/components/schemas/PriceEscalationInput'
          description: Price escalation config
          nullable: true
        renewal:
          allOf:
            - $ref: '#/components/schemas/RenewalInput'
          description: Renewal configuration
          nullable: true
        tags:
          description: Tag IDs
          example:
            - tag_abc123
          items:
            type: string
          type: array
        trial_period_days:
          description: Trial period in days
          example: 30
          format: int64
          nullable: true
          type: integer
      type: object
    SubscriptionResponse:
      properties:
        activated_at:
          description: When the subscription was activated
          example: '2026-01-01T00:00:00Z'
          format: date-time
          nullable: true
          type: string
        billing:
          allOf:
            - $ref: '#/components/schemas/BillingResponse'
          description: Billing configuration
        contract:
          allOf:
            - $ref: '#/components/schemas/ContractResponse'
          description: Contract configuration
        created_at:
          description: When the subscription was created
          example: '2025-12-15T10:30:00Z'
          format: date-time
          type: string
        currency:
          description: ISO 4217 currency code
          example: USD
          type: string
        current_version_id:
          description: Current active version ID
          example: subv_abc123
          nullable: true
          type: string
        customer_id:
          description: Customer ID
          example: cust_abc123
          type: string
        discount:
          allOf:
            - $ref: '#/components/schemas/DiscountResponse'
          description: Subscription-level discount
          nullable: true
        id:
          description: Unique identifier
          example: sub_abc123
          type: string
        maximum_spend:
          allOf:
            - $ref: '#/components/schemas/SpendingThresholdResponse'
          description: Maximum spend threshold
          nullable: true
        metadata:
          description: Key-value metadata
          type: object
        minimum_spend:
          allOf:
            - $ref: '#/components/schemas/SpendingThresholdResponse'
          description: Minimum spend threshold
          nullable: true
        name:
          description: Subscription name
          example: Acme Corp - Enterprise
          type: string
        pending_changes:
          description: Pending version changes
          items:
            $ref: '#/components/schemas/PendingChangeResponse'
          type: array
        plan_id:
          description: Plan ID
          example: pln_abc123
          nullable: true
          type: string
        price_escalation:
          allOf:
            - $ref: '#/components/schemas/PriceEscalationResponse'
          description: Price escalation configuration
          nullable: true
        renewal:
          allOf:
            - $ref: '#/components/schemas/RenewalResponse'
          description: Renewal configuration
        status:
          description: Subscription status
          example: active
          type: string
        trial_period_days:
          description: Trial period in days
          example: 30
          format: int64
          nullable: true
          type: integer
        updated_at:
          description: When the subscription was last updated
          example: '2026-04-04T10:00:05Z'
          format: date-time
          type: string
      required:
        - billing
        - contract
        - created_at
        - currency
        - customer_id
        - id
        - metadata
        - name
        - pending_changes
        - renewal
        - status
        - updated_at
      type: object
    ErrorResponse:
      properties:
        detail:
          type: string
        status:
          format: int64
          type: integer
      required:
        - status
        - detail
      type: object
    BillingInput:
      properties:
        auto_issue_invoices:
          description: Whether to auto-issue invoices
          example: true
          nullable: true
          type: boolean
        auto_pay_invoices:
          description: Whether to auto-pay invoices
          example: false
          nullable: true
          type: boolean
        first_billing_date:
          description: First billing date (YYYY-MM-DD)
          example: '2026-07-01'
          nullable: true
          type: string
        payment_terms:
          description: Payment terms
          example: net_30
          nullable: true
          type: string
      type: object
    DiscountInput:
      properties:
        amount:
          description: Discount amount
          example: '10'
          type: string
        duration_type:
          description: Duration type
          enum:
            - fixed
            - monthly_rolling
          example: fixed
          type: string
        duration_unit:
          description: Duration unit
          example: months
          nullable: true
          type: string
        duration_value:
          description: Duration value
          example: 6
          format: int64
          nullable: true
          type: integer
        type:
          description: Discount type (percentage only for subscription-level)
          example: percentage
          type: string
      required:
        - amount
        - duration_type
        - type
      type: object
    SpendingThresholdInput:
      properties:
        amount:
          description: Amount
          example: '500.00'
          type: string
        period:
          description: Billing period
          enum:
            - monthly
            - quarterly
            - semi_annual
            - yearly
          example: monthly
          type: string
      required:
        - amount
        - period
      type: object
    PriceEscalationInput:
      properties:
        enabled:
          description: Whether price escalation is enabled
          example: true
          type: boolean
        escalate_metered_unit_rates:
          description: Whether to escalate metered unit rates
          example: false
          nullable: true
          type: boolean
        interval_months:
          description: Months between escalations
          example: 12
          format: int64
          type: integer
        percentage:
          description: Escalation percentage
          example: '5.00'
          nullable: true
          type: string
        type:
          description: Escalation type
          example: percentage
          type: string
      required:
        - enabled
        - interval_months
        - type
      type: object
    RenewalInput:
      properties:
        auto_renew:
          description: Whether the subscription auto-renews
          example: true
          nullable: true
          type: boolean
        duration_months:
          description: Renewal duration in months
          example: 12
          format: int64
          nullable: true
          type: integer
        period_type:
          description: Renewal period type
          example: fixed
          nullable: true
          type: string
      type: object
    BillingResponse:
      properties:
        auto_issue_invoices:
          description: Whether invoices are auto-issued
          example: true
          type: boolean
        auto_pay_invoices:
          description: Whether invoices are auto-paid
          example: false
          type: boolean
        first_billing_date:
          description: First billing date
          example: '2026-01-01T00:00:00Z'
          format: date-time
          nullable: true
          type: string
        payment_terms:
          description: Payment terms
          example: net_30
          nullable: true
          type: string
      required:
        - auto_issue_invoices
        - auto_pay_invoices
      type: object
    ContractResponse:
      properties:
        duration_months:
          description: Contract duration in months
          example: 12
          format: int64
          nullable: true
          type: integer
        end_date:
          description: Contract end date
          example: '2027-01-01T00:00:00Z'
          format: date-time
          nullable: true
          type: string
        period_type:
          description: Contract period type
          example: fixed
          type: string
        start_date:
          description: Contract start date
          example: '2026-01-01T00:00:00Z'
          format: date-time
          nullable: true
          type: string
      required:
        - period_type
      type: object
    DiscountResponse:
      properties:
        amount:
          description: Discount amount
          example: '10'
          type: string
        duration_type:
          description: Duration type
          enum:
            - fixed
            - monthly_rolling
          example: fixed
          type: string
        duration_unit:
          description: Duration unit
          example: months
          nullable: true
          type: string
        duration_value:
          description: Duration value
          example: 6
          format: int64
          nullable: true
          type: integer
        type:
          description: Discount type
          example: percentage
          type: string
      required:
        - amount
        - duration_type
        - type
      type: object
    SpendingThresholdResponse:
      properties:
        amount:
          description: Spending threshold amount
          example: '500.00'
          type: string
        period:
          description: Billing period for the threshold
          enum:
            - monthly
            - quarterly
            - semi_annual
            - yearly
          example: monthly
          type: string
      required:
        - amount
        - period
      type: object
    PendingChangeResponse:
      properties:
        description:
          description: Change description
          example: Q3 upgrade
          nullable: true
          type: string
        effective_at:
          description: When the change takes effect
          example: '2027-01-01T00:00:00Z'
          format: date-time
          nullable: true
          type: string
        status:
          description: Version status
          example: draft
          type: string
        version_id:
          description: Version ID
          example: subv_abc123
          type: string
      required:
        - status
        - version_id
      type: object
    PriceEscalationResponse:
      properties:
        enabled:
          description: Whether price escalation is enabled
          example: true
          type: boolean
        escalate_metered_unit_rates:
          description: Whether to escalate metered unit rates
          example: false
          nullable: true
          type: boolean
        interval_months:
          description: Interval between escalations in months
          example: 12
          format: int64
          type: integer
        percentage:
          description: Escalation percentage
          example: '5.00'
          nullable: true
          type: string
        type:
          description: Escalation type
          example: percentage
          type: string
      required:
        - enabled
        - interval_months
        - type
      type: object
    RenewalResponse:
      properties:
        auto_renew:
          description: Whether the subscription auto-renews
          example: true
          type: boolean
        duration_months:
          description: Renewal duration in months
          example: 12
          format: int64
          nullable: true
          type: integer
        period_type:
          description: Renewal period type
          example: fixed
          nullable: true
          type: string
      required:
        - auto_renew
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: API Key
      description: API key authentication. Pass your API key as a Bearer token.
      scheme: bearer
      type: http

````