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

# Reactivate Subscription

> Returns a canceled or completed subscription to ACTIVE, keeping the same subscription and history.

Use this endpoint for win-back campaigns. Calling it returns a `CANCELED` or `COMPLETED`
subscription to `ACTIVE` — or to `TRIALING` when a trial phase covers the reactivated cycle —
keeping the same `id` and its full payment history. No successor subscription is ever created
and `previous_subscription_id` is never set by this call. No charge is made on the call itself.

> [!NOTE]
>
> **Allowlisted organizations only**
>
> Reactivation is gated per organization, and this is checked before the subscription's status. If
> your calls return `409` `"Subscription reactivation is not enabled for this organization."`,
> contact your Yuno representative to have it enabled.

## Which subscriptions can be reactivated

| Current `status` | Result |
| - | - |
| `CANCELED` | Reactivated. |
| `COMPLETED` | Reactivated, if billing cycles remain — see [When the billing cycles are used up](#when-the-billing-cycles-are-used-up) below. |
| Any other status | `409` `INVALID_SUBSCRIPTION_STATUS`, naming the current status in `current_status`. A `PAUSED` subscription is resumed with [Resume Subscription](https://docs.y.uno/reference/subscriptions/resume-subscription.md) instead. |

```json 409 — status is not CANCELED or COMPLETED theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "INVALID_SUBSCRIPTION_STATUS",
  "messages": [
    "Only a CANCELED or COMPLETED subscription can be reactivated."
  ],
  "current_status": "ACTIVE"
}
```

A subscription whose `availability.finish_at` has already passed is refused with `400`
`INVALID_DATE`, whatever its status:

```json 400 — availability window already closed theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "INVALID_DATE",
  "messages": [
    "The subscription can not be resume due to a conflict with the availability dates. Please update availability dates and try again if you want to keep using the subscription"
  ]
}
```

## When the billing cycles are used up

A `COMPLETED` subscription that used every cycle in `billing_cycles.total` is refused with `409`
`INVALID_SUBSCRIPTION_STATUS`:

```json 409 — no billing cycles left theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "INVALID_SUBSCRIPTION_STATUS",
  "messages": [
    "The subscription exhausted its 1 billing cycles. Send billing_cycles.total greater than 1 in the reactivate body."
  ],
  "current_status": "COMPLETED"
}
```

Send `billing_cycles.total` with a value higher than the current one to raise the limit and
reactivate in the same call. This does not create a successor — it raises the limit **on the same
subscription**, keeping its `id` and history intact:

```json Raise the limit and reactivate theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "billing_cycles": { "total": 24 }
}
```

Sending `billing_cycles.total`:

| Condition | Result |
| - | - |
| Not greater than the current total | `400` `BAD_REQUEST` — `"billing_cycles.total must be greater than the current total (N)."` |
| The subscription has no billing cycle limit at all | `400` `BAD_REQUEST` — `"billing_cycles.total cannot be set on a subscription without a billing cycle limit."` |
| Not a positive integer | `400` `BAD_REQUEST` — `"billing_cycles.total must be a positive integer."` |

Sending `billing_cycles.total` for a subscription that still has cycles left is accepted the same
way: it raises the limit, it is not restricted to exhausted subscriptions. An explicit
`billing_cycles.total: null` is treated the same as omitting the field — the current total is left
unchanged.

## Choosing the next billing date

`billing_cycle_behavior` is the same axis used on resume and on plan changes.

```json KEEP (default, or omitted) theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{ "billing_cycle_behavior": "KEEP" }

// billing_cycles.next_at -> unchanged while it is still in the future,
// otherwise rolled forward to its next future occurrence
```

```json RESTART theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{ "billing_cycle_behavior": "RESTART" }

// billing_cycles.next_at -> the reactivation instant plus the subscription's frequency
// frequency.monthly_billing_day -> stamped to the day of the reactivation,
// on a monthly subscription that had none
```

No charge is made on the call either way. An invalid value returns `400` `BAD_REQUEST` —
`"billing_cycle_behavior must be one of KEEP, RESTART."` Reactivate has no gateway-side validation
of its own: the same text comes back unchanged through the gateway.

> [!NOTE]
>
> **RESTART and the monthly billing day**
>
> On a monthly subscription that had no `frequency.monthly_billing_day` set, `RESTART` stamps it to
> the day of the reactivation — the same rule Update Subscription and Resume Subscription apply. A
> subscription that already declares a billing day keeps it.

## The payment method

The vaulted payment method is revalidated before the subscription is reactivated. If it is no
longer enrolled, the call returns `400` `PAYMENT_METHOD_STATUS_INVALID` and the subscription is not
modified — the payment method check runs before the status write:

```json 400 — payment method no longer enrolled theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "code": "PAYMENT_METHOD_STATUS_INVALID",
  "messages": [
    "The payment method is a state that does not allow payments to be made."
  ]
}
```

## What reactivation clears

Reactivating a subscription clears:

* `cancellation_time`
* `cancellation_source`
* `ending_time`
* `reason`
* any scheduled cancellation (`cancel_scheduled`)
* any pause that was scheduled to end on its own — a reactivated subscription never carries
  `pause_until`

The `subscription.reactivate` webhook fires once, carrying the reactivated subscription.

## Errors

| HTTP | `code` | When |
| - | - | - |
| `409` | `INVALID_SUBSCRIPTION_STATUS` | Reactivation is not enabled for the organization. |
| `409` | `INVALID_SUBSCRIPTION_STATUS` | The subscription's status is not `CANCELED` or `COMPLETED`. |
| `409` | `INVALID_SUBSCRIPTION_STATUS` | The subscription used up every billing cycle in `billing_cycles.total` and the request did not raise it. |
| `400` | `INVALID_DATE` | `availability.finish_at` has already passed. |
| `400` | `BAD_REQUEST` | `billing_cycles.total` is not greater than the current total, is sent on a subscription with no cycle limit, or is not a positive integer. |
| `400` | `BAD_REQUEST` | `billing_cycle_behavior` is not `KEEP` or `RESTART`. |
| `400` | `BAD_REQUEST` | An unrecognized top-level key, caught by the gateway's own JSON binding before the call reaches the engine — `"Bad request"` |
| `400` | `BAD_REQUEST` | A key other than `total` inside `billing_cycles`, forwarded raw to the engine and refused there — `"Unknown field(s): foo."` |
| `400` | `PAYMENT_METHOD_STATUS_INVALID` | The vaulted payment method is no longer enrolled. |
| `400` | `OPERATION_IN_PROCESS` | Another write against the same subscription is still in progress — `"Operation over the same subscription is already in process. Try again in a few seconds."` |


## OpenAPI

````yaml openapi/subscriptions/reactivate-subscription.json POST /subscriptions/{subscription_id}/reactivate
openapi: 3.1.0
info:
  title: subscription
  version: 1.0.2
servers:
  - url: https://api-sandbox.y.uno/v1
  - url: https://api.eu.y.uno/v1
security:
  - sec0: []
    sec1: []
paths:
  /subscriptions/{subscription_id}/reactivate:
    post:
      summary: Reactivate Subscription
      operationId: reactivate-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:
                billing_cycle_behavior:
                  type: string
                  enum:
                    - KEEP
                    - RESTART
                  description: >-
                    RESTART re-anchors the next charge to now plus the
                    subscription's frequency (and stamps
                    frequency.monthly_billing_day on a monthly subscription that
                    had none). KEEP or omitted: the stored anchor is left
                    untouched while it is still in the future, otherwise rolled
                    forward to its next future occurrence. No charge is made on
                    the call either way.
                  example: RESTART
                billing_cycles:
                  type: object
                  description: >-
                    Raises the subscription's cycle limit so it can be
                    reactivated. Only the nested total is allowed.
                  properties:
                    total:
                      type: integer
                      description: >-
                        Must be a positive integer greater than the
                        subscription's current billing_cycles.total. Rejected on
                        a subscription with no cycle limit at all. A valid value
                        raises the limit on the same subscription.
                      example: 12
            examples:
              RESTART:
                value:
                  billing_cycle_behavior: RESTART
              RAISE THE BILLING CYCLES LIMIT:
                value:
                  billing_cycles:
                    total: 12
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                REACTIVATE SUBSCRIPTION:
                  value:
                    id: 7304911d-5df9-429e-8488-ad41abea1a4c
                    name: SUB-111 merchant reactivate subject
                    account_id: 2404911d-5df9-429e-8488-ad41abea1a4b
                    country: CO
                    description: null
                    merchant_reference: pa-sub111-1789488115936-594232
                    status: ACTIVE
                    amount:
                      currency: COP
                      value: 45000
                    frequency:
                      type: MONTH
                      value: 1
                    billing_cycles:
                      total: 6
                      current: 2
                      paid: 0
                      next_at: '2026-10-15T16:01:56.709393Z'
                    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-15T16:01:56.709393Z'
                      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-15T16:01:56.709393Z'
                    updated_at: '2026-09-15T16:01:58.115702Z'
                    pending_plan_change: null
                    current_period_start: '2026-09-15T16:01:56.709393Z'
                    current_period_end: '2026-10-15T16:01:56.709393Z'
              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
                  country:
                    type: string
                    description: The subscription's country (ISO 3166-1 alpha-2).
                    example: US
                  merchant_reference:
                    type: string
                    example: 001_marzo_23
                  soft_descriptor:
                    type: string
                    example: ACME SUBSCRIPTION
                    nullable: true
                  status:
                    type: string
                    example: ACTIVE
                  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.
                  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
                  customer_payer:
                    type: object
                    properties:
                      id:
                        type: string
                        example: 3t04911d-5df9-429e-8488-ad41abea1a2c
                  payment_method:
                    type: object
                    properties:
                      type:
                        type: string
                        example: CARD
                      vaulted_token:
                        type: string
                        example: 6104911d-5df9-429e-8488-ad41abea1a4b
                      card:
                        type: object
                        properties:
                          installments:
                            type: integer
                            nullable: true
                          network_transaction_id:
                            type: string
                            nullable: true
                          usage:
                            type: string
                            example: FIRST
                        nullable: true
                  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
                  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
                    properties:
                      billing_cycles:
                        type: integer
                        example: 1
                        default: 0
                      amount:
                        type: object
                        properties:
                          value:
                            type: number
                            example: 0
                            default: 0
                          currency:
                            type: string
                            example: ''
                  metadata:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                          example: sub_ext_id
                        value:
                          type: string
                          example: AA001
                    nullable: true
                  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
                  payments:
                    type: array
                    items:
                      type: string
                      example: 5104911d-5df9-229e-8468-bd41abea1a4s
                  subscription_agreement_id:
                    type: string
                    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'
                  created_at:
                    type: string
                    example: '2023-12-16T20:46:54.786342Z'
                  updated_at:
                    type: string
                    example: '2023-12-16T21:00:54.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:
                INVALID_DATE:
                  value:
                    code: INVALID_DATE
                    messages:
                      - >-
                        The subscription can not be resume due to a conflict
                        with the availability dates. Please update availability
                        dates and try again if you want to keep using the
                        subscription
                  summary: >-
                    availability.finish_at is in the past. Sourced from
                    checks/YunoHttpErrorCode-v1.45.0.kt (the enum's default
                    text, which says "resume" verbatim) — not exercised by a
                    live capture.
                billing_cycles.total BELOW THE CURRENT TOTAL:
                  value:
                    code: BAD_REQUEST
                    messages:
                      - >-
                        billing_cycles.total must be greater than the current
                        total (12).
                billing_cycles.total WITHOUT A CYCLE LIMIT:
                  value:
                    code: BAD_REQUEST
                    messages:
                      - >-
                        billing_cycles.total cannot be set on a subscription
                        without a billing cycle limit.
                INVALID BILLING CYCLE BEHAVIOR:
                  value:
                    code: BAD_REQUEST
                    messages:
                      - billing_cycle_behavior must be one of KEEP, RESTART.
                  summary: >-
                    Identical through the gateway — reactivate has no
                    gateway-side validation of its own.
                PAYMENT METHOD NO LONGER ENROLLED:
                  value:
                    code: PAYMENT_METHOD_STATUS_INVALID
                    messages:
                      - >-
                        The payment method is a state that does not allow
                        payments to be made.
                  summary: >-
                    Sourced from checks/YunoHttpErrorCode-v1.45.0.kt — not
                    exercised by a live capture.
                UNKNOWN TOP-LEVEL KEY:
                  value:
                    code: BAD_REQUEST
                    messages:
                      - Bad request
                  summary: >-
                    An unrecognized top-level key is caught by the gateway's own
                    JSON binding (DisallowUnknownFields) before the call reaches
                    the engine. The engine's own guard says "Unknown field(s):
                    foo." instead — see UNKNOWN KEY INSIDE billing_cycles below.
                UNKNOWN KEY INSIDE billing_cycles:
                  value:
                    code: BAD_REQUEST
                    messages:
                      - 'Unknown field(s): foo.'
                  summary: >-
                    billing_cycles is a field the gateway forwards raw, so a key
                    nested inside it reaches the engine unfiltered and is
                    refused by the engine's own unknown-key guard.
        '409':
          description: '409'
          content:
            application/json:
              examples:
                NOT ENABLED FOR THIS ORGANIZATION:
                  value:
                    code: INVALID_SUBSCRIPTION_STATUS
                    messages:
                      - >-
                        Subscription reactivation is not enabled for this
                        organization.
                  summary: >-
                    Sourced from
                    checks/SubscriptionService-v1.45.0-pause-resume-reactivate-cancel.kt
                    — the stg allow-list is `.*`, so this could not be captured
                    live.
                NOT TERMINAL:
                  value:
                    code: INVALID_SUBSCRIPTION_STATUS
                    messages:
                      - >-
                        Only a CANCELED or COMPLETED subscription can be
                        reactivated.
                    current_status: ACTIVE
                BILLING CYCLES EXHAUSTED:
                  value:
                    code: INVALID_SUBSCRIPTION_STATUS
                    messages:
                      - >-
                        The subscription exhausted its 1 billing cycles. Send
                        billing_cycles.total greater than 1 in the reactivate
                        body.
                    current_status: COMPLETED
                  summary: >-
                    Engine-only capture (row 756) — no merchant capture reaches
                    an exhausted subscription in this run; the body shape is
                    identical to the merchant NOT TERMINAL case.
      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.