> ## 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.

# Pause a Subscription

> Stop billing a subscription until you resume it

Pause a subscription to stop charging its renewals, for example while the customer is away. The customer keeps the period they already paid for. No renewal is charged until you [resume](https://docs.paywithsoap.com/api-reference/api-v1/subscriptions/resume.md) the subscription.

## Behavior

* Only an `active` subscription with a renewal scheduled (`next_billing_at` set) can be paused. A subscription that is `past_due`, `incomplete` or canceled returns a 422.
* A renewal Soap has already started (waiting for its charge or being charged) must finish first: pausing then returns a 422, and you can pause once the renewal is paid. A renewal that is due but not started yet is skipped: the paused time is never billed.
* On success the subscription reads `status: "paused"`, with `paused_at` set and `next_billing_at` null.
* Pausing a subscription that is already paused changes nothing and keeps the first `paused_at`.
* The body is optional. `reason` (up to 500 characters) is recorded and sent on the opt-in `subscription.paused` webhook.
* Canceling a paused subscription ends the pause; the subscription stays active until the end of the period the customer paid for.

```bash Curl theme={null}
curl -X POST "https://api-sandbox.paywithsoap.com/api/v1/subscriptions/sub_7Hn2Kq9Wx4Lm8Pz3Rt6Vb1Ys5JdCfEaG/pause" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reason": "customer travelling"}'
```

```json Error (renewal in progress) theme={null}
{
  "error": "A renewal of this subscription is due or being charged: pause it once that renewal is paid.",
  "hint": "GET /api/v1/subscriptions/sub_7Hn2Kq9Wx4Lm8Pz3Rt6Vb1Ys5JdCfEaG shows its status and next_billing_at."
}
```


## OpenAPI

````yaml POST /api/v1/subscriptions/{id}/pause
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}/pause:
    post:
      tags:
        - Subscriptions
      summary: Pause a subscription
      description: >-
        Stops a subscription's billing until you resume it. The customer keeps
        the period they already paid for, and no renewal is charged while the
        subscription is paused. Only an active subscription with a renewal
        scheduled can be paused, and not while a renewal is due or being
        charged. Pausing a paused subscription changes nothing and keeps the
        first `paused_at`. Sends the opt-in `subscription.paused` webhook.
      parameters:
        - name: id
          in: path
          required: true
          description: Public id of the subscription to pause.
          schema:
            type: string
            example: sub_7Hn2Kq9Wx4Lm8Pz3Rt6Vb1Ys5JdCfEaG
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Why billing is paused. Recorded and sent as `reason` on the
                    `subscription.paused` webhook.
                  example: customer travelling
              additionalProperties: false
      responses:
        '200':
          description: >-
            The subscription, with `status: "paused"`, `paused_at` set and
            `next_billing_at` null.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscription'
        '400':
          description: >-
            The request body is not a JSON object: malformed JSON, or a JSON
            array, string or number. An empty body is accepted. The response
            never echoes the body.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  hint:
                    type: string
                  code:
                    type: string
                    enum:
                      - invalid_json
                    description: >-
                      Stable machine-readable code. Branch on this, not on
                      `error`.
              example:
                error: Invalid JSON body.
                hint: >-
                  The request body must be a JSON object. Ensure Content-Type is
                  application/json and the payload is valid JSON.
                code: invalid_json
        '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
        '403':
          $ref: '#/components/responses/SourceNotAllowed'
        '422':
          description: >-
            Unknown subscription or another merchant's, a body with fields other
            than `reason`, or a subscription that cannot be paused (canceled,
            not active, no renewal scheduled, or a renewal due or being
            charged).
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: >-
                      A renewal of this subscription is due or being charged:
                      pause it once that renewal is paid.
                  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
  responses:
    SourceNotAllowed:
      description: >-
        Soap refused the request for your account: Soap enforces an address
        allowlist for your account and the request came from an address outside
        the server addresses your business registered with it
        (`source_not_allowed`; the key itself is valid). Contact Soap support to
        change the addresses.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
              hint:
                type: string
              code:
                type: string
                enum:
                  - source_not_allowed
                description: Stable machine-readable code. Branch on this, not on `error`.
          example:
            error: This API key cannot be used from this address.
            hint: >-
              Requests with this business's API keys are accepted only from the
              server addresses registered with Soap. Contact Soap support to
              change them.
            code: source_not_allowed
  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.