Cancel Subscription
Cancels a subscription immediately, or schedules the cancellation for a future date or billing cycle.
status to CANCELED. This is unchanged and still final: once immediate, it cannot
be reverted.
You can cancel from CREATED, ACTIVE, TRIALING, PAST_DUE and PAUSED. COMPLETED and
CANCELED are terminal, so canceling from either returns 400 INVALID_STATE — including a second
cancel on a subscription that is already canceled. See Subscription Status.
Refund on immediate cancel
400 "Refund quote is not enabled for this organization", contact your Yuno representative
to have it enabled.refund mode alongside an immediate cancel (an absent schedule) to have Yuno compute a
refund quote for the current billing cycle. Yuno only computes the quote — it never moves money.
refund.execution on the response is always "MERCHANT": you execute the refund yourself against
your own payment rail, using the quoted amount as input.
refund cannot be combined with schedule — sending both, or sending refund together with
"schedule": null, is rejected with 400 before anything is written. refund: NONE, or omitting
refund entirely, still works normally alongside schedule.
The refund basis
Every refund mode is computed against the same basis: the most recently captured payment on the subscription — never the subscription’s own list price, and never an estimate. If the current cycle has no captured payment at all (a decline, a payment still pending, or a gap),PRORATED,
FULL, and CUSTOM all return 400 REFUND_NOT_AVAILABLE — except a genuine $0 phase (a trial or
promotional phase with nothing charged), which returns 200 with amount: 0.00. There’s nothing to
refund there, but that’s not an error.
A PAST_DUE subscription has no captured payment for the cycle in progress, so the same rule
applies: refund: NONE (or an absent refund) still cancels normally, but any other mode returns
400 REFUND_NOT_AVAILABLE with current_status: "PAST_DUE".
PRORATED
Refunds the unused days of the current cycle, using calendar-date arithmetic — never hours or minutes:period_start— the date the last captured payment was charged.period_end— the date the current cycle naturally ends, capped atavailability.finish_atwhen the subscription has one and it falls earlier.unused_days = period_days − used_days, whereused_dayscounts the day you cancel on as a full used day — canceling at any time on day 10 of a 30-day cycle still counts 10 used days.amount = charged_amount × unused_days / period_days, roundedHALF_UPat the currency’s minor units.
$30.00, canceled on day 10: 10 days used, 20 days unused,
amount = 30.00 × 20/30 = 20.00.
PRORATED
returns 400 "proration is not available for sub-daily cadences" there. FULL and CUSTOM are
unaffected — both still work on a sub-daily cadence.
FULL
Refunds the entirebasis.charged_amount of the current cycle — amount always equals
basis.charged_amount exactly, and unused_days equals period_days (the whole cycle is treated
as unused).
CUSTOM
Sendrefund_amount alongside "refund": "CUSTOM" to refund a specific amount instead of a
computed one:
amount in the response is your refund_amount echoed back exactly — not recomputed or rounded
again. refund_amount.value must be greater than 0 and must not exceed the current cycle’s
charged amount, and refund_amount.currency must match the subscription’s own currency.
Reading the refund object
refund is null when refund was NONE or omitted. Otherwise:
Where refund appears
- The cancel
200response always carries therefundkey —nullwhen no quote was computed, the object otherwise. GET /v1/subscriptions/{id}andGET /v1/subscriptions?merchant_reference=...carry the last computedrefundtoo, once one exists — canceling with a refund quote persists it, so it keeps showing up on every later read of that subscription through either of these.GET /v1/subscriptions(the paginated list) does not carryrefundon any entry, whether or not that subscription was canceled with a quote — the list item is a smaller summary shape than the full subscription object, andrefundisn’t one of the fields it includes.- The
subscription.cancelwebhook carriesrefundonly when a quote was actually computed (PRORATED/FULL/CUSTOM) — it’s absent, notnull, for aNONE/absent-refund cancellation.
Scheduling a cancellation instead
400 "Scheduled cancellation is not enabled for this organization", contact your Yuno representative to have it
enabled.schedule object to defer the cancellation instead of applying it now. The subscription
stays in its current status — billing continues normally — until the schedule fires.
schedule takes exactly one of:
400.
A PIX_AUTOMATIC subscription billed with frequency.execution: MERCHANT cannot schedule a
cancellation — schedule it as at or after_cycles on a different payment method type, or cancel
immediately instead.
Behavior while retries are running
past_due_behavior is echoed on cancel_scheduled, pending product confirmationThe engine currently stamps whatever past_due_behavior resolved for the schedule (explicit value,
or the EXHAUST_RETRIES default) onto the cancel_scheduled.past_due_behavior field in every
response. Treat this echo as provisional until product confirms it as the intended external
contract — it may change.past_due_behavior controls what a scheduled cancellation does if the subscription is PAST_DUE
when the schedule would otherwise fire:
past_due_behavior, canceling a PAST_DUE subscription — whether immediately or
because a schedule became due — never errors and always stops that cycle’s retries. See
Subscription Status and
Retries.
schedule request cannot also carry a refund mode.Undoing a scheduled cancellation
Send"schedule": null to clear a pending schedule. The subscription is unaffected otherwise — no
status change, no charge.
"schedule": null when nothing is scheduled is a no-op: 200, cancel_scheduled stays
null, and no webhook is sent. When a schedule is cleared, subscription.cancel_schedule_canceled
fires instead.
Reading the result
The response carries the same Subscription shape as every other subscription endpoint. Four fields are relevant here:cancel_scheduled—nullwhen no cancellation is pending, otherwise the schedule’smode,after_cycles/at,requested_atandpast_due_behavior.retries.stopped,retries.attempts_made,retries.outcome,retries.next_retry_at— populated whenever the subscription isPAST_DUEor has acancel_scheduledpending; omitted otherwise.unpaid_cycle— present when the current billing cycle isPAST_DUEand has not settled.refund—null(or absent on non-cancel reads) when no refund quote was computed, otherwise the quoted amount and its basis. See Refund on immediate cancel.
retries and unpaid_cycle after cancellation is pending product confirmationBoth fields are computed from the subscription’s live state at request time. Whether a GET /v1/subscriptions/{id} issued after the subscription reaches CANCELED continues to surface the
retry snapshot / unpaid cycle from the cycle that was in flight, or omits them once terminal, is not
yet confirmed as a stable contract — verify against a live response before depending on it.Webhooks
subscription.cancel_scheduled— sent when a cancellation is scheduled via this endpoint.subscription.cancel_schedule_canceled— sent when a pending scheduled cancellation is undone via"schedule": null.
subscription.cancel
as before — scheduling emits its own events only for the scheduling and undoing actions themselves.
subscription.cancel’s payload carries refund too, following the same rule as the cancel response
itself: present only when a quote was actually computed (PRORATED/FULL/CUSTOM), absent for a
NONE/absent-refund cancellation.
Errors
Authorizations
Path Parameters
The unique identifier of a subscription.
Body
NONE (default), PRORATED, FULL, or CUSTOM. Computes a refund quote for the current billing cycle on an immediate cancel. Cannot be combined with schedule.
"PRORATED"
Required, and only allowed, when refund is CUSTOM. Must not exceed the current cycle's charged amount.
Response
200
"7304911d-5df9-429e-8488-ad41abea1a4c"
"sub_001"
"streaming service"
"2404911d-5df9-429e-8488-ad41abea1a4b"
"001_marzo_23"
"CANCELED"
"1904911d-5df9-429e-8488-ad41abea1a4d"
The payment method the subscription charges. A single object, not a list.
Present only when the current billing cycle is PAST_DUE and has not settled.
null when no cancellation is pending.
null when refund was NONE or omitted. Present on the cancel response and on every later read once computed.
"2023-12-16T20:46:54.786342Z"
"2023-12-16T21:00:54.786342Z"