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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Pause Subscription

> Pauses an active subscription, allowing it to later resume or be canceled.

Calling this endpoint will change the subscription `status` to PAUSED. This status can be changed to ACTIVE or CANCELED.

## Pause for a set time

A pause is open-ended by default: the subscription stays `PAUSED` until you resume it. Sending a body with a duration schedules the resume in advance, and the subscription returns on its own when that moment arrives.

Give the duration one of two ways, never both:

* `pause_cycles` — an integer from 1 to 3, counted from the pause in the subscription's own frequency.
* `pause_until` — an RFC 3339 instant. It must be in the future and fall before `availability.finish_at` when the subscription has one.

`billing_cycle_behavior` is optional and decides the billing date when the subscription resumes, with the same `KEEP`/`RESTART` meanings as on [Resume Subscription](https://docs.y.uno/reference/subscriptions/resume-subscription.md#keep-and-restart-compared): `KEEP` (the default) holds the original billing date, `RESTART` re-anchors from the resume. Sending it without `pause_cycles` or `pause_until` is accepted — an open-ended pause that just records the behaviour for whenever the subscription is later resumed.

`reason` is an optional free-form string, at most 255 characters, stored on the subscription's `reason` field. A later `GET` on the subscription echoes it back, and it stays until something else overwrites it — a resume that sends its own `reason`, for example.

```json Pause for two cycles theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{ "pause_cycles": 2 }
```

```json Pause until a date theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{ "pause_until": "2026-09-22T15:47:04.964Z" }
```

```json Pause and re-anchor on resume theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{ "pause_cycles": 1, "billing_cycle_behavior": "RESTART" }
```

```json Pause with a reason theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{ "pause_cycles": 1, "reason": "customer requested a break" }
```

`pause_cycles` is resolved once, at the moment of the pause: the resolved instant is the pause instant plus `pause_cycles` × the subscription's frequency. The subscription then carries that instant as `pause_until` on every later read while it stays paused — a pause given in cycles and one given as a date are indistinguishable afterwards. For example, `{ "pause_cycles": 1 }` on a monthly subscription paused at `2026-09-15T15:54:18Z` resolves to `pause_until: "2026-10-15T15:54:22.780166Z"`.

### What happens while it is paused, and when it returns

No cycle is charged during the pause. While a duration is running, the subscription carries `pause_until` on every read; it returns to the status it was billing under on its own, within about a minute of that instant, and a `subscription.resume` webhook arrives carrying `resume_reason: SCHEDULED`. A manual resume before that instant cancels the schedule — call [Resume Subscription](https://docs.y.uno/reference/subscriptions/resume-subscription.md) yourself at any time to end the pause early. If the automatic resume cannot be completed after its retries, the subscription stays `PAUSED` and a [`subscription.auto_resume_failed`](https://docs.y.uno/docs/webhooks/object-and-examples#subscription-auto_resume_failed) event is sent instead.

> [!NOTE]
>
> **Availability**
>
> Pausing for a set time, and the `reason` field, are available to organizations enabled for it; contact Yuno.

### Errors

| HTTP | `code` | When |
| - | - | - |
| `400` | `BAD_REQUEST` | Both `pause_cycles` and `pause_until` are sent — `"pause_cycles cannot be combined with pause_until."` |
| `400` | `BAD_REQUEST` | `pause_until` is not in the future — `"pause_until must be in the future."` |
| `400` | `BAD_REQUEST` | `pause_until` falls on or after `availability.finish_at` — the message names both instants. |
| `400` | `BAD_REQUEST` | `pause_cycles` is sent on a subscription with no recurring billing cadence. |
| `400` | `BAD_REQUEST` | The organization is not enabled for `pause_cycles`/`pause_until` and one is sent — the message names the field. |
| `400` | `BAD_REQUEST` | An unrecognized field is sent, refused at the gateway — `"Bad request"` |
| `400` | `INVALID_PARAMETERS` | `billing_cycle_behavior` is not `KEEP` or `RESTART` — `"The field 'billing_cycle_behavior' has an invalid value."` |
| `400` | `INVALID_PARAMETERS` | `pause_cycles` is outside 1–3 — `"The field 'pause_cycles' has a value greater than allowed."` |
| `400` | `BAD_REQUEST` | The request body is malformed JSON, refused at the gateway — `"The field '' wrong data type."` |
| `400` | `INVALID_STATE` | The subscription's status does not support pausing. |

Sending no body at all is an open-ended pause and is never rejected by any of the above.


## OpenAPI

````yaml openapi/subscriptions/pause-subscription.json POST /subscriptions/{subscription_id}/pause
openapi: 3.1.0
info:
  title: subscription
  version: 1.0.2
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /subscriptions/{subscription_id}/pause:
    post:
      summary: Pause Subscription
      operationId: pause-subscription
      parameters:
        - name: subscription_id
          in: path
          description: The unique identifier of a subscription.
          schema:
            type: string
          required: true
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                pause_cycles:
                  type: integer
                  minimum: 1
                  maximum: 3
                  description: >-
                    Pause for this many of the subscription's own billing
                    cycles, starting from the pause. Resolved once, at the
                    pause, into a stored `pause_until`. Cannot be combined with
                    pause_until.
                  example: 1
                pause_until:
                  type: string
                  format: date-time
                  description: >-
                    Pause until this RFC 3339 instant. Must be in the future and
                    before availability.finish_at. Cannot be combined with
                    pause_cycles.
                  example: '2026-09-22T15:47:04.964Z'
                billing_cycle_behavior:
                  type: string
                  enum:
                    - KEEP
                    - RESTART
                  description: >-
                    What happens to the billing anchor when the subscription
                    resumes (manually or automatically). KEEP (default): the
                    original anchor is walked forward by whole periods it
                    missed. RESTART: the anchor re-anchors to the moment of the
                    resume. Sending it without pause_cycles or pause_until is
                    accepted — an open-ended pause that just records the
                    behaviour for whenever the subscription is later resumed.
                  example: RESTART
                reason:
                  type: string
                  maxLength: 255
                  description: >-
                    Free-form reason for the pause, stored on the subscription's
                    reason field. At most 255 characters; blank is treated as
                    absent.
                  example: customer requested a break
            examples:
              PAUSE FOR TWO CYCLES:
                value:
                  pause_cycles: 2
              PAUSE UNTIL A DATE:
                value:
                  pause_until: '2026-09-22T15:47:04.964Z'
              PAUSE AND RE-ANCHOR ON RESUME:
                value:
                  pause_cycles: 1
                  billing_cycle_behavior: RESTART
              PAUSE WITH A REASON:
                value:
                  pause_cycles: 1
                  reason: customer requested a break
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                PAUSE SUBSCRIPTION:
                  value:
                    id: 7304911d-5df9-429e-8488-ad41abea1a4c
                    name: sub_001
                    description: streaming service
                    account_id: 2404911d-5df9-429e-8488-ad41abea1a4b
                    merchant_reference: 001_marzo_23
                    status: PAUSED
                    plan_id: 1904911d-5df9-429e-8488-ad41abea1a4d
                    amount:
                      currency: USD
                      value: 12100
                    frequency:
                      type: MONTH
                      value: 1
                    billing_cycles:
                      total: 10
                      current: 2
                      next_at: '2023-02-16T20:00:00.786342Z'
                    customer_payer:
                      id: 3t04911d-5df9-429e-8488-ad41abea1a2c
                    payment_method:
                      type: CARD
                      vaulted_token: 6104911d-5df9-429e-8488-ad41abea1a4b
                      card: {}
                    availability:
                      start_at: '2024-01-16T00:00:00.786342Z'
                      finish_at: '2024-05-26T20:00:00.786342Z'
                    metadata:
                      - key: sub_ext_id
                        value: AA001
                    payments:
                      - 5104911d-5df9-229e-8468-bd41abea1a4s
                    created_at: '2023-12-16T20:46:54.786342Z'
                    updated_at: '2023-12-16T21:00:54.786342Z'
                    country: US
                    retries:
                      retry_on_decline: false
                      amount: 6
                      strategy: DEFAULT
                      schedule: null
                      stop_on_hard_decline: null
                      cancel_on_exhausted_retries: null
                    additional_data: null
                    trial_period:
                      billing_cycles: 1
                      amount:
                        value: 0
                        currency: USD
                    initial_payment_validation: false
                    reason: null
                    subscription_agreement_id: null
                    soft_descriptor: ACME SUBSCRIPTION
                    renewal_notification_days: null
                    cancellation_time: null
                    cancellation_source: null
                    ending_time: null
                    pending_plan_change: null
                    current_period_start: '2026-10-23T00:00:00Z'
                    current_period_end: '2026-11-23T00:00:00Z'
                PAUSED FOR A SET TIME:
                  value:
                    id: 7304911d-5df9-429e-8488-ad41abea1a4c
                    name: SUB-112 passthrough subject
                    account_id: 2404911d-5df9-429e-8488-ad41abea1a4b
                    country: CO
                    description: null
                    merchant_reference: pa-sub112pt-1789487657670-794215
                    status: PAUSED
                    amount:
                      currency: COP
                      value: 45000
                    frequency:
                      type: MONTH
                      value: 1
                    billing_cycles:
                      total: null
                      current: 2
                      paid: 1
                      next_at: '2026-10-15T15:54:18.312843Z'
                    customer_payer:
                      id: 3t04911d-5df9-429e-8488-ad41abea1a2c
                    payment_method:
                      type: CARD
                      vaulted_token: 6104911d-5df9-429e-8488-ad41abea1a4b
                      card:
                        installments: null
                        network_transaction_id: '615803391389209'
                        usage: USED
                    availability:
                      start_at: '2026-09-15T15:54:18.312843Z'
                      finish_at: null
                    retries:
                      retry_on_decline: false
                      amount: 6
                      strategy: SMART
                      schedule: null
                      stop_on_hard_decline: null
                      cancel_on_exhausted_retries: null
                    metadata: null
                    additional_data: null
                    trial_period:
                      billing_cycles: 1
                      amount:
                        value: 0
                        currency: ''
                    initial_payment_validation: false
                    reason: null
                    subscription_agreement_id: null
                    soft_descriptor: null
                    renewal_notification_days: null
                    cancellation_time: null
                    cancellation_source: null
                    ending_time: null
                    created_at: '2026-09-15T15:54:18.312843Z'
                    updated_at: '2026-09-15T15:54:22.783678Z'
                    pending_plan_change: null
                    current_period_start: '2026-09-15T15:54:18.312843Z'
                    current_period_end: '2026-10-15T15:54:18.312843Z'
                    pause_until: '2026-10-15T15:54:22.780166Z'
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: 7304911d-5df9-429e-8488-ad41abea1a4c
                  name:
                    type: string
                    example: sub_001
                  description:
                    type: string
                    example: streaming service
                    nullable: true
                  account_id:
                    type: string
                    example: 2404911d-5df9-429e-8488-ad41abea1a4b
                  merchant_reference:
                    type: string
                    example: 001_marzo_23
                  status:
                    type: string
                    example: PAUSED
                  subscription_plan_id:
                    type: string
                    example: 1904911d-5df9-429e-8488-ad41abea1a4d
                  amount:
                    type: object
                    properties:
                      currency:
                        type: string
                        example: USD
                      value:
                        type: number
                        example: 12100
                        default: 0
                  frequency:
                    type: object
                    properties:
                      type:
                        type: string
                        example: MONTH
                      value:
                        type: integer
                        example: 1
                        default: 0
                      monthly_billing_day:
                        type: integer
                        nullable: true
                        description: >-
                          The day of the month billing is anchored to on a
                          MONTH-frequency subscription — set by RESTART (on
                          Update, a plan change, resume or reactivate) or by
                          sending Update Subscription's own
                          frequency.monthly_billing_day. Present only once
                          stamped; absent, not null, before that and on every
                          other frequency type.
                        example: 15
                  billing_cycles:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 10
                        default: 0
                        nullable: true
                      current:
                        type: integer
                        example: 2
                        default: 0
                      next_at:
                        type: string
                        example: '2023-02-16T20:00:00.786342Z'
                      scheduling_date:
                        type: string
                        description: >-
                          When the debit instruction is handed to the Pix rail —
                          `next_at` minus four days. Only present on
                          `PIX_AUTOMATIC` subscriptions that Yuno executes, and
                          only where the four-day scheduling lead is enabled for
                          the organization; absent, not `null`, otherwise.
                          Read-only. See [Pix
                          Automático](/docs/payment-features/subscriptions/pix-automatico#the-scheduling-date).
                        example: '2026-11-27T00:00:00Z'
                      paid:
                        type: integer
                        description: >-
                          How many cycles have been paid so far. Distinct from
                          `current`, which is the cycle being billed.
                  customer_payer:
                    type: object
                    properties:
                      id:
                        type: string
                        example: 3t04911d-5df9-429e-8488-ad41abea1a2c
                  payment_method:
                    type: object
                    properties:
                      type:
                        type: string
                        example: CARD
                      token:
                        type: string
                        example: 9104911d-5df9-429e-8488-ad41abea1a4b
                      vaulted_token:
                        type: string
                        example: 6104911d-5df9-429e-8488-ad41abea1a4b
                      card:
                        type: object
                        properties:
                          verify:
                            type: boolean
                            example: false
                            default: true
                          card_data:
                            type: object
                            properties:
                              number:
                                type: string
                                example: '4507990000000010'
                              expiration_month:
                                type: integer
                                example: 10
                                default: 0
                              expiration_year:
                                type: integer
                                example: 2025
                                default: 0
                              security_code:
                                type: integer
                                example: 123
                                default: 0
                              holder_name:
                                type: string
                                example: JOHN DOE
                          installments:
                            type: integer
                            nullable: true
                          network_transaction_id:
                            type: string
                            nullable: true
                          usage:
                            type: string
                            example: FIRST
                        nullable: true
                    description: >-
                      The payment method the subscription charges. A single
                      object, not a list.
                  availability:
                    type: object
                    properties:
                      start_at:
                        type: string
                        example: '2024-01-16T00:00:00.786342Z'
                      finish_at:
                        type: string
                        example: '2024-05-26T20:00:00.786342Z'
                        nullable: true
                  metadata:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                          example: sub_ext_id
                        value:
                          type: string
                          example: AA001
                    nullable: true
                  payments:
                    type: array
                    items:
                      type: string
                      example: 5104911d-5df9-229e-8468-bd41abea1a4s
                    description: >-
                      List of payment IDs created by the subscription. Omitted
                      from the response when the subscription has no payments.
                  created_at:
                    type: string
                    example: '2023-12-16T20:46:54.786342Z'
                  updated_at:
                    type: string
                    example: '2023-12-16T21:00:54.786342Z'
                  country:
                    type: string
                    description: The subscription's country (ISO 3166-1 alpha-2).
                    example: US
                  soft_descriptor:
                    type: string
                    description: Soft descriptor.
                    example: ACME SUBSCRIPTION
                    nullable: true
                  current_period_start:
                    type: string
                    nullable: true
                    description: >-
                      Start of the billing period the subscription is currently
                      in, one cadence before `current_period_end`. Inside a
                      trial or any other plan phase it follows that phase's
                      cadence. A terminal subscription (`CANCELED` or
                      `COMPLETED`) keeps its final window rather than going
                      null. Null only for a subscription with no recurring
                      cadence. Always returned together with current_period_end.
                    example: '2023-01-16T20:00:00.912480Z'
                  current_period_end:
                    type: string
                    nullable: true
                    description: >-
                      End of the billing period the subscription is currently
                      in. Equal to billing_cycles.next_at. Always returned
                      together with current_period_start.
                    example: '2023-02-16T20:00:00.786342Z'
                  billing_date:
                    type: object
                    nullable: true
                    description: >-
                      Only present on subscriptions billed on a fixed date
                      instead of a frequency; mutually exclusive with
                      `frequency`.
                    properties:
                      type:
                        type: string
                        example: DAY
                      day:
                        type: integer
                        example: 2
                  retries:
                    type: object
                    nullable: true
                    description: >-
                      The retry policy applied when a recurring charge is
                      declined. See
                      [Retries](/docs/payment-features/subscriptions/retries).
                    properties:
                      retry_on_decline:
                        type: boolean
                        description: Whether declined charges are retried at all.
                        example: true
                      amount:
                        type: integer
                        description: >-
                          How many retries a billing cycle gets. Capped by your
                          environment's retry schedule length (6 in production).
                        example: 4
                      strategy:
                        type: string
                        description: >-
                          How the timing of each retry is decided: `DEFAULT`,
                          `SMART` or `CUSTOM_SCHEDULE`. Treat as open-ended —
                          handle unrecognized values gracefully.
                        example: DEFAULT
                      schedule:
                        type: array
                        nullable: true
                        description: >-
                          The per-attempt schedule, only set when `strategy` is
                          `CUSTOM_SCHEDULE`; `null` otherwise.
                        items:
                          type: object
                      stop_on_hard_decline:
                        type: boolean
                        nullable: true
                        description: >-
                          When true, a hard decline stops the retries for the
                          current billing cycle.
                      cancel_on_exhausted_retries:
                        type: boolean
                        nullable: true
                        description: >-
                          When true, the subscription is canceled once a cycle's
                          retries end without a successful payment, with
                          `cancellation_source` set to `RETRIES_EXHAUSTED`.
                      profile:
                        type: string
                        description: >-
                          The fixed retry ladder the subscription follows
                          instead of the configurable schedule. Always
                          `PIX_AUTOMATIC`. This field and the three below are
                          only present on `PIX_AUTOMATIC` subscriptions that
                          Yuno executes; they are absent, not `null`, on every
                          other payment method. See [Pix
                          Automático](/docs/payment-features/subscriptions/pix-automatico#the-retry-ladder).
                        example: PIX_AUTOMATIC
                      max_attempts:
                        type: integer
                        description: >-
                          How many retries the Pix ladder runs. Always 3,
                          matching the `amount` reported for these
                          subscriptions.
                        example: 3
                      min_gap_hours:
                        type: integer
                        description: >-
                          Always 24 — the gap between the ladder's debit dates
                          (`D`, `D+1`, `D+2`, `D+3`), not between dispatch
                          attempts.
                        example: 24
                      until:
                        type: string
                        description: >-
                          When the ladder stops — `billing_cycles.next_at` plus
                          7 days. Moves with `next_at` at every renewal.
                      stopped:
                        type: boolean
                        description: >-
                          Present only when the subscription is PAST_DUE or has
                          cancel_scheduled pending.
                      attempts_made:
                        type: integer
                        description: >-
                          Present only when the subscription is PAST_DUE or has
                          cancel_scheduled pending.
                      outcome:
                        type: string
                        description: >-
                          RECOVERED, EXHAUSTED or ABANDONED. Present only when
                          the subscription is PAST_DUE or has cancel_scheduled
                          pending.
                      next_retry_at:
                        type: string
                        description: >-
                          Present only when the subscription is PAST_DUE or has
                          cancel_scheduled pending.
                  trial_period:
                    type: object
                    description: Trial period.
                    properties:
                      billing_cycles:
                        type: integer
                        example: 1
                        default: 0
                      amount:
                        type: object
                        properties:
                          value:
                            type: number
                            example: 0
                            default: 0
                          currency:
                            type: string
                            example: USD
                  additional_data:
                    type: object
                    nullable: true
                    description: >-
                      The optional order enrichment sent at creation, echoed
                      back. See [The Subscription
                      Object](/reference/subscriptions/the-subscription-object)
                      for its full shape.
                  initial_payment_validation:
                    type: boolean
                    description: >-
                      Whether the subscription waited for its first payment to
                      succeed before activating. `false` by default.
                    example: false
                  reason:
                    type: string
                    nullable: true
                    description: >-
                      Free-form reason for the subscription's current status,
                      when one was recorded; `null` otherwise.
                    example: merchant request
                  renewal_notification_days:
                    type: integer
                    nullable: true
                    description: >-
                      How many days before the next billing date the
                      `subscription.close_to_renewal` webhook is sent. `null`
                      means no renewal notification is sent.
                    example: 3
                  subscription_agreement_id:
                    type: string
                    description: Subscription agreement id.
                    example: sa_6af2dfcd-44c0-4f16-a331-8bed3ed9c9fa
                    nullable: true
                  cancellation_time:
                    type: string
                    nullable: true
                    description: >-
                      When the subscription was canceled. Only set once it
                      reaches `CANCELED`; `null` otherwise.
                    example: '2023-12-16T20:46:54.786342Z'
                  cancellation_source:
                    type: string
                    nullable: true
                    description: >-
                      What triggered the cancellation: `MERCHANT`, `SYSTEM`,
                      `PLAN_CHANGE` or `RETRIES_EXHAUSTED`. Only set once the
                      subscription reaches `CANCELED`; `null` otherwise. Treat
                      as open-ended — handle unrecognized values gracefully.
                    example: MERCHANT
                  ending_time:
                    type: string
                    nullable: true
                    description: >-
                      When the subscription completed or expired. Only set once
                      it reaches `COMPLETED`; `null` otherwise.
                    example: '2024-12-16T20:46:54.786342Z'
                  plan_id:
                    type: string
                    description: Only present when the subscription is linked to a plan.
                    example: 00000000-0000-4000-8000-000000000001
                  plan_assigned_at:
                    type: string
                    description: >-
                      Only present on plan-linked subscriptions. The moment the
                      plan was attached — at creation from a plan, migration
                      onto a plan, or a plan change.
                    example: '2023-12-16T20:46:54.786342Z'
                  previous_subscription_id:
                    type: string
                    description: >-
                      Only present when this subscription was created by a plan
                      change (switching an existing subscription to a different
                      plan).
                    nullable: true
                  phases:
                    type: array
                    description: >-
                      The linked plan's phase definitions, as the plan declares
                      them — including the terminal `REGULAR` phase. Only
                      present on plan-linked subscriptions whose plan has
                      phases. This is the plan's own ladder, not this
                      subscriber's snapshot: for what was pinned for this
                      subscription at creation, use `billing_phases`.
                    items:
                      type: object
                      properties:
                        order:
                          type: integer
                        name:
                          type: string
                        type:
                          type: string
                          description: '`TRIAL` or `REGULAR`.'
                        duration:
                          type: object
                          nullable: true
                          description: >-
                            How long the phase lasts. `null` on the terminal
                            `REGULAR` phase, which runs until the subscription
                            ends.
                          properties:
                            type:
                              type: string
                            value:
                              type: integer
                        frequency:
                          type: object
                          nullable: true
                          description: >-
                            How often the phase bills. `null` on the terminal
                            `REGULAR` phase, which bills at the plan's own
                            frequency.
                          properties:
                            type:
                              type: string
                            value:
                              type: integer
                        amount:
                          type: object
                          nullable: true
                          description: >-
                            The phase price. `null` on the terminal `REGULAR`
                            phase, whose price resolves from the plan at every
                            billing.
                          properties:
                            currency:
                              type: string
                            value:
                              type: number
                        total_payments:
                          type: integer
                          nullable: true
                        country_prices:
                          type: array
                          description: >-
                            Per-country overrides of the phase price, empty when
                            the phase has none.
                          items:
                            type: object
                            properties:
                              country:
                                type: string
                              amount:
                                type: object
                                properties:
                                  currency:
                                    type: string
                                  value:
                                    type: number
                  current_phase:
                    type: string
                    description: Only present on plan-linked subscriptions.
                    example: REGULAR
                  current_phase_end:
                    type: string
                    nullable: true
                    description: >-
                      When the phase named by `current_phase` hands over to the
                      next one — for a subscription in its trial, when it
                      switches to the regular price. End of the last billing
                      period the phase covers, so on the final period of a trial
                      it equals `current_period_end`. Null for a subscription
                      with no plan and for one that already left the phase
                      ladder.
                    example: '2023-03-16T20:00:00.786342Z'
                  billing_phases:
                    type: array
                    description: >-
                      Only present on plan-linked subscriptions whose plan has
                      phases. Contains the leading TRIAL phases only,
                      snapshotted at creation — the terminal REGULAR phase is
                      never included, since its price isn't pinned and instead
                      resolves from the plan at every billing. `current_phase:
                      "REGULAR"` is how you know the ladder is exhausted.
                    items:
                      type: object
                      properties:
                        order:
                          type: integer
                        type:
                          type: string
                          description: >-
                            Always TRIAL — the terminal REGULAR phase is never
                            in this array.
                        name:
                          type: string
                        amount:
                          type: object
                          properties:
                            currency:
                              type: string
                            value:
                              type: number
                        frequency:
                          type: object
                          properties:
                            type:
                              type: string
                            value:
                              type: integer
                        start_cycle:
                          type: integer
                        end_cycle:
                          type: integer
                  pending_plan_change:
                    type: object
                    nullable: true
                    description: >-
                      The plan change scheduled for the next billing cycle, or
                      null when none is pending. Schedule one with the
                      `plan_change` block on Update Subscription.
                    properties:
                      plan_id:
                        type: string
                        description: The identifier of the target plan.
                        example: 1904911d-5df9-429e-8488-ad41abea1a4d
                      plan_name:
                        type: string
                        description: The name of the target plan.
                        example: Pro
                      direction:
                        type: string
                        enum:
                          - UPGRADE
                          - DOWNGRADE
                        description: >-
                          Whether the target plan is an upgrade or a downgrade.
                          Informational only.
                        example: UPGRADE
                      effective:
                        type: string
                        enum:
                          - NEXT_BILLING_CYCLE
                        description: When the change applies.
                        example: NEXT_BILLING_CYCLE
                      phases_behavior:
                        type: string
                        enum:
                          - START_FROM_REGULAR
                          - HONOR_PHASES
                        description: What happens when the target plan has phases.
                        example: START_FROM_REGULAR
                      applies_at:
                        type: string
                        description: >-
                          The billing event the change will take effect on — the
                          subscription's next billing date.
                        example: '2023-02-16T20:00:00.786342Z'
                      requested_at:
                        type: string
                        description: When the change was scheduled.
                        example: '2023-01-20T10:12:31.786342Z'
                  refund_rule:
                    type: object
                    description: >-
                      The stored refund rule used to resolve a CUSTOM cancel
                      refund when the cancel request sends no refund_amount of
                      its own. Present only when one is configured; omitted, not
                      null, otherwise. Available to organizations enabled for
                      it; contact Yuno.
                    properties:
                      type:
                        type: string
                        enum:
                          - PERCENT
                          - FIXED
                        description: >-
                          PERCENT resolves the refund as a percentage of the
                          charged amount; FIXED resolves it to a fixed amount.
                        example: FIXED
                      percent:
                        type: number
                        description: >-
                          Required, and only allowed, when type is PERCENT
                          (0-100).
                        example: 50
                      amount:
                        type: object
                        description: Required, and only allowed, when type is FIXED.
                        properties:
                          value:
                            type: number
                            example: 10000
                          currency:
                            type: string
                            description: Must match the subscription's own currency.
                            example: COP
                  pause_until:
                    type: string
                    description: >-
                      When the subscription is scheduled to resume
                      automatically. Present only on a subscription currently
                      paused with a duration (pause_cycles or pause_until sent
                      at pause); absent, not null, on every other read.
                    example: '2026-10-15T15:54:22.780166Z'
                  cancel_scheduled:
                    type:
                      - object
                      - 'null'
                    description: null when no cancellation is pending.
                    properties:
                      mode:
                        type: string
                        example: AFTER_CYCLES
                      after_cycles:
                        type: integer
                        example: 3
                      at:
                        type: string
                      requested_at:
                        type: string
                      past_due_behavior:
                        type: string
                        example: EXHAUST_RETRIES
                  refund:
                    type:
                      - object
                      - 'null'
                    description: >-
                      null when refund was NONE or omitted. Present on the
                      cancel response and on every later read once computed.
                    properties:
                      mode:
                        type: string
                        example: PRORATED
                      amount:
                        type: object
                        properties:
                          currency:
                            type: string
                            example: USD
                          value:
                            type: number
                            example: 20
                      unused_days:
                        type: integer
                        example: 20
                      period_days:
                        type: integer
                        example: 30
                      basis:
                        type: object
                        properties:
                          billing_cycle:
                            type: integer
                            example: 4
                          charged_amount:
                            type: object
                            properties:
                              currency:
                                type: string
                                example: USD
                              value:
                                type: number
                                example: 30
                          payment_id:
                            type: string
                            description: >-
                              null for a $0-phase quote with no captured
                              payment.
                          charged_at:
                            type: string
                            description: >-
                              null for a $0-phase quote with no captured
                              payment.
                      execution:
                        type: string
                        example: MERCHANT
                      quoted_at:
                        type: string
                  unpaid_cycle:
                    type: object
                    description: >-
                      Present only when the current billing cycle is PAST_DUE
                      and has not settled.
                    properties:
                      cycle_number:
                        type: integer
                      amount:
                        type: object
                        properties:
                          currency:
                            type: string
                          value:
                            type: number
                      attempts:
                        type: integer
                      last_failure_code:
                        type: string
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: INVALID_STATE
                    messages:
                      - >-
                        The subscription state does not support the action
                        requested.
                SUBSCRIPTION NOT FOUND:
                  value:
                    code: SUBSCRIPTION_NOT_FOUND
                    messages:
                      - Subscription not found.
                  summary: >-
                    No subscription resolves for the subscription_id on this
                    account. Returned as 400, not 404.
                PAUSE_CYCLES COMBINED WITH PAUSE_UNTIL:
                  value:
                    code: BAD_REQUEST
                    messages:
                      - pause_cycles cannot be combined with pause_until.
                PAUSE_UNTIL NOT IN THE FUTURE:
                  value:
                    code: BAD_REQUEST
                    messages:
                      - pause_until must be in the future.
                UNKNOWN FIELD (GATEWAY):
                  value:
                    code: BAD_REQUEST
                    messages:
                      - Bad request
                INVALID BILLING CYCLE BEHAVIOR (GATEWAY):
                  value:
                    code: INVALID_PARAMETERS
                    messages:
                      - The field 'billing_cycle_behavior' has an invalid value.
                PAUSE_CYCLES OUT OF RANGE (GATEWAY):
                  value:
                    code: INVALID_PARAMETERS
                    messages:
                      - >-
                        The field 'pause_cycles' has a value greater than
                        allowed.
                MALFORMED JSON (GATEWAY):
                  value:
                    code: BAD_REQUEST
                    messages:
                      - The field '' wrong data type.
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: public-api-key
      x-default: <Your public-api-key>
    sec1:
      type: apiKey
      in: header
      name: private-secret-key
      x-default: <Your private-secret-key>

````

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