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

# Update Subscription



## OpenAPI

````yaml PATCH /subscriptions/{subscription_id}
openapi: 3.0.3
info:
  title: Atlas API
  description: >
    Processor-agnostic payment orchestration API with Basis Theory for PCI-free
    tokenization.


    ## Authentication


    All API requests require authentication using an API key in the
    `Authorization` header:

    ```

    Authorization: Bearer sk_test_your_api_key

    ```


    ## Payment Methods


    Atlas supports multiple payment methods:

    - **Card**: Credit and debit cards tokenized via Basis Theory

    - **Apple Pay**: Native Apple Pay integration

    - **Google Pay**: Native Google Pay integration

    - **Bank Account (ACH)**: US bank account payments


    ## Environments


    - **Test**: Use `sk_test_` prefixed keys

    - **Live**: Use `sk_live_` prefixed keys
  version: 1.0.0
  contact:
    name: Atlas Support
    url: https://atlas.co/support
servers:
  - url: https://api.atlas.co/functions/v1
    description: Production API
security:
  - ApiKeyAuth: []
tags:
  - name: Sessions
    description: Payment session management
  - name: Payments
    description: Payment confirmation and processing
  - name: Customers
    description: Customer management
  - name: Products
    description: Product catalog management
  - name: Prices
    description: Price configuration
  - name: Subscriptions
    description: Subscription billing
  - name: Invoices
    description: Invoice management
  - name: Coupons
    description: Discount coupons
  - name: Usage Records
    description: Metered billing usage
  - name: Checkout
    description: Hosted checkout pages
  - name: Portal
    description: Customer self-service portal
  - name: Bank Accounts
    description: ACH bank account management
  - name: Identity Vault
    description: PII tokenization and storage
  - name: KYC
    description: Identity verification
  - name: Ledger
    description: Double-entry ledger accounting
  - name: 3D Secure
    description: 3DS authentication
  - name: Network Tokens
    description: Network token management
  - name: Apple Pay
    description: Apple Pay integration
paths:
  /subscriptions/{subscription_id}:
    patch:
      tags:
        - Subscriptions
      summary: Update Subscription
      operationId: updateSubscription
      parameters:
        - $ref: '#/components/parameters/SubscriptionId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionRequest'
      responses:
        '200':
          description: Subscription updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    SubscriptionId:
      name: subscription_id
      in: path
      required: true
      schema:
        type: string
  schemas:
    UpdateSubscriptionRequest:
      type: object
      properties:
        cancel_at_period_end:
          type: boolean
        default_payment_method:
          type: string
        items:
          type: array
          items:
            type: object
            properties:
              price:
                type: string
              quantity:
                type: integer
        proration_behavior:
          type: string
          enum:
            - create_prorations
            - none
        metadata:
          type: object
          additionalProperties:
            type: string
    Subscription:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - subscription
        customer:
          type: string
        status:
          $ref: '#/components/schemas/SubscriptionStatus'
        current_period_start:
          type: integer
        current_period_end:
          type: integer
        trial_start:
          type: integer
        trial_end:
          type: integer
        cancel_at_period_end:
          type: boolean
        canceled_at:
          type: integer
        ended_at:
          type: integer
        collection_method:
          type: string
        days_until_due:
          type: integer
        default_payment_method:
          type: string
        items:
          type: object
          properties:
            object:
              type: string
              enum:
                - list
            data:
              type: array
              items:
                $ref: '#/components/schemas/SubscriptionItem'
        latest_invoice:
          type: string
        metadata:
          type: object
          additionalProperties:
            type: string
        created:
          type: integer
    SubscriptionStatus:
      type: string
      enum:
        - trialing
        - active
        - past_due
        - paused
        - canceled
        - unpaid
    SubscriptionItem:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - subscription_item
        price:
          type: object
          properties:
            id:
              type: string
            product:
              type: string
            unit_amount:
              type: integer
            currency:
              type: string
            recurring:
              type: object
              properties:
                interval:
                  type: string
                interval_count:
                  type: integer
        quantity:
          type: integer
        created:
          type: integer
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            type:
              type: string
              enum:
                - api_error
                - authentication_error
                - card_error
                - invalid_request_error
                - validation_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
            request_id:
              type: string
  responses:
    NotFound:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: API key (sk_test_* or sk_live_*)

````