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

# Retrieve a Subscription

> Returns one of your subscriptions by its public id: its status, billing interval, line items and billing dates. Cancel, pause and resume return the same object.

```bash Curl theme={null}
curl "https://api-sandbox.paywithsoap.com/api/v1/subscriptions/sub_7Hn2Kq9Wx4Lm8Pz3Rt6Vb1Ys5JdCfEaG" \
  -H "Authorization: Bearer YOUR_API_KEY"
```


## OpenAPI

````yaml GET /api/v1/subscriptions/{id}
openapi: 3.1.0
info:
  title: Soap API
  description: >-
    API documentation for Soap - AI-native payments infrastructure for complex,
    compliance-heavy payment flows
  license:
    name: MIT
  version: 1.4.0
servers:
  - url: https://api-sandbox.paywithsoap.com
security:
  - bearerAuth: []
paths:
  /api/v1/subscriptions/{id}:
    get:
      tags:
        - Subscriptions
      summary: Retrieve a subscription
      description: >-
        Returns one of your subscriptions by its public id: its status, billing
        interval, line items and billing dates. Cancel, pause and resume return
        the same object.
      parameters:
        - name: id
          in: path
          required: true
          description: Public id of the subscription.
          schema:
            type: string
            example: sub_7Hn2Kq9Wx4Lm8Pz3Rt6Vb1Ys5JdCfEaG
      responses:
        '200':
          description: The subscription.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '401':
          description: >-
            Missing, unknown or inactive API key. The key is checked before the
            request body is read, so a request without a valid key never gets a
            400 or 422. The response never echoes the request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  hint:
                    type: string
                  code:
                    type: string
                    enum:
                      - invalid_api_key
                    description: >-
                      Stable machine-readable code. Branch on this, not on
                      `error`.
              example:
                error: API key not found.
                hint: >-
                  Send an active API key in the Authorization header as a Bearer
                  token.
                code: invalid_api_key
        '422':
          description: No subscription with this id belongs to your business.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Subscription not found.
                  hint:
                    type: string
      security:
        - bearerAuth: []
components:
  schemas:
    Subscription:
      type: object
      description: A subscription as the merchant API returns it.
      properties:
        id:
          type: string
          example: sub_7Hn2Kq9Wx4Lm8Pz3Rt6Vb1Ys5JdCfEaG
        customer_id:
          type: string
          example: cus_3Lm8Pz3Rt6Vb1Ys5JdCfE7Hn2Kq9WxaG
        status:
          type: string
          enum:
            - incomplete
            - active
            - past_due
            - paused
            - canceled
          description: >-
            Derived from the billing dates each time you read it. `incomplete`
            until the first payment succeeds. `active` while billing runs, when
            the first payment went through while renewals were off for your
            account, and for a subscription canceled for the end of its paid
            period, until `ends_at`. `past_due` after a renewal failed, or while
            a declined renewal waits for its retry. `paused` while the merchant
            has paused billing: nothing renews until it is resumed. `canceled`
            once a canceled subscription's `ends_at` has passed.
        interval:
          type: string
          enum:
            - day
            - week
            - month
            - year
        interval_count:
          type: integer
          example: 1
        line_items:
          type: array
          items:
            type: object
            properties:
              product_id:
                type: string
              sku:
                type:
                  - string
                  - 'null'
              product_name:
                type: string
              product_url:
                type:
                  - string
                  - 'null'
              quantity:
                type: integer
              price_cents:
                type: integer
              total_amount_cents:
                type: integer
        line_items_total_amount_cents:
          type: integer
          example: 4200
        current_period_end:
          type:
            - string
            - 'null'
          format: date-time
          description: End of the period the customer has paid for.
        next_billing_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the next renewal is charged; while a declined renewal waits for
            its retry, when that retry is charged. Null while paused, canceled,
            or after a renewal failed.
        canceled_at:
          type:
            - string
            - 'null'
          format: date-time
        ends_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When a canceled subscription stops being active. Null unless
            canceled.
        paused_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the merchant paused billing. Null unless paused.
        created_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token authentication using your API key (key_...). Used for every
        endpoint except POST /api/v1/device_pings.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.