Skip to main content
Welcome to the Yuno SDKs quickstart guide. This guide shows you how to easily implement our full payment flow, Yuno’s most straightforward solution with pre-built UI and automatic payment method display. Choose your platform and follow the steps to start process your first payments with Yuno.

1. Install

npm install @yuno-payments/sdk-web
Or include via CDN:
<script src="https://sdk-web.y.uno/v1.5/main.js"></script>

2. Initialize and process payment

import { Yuno } from '@yuno-payments/sdk-web';

// Initialize SDK
const yuno = await Yuno.initialize('your-public-api-key');

// Create checkout session on your backend
// Your backend calls: POST https://api-sandbox.y.uno/v1/checkout/sessions
const session = await fetch('/api/create-session', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
    customer_id: 'customer-123',
    amount: { currency: 'USD', value: 1000 },
    country: 'US'
})
}).then(r => r.json());

// Configure checkout
yuno.startCheckout({
checkoutSession: session.checkout_session,
elementSelector: '#payment-form',
countryCode: 'US',
async yunoCreatePayment(oneTimeToken) {
    // Your backend calls: POST https://api-sandbox.y.uno/v1/payments
    // with { payment_method: { token: oneTimeToken }, checkout_session: ... }
    const payment = await fetch('/api/process-payment', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
        one_time_token: oneTimeToken,
        checkout_session: session.checkout_session
    })
    }).then(r => r.json());
    
    // Required for async payment methods (3DS, PIX, etc.)
    yuno.continuePayment();
}
});

// Mount payment form
yuno.mountCheckout();

3. Add HTML container and trigger payment

<div id="payment-form"></div>
<button id="pay-button">Pay Now</button>

<script>
document.getElementById('pay-button').addEventListener('click', () => {
    yuno.startPayment();
});
</script>
Test with: Card 4111 1111 1111 1111, any future date, any CVVFor a comprehensive overview of all Web SDK parameters, see Web SDK Common Reference.Complete Web guide →

Backend integration

Your backend must implement two API endpoints to work with Yuno:

1. Create checkout session

Before displaying the payment UI, your backend creates a checkout session:
  • Endpoint: POST https://api-sandbox.y.uno/v1/checkout/sessions
  • Required: Customer ID, amount, country
  • Returns: checkout_session ID (used in SDK)
  • Reference: Create checkout session API
Example request:
{
  "country": "US",
  "customer_payer": {
    "id": "customer-123"
  },
  "amount": {
    "currency": "USD",
    "value": "2500"
  }
}

2. Create payment

In the One-Time Token (OTT) callback, your backend creates the payment:
  • Endpoint: POST https://api-sandbox.y.uno/v1/payments
  • Required: One-time token (from SDK callback), checkout session
  • Returns: Payment status and sdk_action_required field
  • Reference: Create payment API
Example request:
{
  "payment_method": {
    "token": "one-time-token-from-sdk"
  },
  "checkout": {
    "session": "checkout-session-id"
  }
}
Important: If the API response has sdk_action_required: true, you must call the SDK’s continuePayment() method to complete async payment methods (3DS authentication, PIX, bank redirects, etc.).

Parameters

Primary parameters used in this quickstart:
ParameterDescription
publicKey / apiKeyYour Yuno public API key (frontend). From Yuno DashboardDevelopers > Credentials.
checkoutSessionCheckout session ID returned by your backend (create session endpoint). Required to start payment.
countryCodeISO country code for the payment (e.g. US, CO). See Country coverage.
elementSelector (Web)CSS selector for the element where the payment form is mounted (e.g. #payment-form).
Full parameter reference: Payment flows (Web), Payment flows (iOS), Payment flows (Android).

secure-fields integration

If you need more control over the UI than full-checkout provides, you can use secure-fields. This allows you to build your own payment forms while Yuno handles the secure data collection. Learn more about secure-fields →

Test cards

Card NumberScenario
4111 1111 1111 1111Success
4000 0000 0000 0002Declined
4000 0000 0000 32203DS Challenge