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

# Retry Subscription

> Manually retries a subscription's most recent declined payment for the current billing cycle.

Use this endpoint to manually retry the most recent failed payment of a subscription. This is useful when a customer updates their payment method or resolves a payment issue (e.g., insufficient funds, expired card) mid-billing cycle, since subscription updates only take effect starting from the next billing cycle. Calling this endpoint forces a new charge attempt for the current cycle using the latest subscription configuration.

* Only the **most recent payment** of the subscription can be retried.
* Multiple manual retries can be executed **only if** the previous retry attempt resulted in a DECLINED status.
* Manually triggering a retry **stops** the [smart retry scheme](https://docs.y.uno/docs/retries.md) for the corresponding payment. The following payments of the subscription will follow the smart retry scheme if enabled in the creation.
* After the successful retry attempt, the system **continues** with the next scheduled subscription charge.
* If neither condition is met, the request returns `400` with code **INVALID\_STATE** and the message `The last payment intent of the subscription does not support the action requested.` The same error is returned when the subscription is canceled.
* If no subscription matches `subscription_id` on the account, the request returns `400` with code **SUBSCRIPTION\_NOT\_FOUND**.


## OpenAPI

````yaml openapi/subscriptions/retry-subscription.json POST /subscriptions/{subscription_id}/retry
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}/retry:
    post:
      summary: Retry Subscription
      operationId: retry-subscription
      parameters:
        - name: subscription_id
          in: path
          description: >-
            The unique identifier of the subscription, see [create
            subscription](/reference/create-subscription) (UUID).
          schema:
            type: string
          required: true
        - in: header
          name: X-Account-Code
          schema:
            type: string
          description: >-
            The `account_id` found in your [Yuno
            Dashboard](https://dashboard.y.uno/developers) (UUID).
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    id: 0054840f-bcd5-4d8e-b86c-c18ede81c556
                    name: Test Subscription
                    account_id: f7c5fe77-721b-49c2-84d3-957748df3c2c
                    country: CL
                    description: Subscription Test
                    merchant_reference: subscription-ref-merchant-AA01
                    status: ACTIVE
                    amount:
                      currency: CLP
                      value: 15000
                    frequency:
                      type: MONTH
                      value: 1
                    billing_cycles:
                      total: 12
                      current: 2
                      next_at: '2025-05-29T11:13:31.786421Z'
                    customer_payer:
                      id: 1c6d1a88-d8d5-4c09-b19c-852530d89f05
                    payment_method:
                      type: CARD
                      vaulted_token: 743880c1-1bdb-4572-99a8-c4e5ce184895
                    availability:
                      start_at: '2025-04-29T11:13:31.786421Z'
                      finish_at: null
                    retries:
                      retry_on_decline: false
                      amount: 6
                    metadata: null
                    additional_data: null
                    trial_period:
                      billing_cycles: 1
                      amount:
                        value: 0
                        currency: ''
                    initial_payment_validation: false
                    created_at: '2025-04-29T11:13:31.786421Z'
                    updated_at: '2025-04-29T11:13:31.942325Z'
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: 0054840f-bcd5-4d8e-b86c-c18ede81c556
                  name:
                    type: string
                    example: Test Subscription
                  account_id:
                    type: string
                    example: f7c5fe77-721b-49c2-84d3-957748df3c2c
                  country:
                    type: string
                    example: CL
                  description:
                    type: string
                    example: Subscription Test
                  merchant_reference:
                    type: string
                    example: subscription-ref-merchant-AA01
                  status:
                    type: string
                    example: ACTIVE
                  amount:
                    type: object
                    properties:
                      currency:
                        type: string
                        example: CLP
                      value:
                        type: number
                        example: 15000
                        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: 12
                        default: 0
                      current:
                        type: integer
                        example: 2
                        default: 0
                      next_at:
                        type: string
                        example: '2025-05-29T11:13:31.786421Z'
                      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: 1c6d1a88-d8d5-4c09-b19c-852530d89f05
                  payment_method:
                    type: object
                    properties:
                      type:
                        type: string
                        example: CARD
                      vaulted_token:
                        type: string
                        example: 743880c1-1bdb-4572-99a8-c4e5ce184895
                      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: '2025-04-29T11:13:31.786421Z'
                      finish_at: {}
                  retries:
                    type: object
                    properties:
                      retry_on_decline:
                        type: boolean
                        example: false
                        default: true
                      amount:
                        type: integer
                        example: 6
                        default: 0
                      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.
                  metadata: {}
                  additional_data: {}
                  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: ''
                  initial_payment_validation:
                    type: boolean
                    example: false
                    default: true
                  created_at:
                    type: string
                    example: '2025-04-29T11:13:31.786421Z'
                  updated_at:
                    type: string
                    example: '2025-04-29T11:13:31.942325Z'
                  soft_descriptor:
                    type: string
                    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
                  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'
                  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 last payment intent of the subscription 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.
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: INVALID_STATE
                  messages:
                    type: array
                    items:
                      type: string
                      example: >-
                        The last payment intent of the subscription does not
                        support the action requested.
      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.