vaulted_token, then call Create Subscription with that token. That works, but it splits signup across two calls — and it leaves you holding a stored credential before you know whether the customer’s card will actually authorize.
The subscription block on Create Payment collapses that into one call. You send the instrument and the recurrence instructions together; Yuno charges the customer and, on the back of that same charge, creates the subscription. That payment is linked to the subscription and recorded as its first billing cycle, and nothing starts billing if the payment doesn’t go through.
Which route should you use?
- One call (this page): the customer is signing up and paying right now, and you want the signup to succeed or fail as a single unit. Best for checkout flows.
- Create Subscription: you already hold a
vaulted_tokenfor the customer — for example, they enrolled a card earlier. See the subscriptions overview for that flow. To move an existing subscriber onto another plan, use Change Subscription Plan — creating a second subscription leaves the first one active and billing. - Payment links: the
subscriptionblock is not supported on payment-link create — it is ignored rather than rejected, so the link returns201and no subscription is ever created. Take the payment on the link withvault_on_success, then call Create Subscription with the resultingvaulted_token.
subscription block on Create Payment carries a smaller field set, and cannot set retries, trial_period, plan_id, metadata, soft_descriptor or a subscription name. In particular Smart Retries are off on a subscription created this way — a declined renewal is not retried until you turn them on with Update Subscription.How the one call works
- You call Create Payment with the payment you’d send anyway — amount, country, payment method, customer — plus a
subscriptionobject describing the recurrence. - Yuno charges the customer. This is a normal card payment: it routes, it can decline.
- If the charge completes, Yuno creates the subscription and records that payment as its first billing cycle. The payment response comes back with
subscription_code— theidof the new subscription. - Yuno bills every following cycle on its own, on the cadence you set in
frequency, until the subscription completes, is canceled, or runs out of billing cycles.
subscription_code on the payment response and from Retrieve Subscription rather than assuming it.
Apply that check only once the payment reaches a terminal status. If the payment comes back PENDING, the subscription has not been created yet and the response comes back with subscription_code: null — wait for the terminal outcome before reconciling. On a payment that is already terminal and successful, subscription_code: null means the subscription was not created. See Errors.
Retrying the call
Create Payment requires anX-idempotency-key header — the request is rejected before the body is parsed if it is missing.
Retrying with the same key returns the original payment and does not create a second subscription. Retrying with a new key charges the customer again. So if a payment succeeded without a subscription_code, replaying the call is not a fix: the same key gives you the original payment back, and a new key takes a second payment. Reconcile instead — see Errors.
Available payment methodsAs with every Yuno subscription, only cards can be used. See Subscriptions.
The subscription block
Send subscription alongside the normal Create Payment fields. To start a new subscription, send frequency, availability, and amount, and leave id out.
checkout.session is required on Create Payment unless you send "workflow": "DIRECT" or "workflow": "REDIRECT" — the subscription block does not change that. Create a session with Create checkout session and send its identifier as checkout.session.
availability object itself is required when you’re creating a new subscription, but both fields inside it are optional — send {} if you want the subscription to start now and run until you cancel it.
Complete example
Create Payment with a new subscription
payment_method.token is the one-time token the checkout session produces for the card the customer just entered — that is the signup instrument on this route. Use vaulted_token only when the card is already stored, as in Charging an existing subscription.
The response is a normal payment object with one extra field populated:
Response (excerpt) — illustrative
Illustrative — no merchant-surface capture exists yet for this flow. The field names and nesting are the ones this route adds; the values are placeholders.
subscription_code — it is the subscription’s id, and it’s what you pass to Retrieve, Pause, Resume, and Cancel.
execution decides who bills
frequency.execution tells Yuno who is responsible for generating each recurring charge, and it is required — there is no default.
YUNO— Yuno’s engine owns the schedule. It generates every charge after the first one and emits the per-cyclepayment.purchasewebhooks. This is what you want for this flow.MERCHANT— you own the schedule. Yuno stores the subscription as a record of the arrangement but never charges on it; you send each rebill yourself as a merchant-initiated payment. The lifecycle operations that only make sense against a Yuno-run schedule — Pause, Resume, Update, Retry, and Change plan — are rejected with400 BAD_REQUEST.
Retries are the one exception to “same subscription object”The
subscription block on Create Payment has no retries object, so a subscription created this way starts with retry_on_decline: false — a declined renewal is not retried, on either execution value. Turn Smart Retries on afterwards with Update Subscription.Authentication on the first charge
The first charge is a customer-initiated transaction (CIT) on the payment surface, so it is eligible for 3DS in a way a Create Subscription rebill is not — that endpoint takes avaulted_token and starts a schedule, with no customer session attached and no surface on which to present a challenge.
Finding the first charge later
The payment you made in the one call is not a loose transaction sitting next to the subscription — it is recorded as the subscription’s first billing cycle. That matters for reporting: if it weren’t linked, your recurring-revenue numbers would miss every subscription’s first month. Two ways to follow the link:- From the payment:
subscription_codeon the payment object is the subscription’sid. It’s on the Create Payment response and on Retrieve Payment. - From the subscription: List Subscription Payments returns the subscription’s charge history, and the payment from the one call is linked there as the subscription’s first billing cycle, carrying the same payment
idyou got back from the call.
Renewal webhooks
subscription.active fires once, when the subscription first becomes active. It is not re-sent on later renewals. Track each renewal through the per-cycle payment.purchase webhook instead. See Subscriptions.Charging an existing subscription
The samesubscription block has a second shape: send id with the UUID of a subscription that already exists, and the payment is attached to that subscription instead of creating a new one. In that shape you omit frequency, availability, and amount — the subscription already defines them.
Create Payment for an existing subscription
Errors
A badsubscription block can fail at two different moments, and the difference matters: one of them happens before the customer is charged, the other after.
Rejected before any charge
These are caught when the request is validated, so the call fails with a400, no money moves, and no subscription is created:
frequency.executionmissing, or any value other thanYUNO/MERCHANT.frequency.typeset to anything other thanMONTH.amount.typeset to anything other thanFIXED/VARIABLE.amount.valueoramount.currencymissing, or a currency that isn’t a valid ISO 4217 code.subscription.amount.currencydifferent from the payment’samount.currency.subscription.amount.type=FIXEDwith asubscription.amount.valuedifferent from the payment’samount.value.frequency,availability, oramountmissing while creating a new subscription (all three are required unless you sendid).customer_payermissing — a payment always needs a payer, so this is refused before anything is charged.
Validated when the subscription is created
These are checked at subscription-creation time, which happens after the charge:availability.start_atin the past, orfinish_atat or beforestart_at.billing_cycles.totalset to0or a negative number.frequency.valuemissing, or set to a fractional number.