Handling raw card data requires PCI certification. To stay out of PCI scope, use the Yuno SDK.
Prerequisites
A Yuno account with sandbox access. From the Yuno Dashboard, open the Developers section and copy three values:account_id: your merchant account identifier. Sent in request bodies on endpoints that take it.public-api-key: sent as an HTTP header on every call.private-secret-key: sent as an HTTP header on every call. Treat it like a database password.
Create your first payment
The code samples below show the minimum required fields for each call. For every accepted parameter, optional field, and response shape, see the linked endpoint in the API reference under each step.
Get your credentials
From the Yuno Dashboard open the Developers section and copy your sandbox
account_id, public-api-key, and private-secret-key. See authentication for security rules and key rotation.Create a customer
Customers are your record of each buyer. Every payment attaches to one, and many local methods need the customer’s document or contact details up front. Create the customer once and reuse the See Create customer.
customer_id across future purchases.cURL
Create a checkout session
The checkout session commits a single purchase intent: amount, currency, country, and customer. Yuno uses it to compute which methods are available and to tie the rest of the flow together.See Create checkout session.
This endpoint returns HTTP 201. The checkout session ID is in the response body as
checkout_session.Create a payment
Use the checkout session to create a payment. Set a stable On success this endpoint returns HTTP 201 with the full Payment object. See Create payment for every accepted field (
merchant_order_id so a retry after a network failure can be looked up via Get Payment by Merchant Order instead of creating a duplicate. For cards, payment_method.token is the one-time token produced by the Yuno SDK when the customer enters card data on the client. Use workflow: "DIRECT" for server to server REST flows; SDK_CHECKOUT and REDIRECT are the other supported values.installments, three_ds, metadata, and more) and Avoiding duplicates for safe retry behavior.Local methods
The CARD example above is the simplest case. Yuno supports 1000+ methods through the samePOST /v1/payments endpoint. Only payment_method.type, country, currency, and a few customer_payer fields change. The other root fields (account_id, description, merchant_order_id, merchant_reference, workflow, checkout) stay the same as the CARD example.Select a region to see how the body adapts.- Brazil, Pix
- India, UPI
- Europe, iDEAL and SEPA
- Asia, Alipay and WeChat Pay
- US, ACH bank debit
Pix is Brazil’s instant payment system. Real time, 24/7, and the most popular method in the country. Requires a CPF (individual tax ID) or CNPJ (business tax ID).The response returns a QR code and a copy paste code. The customer pays from their banking app and you receive confirmation in seconds through a webhook.
Handle the response and webhooks
Every payment response carries a top level
For the full sub status taxonomy (every value
status and an optional sub_status. There are 14 top level values. Branch on status for routing logic; read sub_status when you need detail (for example AUTHORIZED is a sub status of PENDING, not a top level value).status | When you see it | Terminal |
|---|---|---|
CREATED | Initial state at creation. | No |
READY_TO_PAY | Awaiting customer action (hosted redirect or QR scan). | No |
PENDING | Awaiting customer action (3DS), provider confirmation, or async settlement (Pix, Boleto, OXXO, PSE, SPEI, SEPA, ACH, Khipu, BNPL, redirect wallets, crypto). | No |
VERIFIED | Zero amount card authorization succeeded. | Yes |
SUCCEEDED | Payment completed. Sub status carries detail (APPROVED, CAPTURED, PARTIALLY_CAPTURED, PARTIALLY_REFUNDED). | Yes |
DECLINED | Provider or issuer declined. | Yes |
REJECTED | Yuno rejected the request for validation or risk reasons. | Yes |
EXPIRED | Payment or authorization expired before completion. | Yes |
CANCELED | Cancellation succeeded (single L spelling, matches the API). | Yes |
REFUNDED | Captured funds were returned to the customer. | Yes |
IN_DISPUTE | Chargeback or inquiry received, awaiting response. | No |
CHARGEBACK | Predispute deflected; funds lost. | Yes |
ERROR | System error such as timeout or upstream failure. | No |
FRAUD | Verified by fraud provider during stand alone fraud verification. | Yes |
sub_status can take per top level status) see Payment statuses and the payment flow lifecycle.Webhooks are the source of truth for final status. Any payment that returns PENDING synchronously will settle later through a webhook event. Register your endpoint, verify every payload, and treat the latest event as canonical.Webhooks concept
How webhooks fit into the payment lifecycle and what events Yuno emits.
Webhook setup
Register your endpoint in the Dashboard.
Webhook events
The full list of event types and payload shapes.
Verify signatures
Confirm every webhook is genuinely from Yuno.
Test locally
Tunnel webhooks to your machine in development.
Register webhook
The API endpoint for programmatic registration.
Payouts
Payouts disburse funds out of your Yuno balance to a recipient (sellers, marketplace participants, vendors). They share authentication, idempotency, and webhooks with payins, so you do not learn a second API. The model is:- Onboard the recipient. Create a recipient and complete recipient onboarding so they can legally receive funds.
- Send funds. Call Create payout with the recipient and amount.
- Track status. Poll Get payout or rely on the webhook event for the final state.
Next steps
Now that you have a working sandbox payment, harden your integration with the foundations every production setup needs.Payment flow
The end to end lifecycle, status state machine, and capture modes.
Authentication
The two required headers, key rotation, and security rules.
Environments
Sandbox vs production, base URLs, and the go live checklist.
Avoiding duplicates
Use unique business keys to make retries safe across endpoints.
Go deeper
SDK overview
The hosted checkout path that handles cards for you on web, iOS, Android, and Flutter.
Payment methods by region
The right methods for each market you serve, with required fields per country.
Sandbox testing
Reproduce declines, 3DS challenges, and edge cases safely before you go live.
Dashboard
Configure providers, routing, risk, and monitoring without code changes.
Error handling
The error envelope, the real code catalog, and a sane retry strategy.
API reference
Every endpoint with request and response schemas.