Web SDK Common Reference

Parameters, customizations, and advanced features for all Web SDK flows. Setup: Quickstart guide, integration modes.

TypeScript support

TypeScript: Yuno provides a library for all available methods.

Key parameters (checkout session creation)

When creating a checkout session on your backend, the following parameters are commonly used across web SDKs:

ParameterRequiredDescription
amountYesThe primary transaction amount object containing currency (ISO 4217 code) and value (numeric amount in that currency).
alternative_amountNoAn alternative currency representation of the transaction amount with the same structure as amount (currency and value). Useful for multi-currency scenarios, such as displaying prices to customers in their preferred currency (e.g., USD) while processing the payment in the local currency (e.g., COP).

Payment and checkout parameters (full reference)

Parameters for yuno.startCheckout, yuno.mountCheckout (Seamless), and related payment flows. All parameters used in Payment flows (Web) are listed here with full detail.

Core parameters

ParameterTypeRequiredDescription
checkoutSessionstringYesCheckout session ID returned from your backend (Create checkout session API). Required for all payment flows.
elementSelectorstringNo*CSS selector for the element where the SDK mounts (e.g. #root). Deprecated when used alone; prefer renderMode.elementSelector object to control APM and action areas independently. *Required when renderMode.type is 'element' and using the object form.
countryCodestringYesISO country code where the payment runs (e.g. FR, US). Determines available payment methods and compliance.
languagestringNoLanguage code for the UI (e.g. fr-FR, en-US). Defaults to browser language when available. See Supported languages.
showLoadingbooleanNoWhen true, shows the SDK loading spinner. Default true. Remains visible until hideLoader() or continuePayment() is called.
showPaymentStatusbooleanNoWhen true, shows the payment result screen after the flow completes. Optional.
issuersFormEnablebooleanNoWhen true, shows the issuer (bank) list form. Default true in source. Optional.

Callbacks

ParameterTypeRequiredDescription
yunoCreatePayment(oneTimeToken)functionYesCallback invoked when the user completes the card/APM step. Receive the one-time token; send it to your backend to create the payment via the API; then call yuno.continuePayment() to resume the flow.
yunoPaymentResult(status)functionNoCallback invoked when the payment flow finishes. Receives the payment status (e.g. succeeded, failed, processing). Use for UI updates or analytics.
yunoError(message, data)functionNoCallback invoked when an error occurs during the flow. Receives an error message and optional data object for debugging.
onLoadingfunctionNoCallback invoked when loading state changes (e.g. SDK fetching config, processing payment). Use to show or hide your own loader.

Card form options (card)

ParameterTypeRequiredDescription
card.typestringNoLayout type for the card form. Options: 'step' or 'extends'. Affects how the form is displayed in the checkout.
card.stylesstringNoCustom CSS string injected into the iframe to style the card form. Use to match your brand.
card.cardSaveEnablebooleanNoWhen true, shows a checkbox to save or enroll the card for future use. Default false. Requires backend support for vaulting.
card.textsobjectNoCustom text for card form buttons and labels. Keys depend on SDK version (e.g. placeholders, button labels).
card.cardNumberPlaceholderstringNoPlaceholder text for the card number field. Supports alphanumeric, spaces, UTF-8. Default "Card number" if not set. Does not affect formatting, masking, BIN logic, or validation.
card.hideCardholderNamebooleanNoWhen true, hides the cardholder name field. Default false. Hiding does not affect PAN, expiry, CVV, BIN logic, or 3DS/provider validations.
card.onChangefunctionNoCallback when card form state changes (loading, completed, network selected, reset). Receives { error, data }; data can include IIN/BIN and instalment options. Use BIN for real-time tax calculations.
card.isCreditCardProcessingOnlybooleanNoWhen true, forces card transactions to process as credit only. Useful where the card can act as both credit and debit.

Render mode

ParameterTypeRequiredDescription
renderModeobjectNoControls how payment forms are displayed. Omit to use defaults.
renderMode.typestringNo'modal' (default) or 'element'. Modal shows forms in an overlay; element embeds in the given DOM element.
renderMode.elementSelectorobjectNo*Required if type is 'element'. Provide apmForm (selector where APM UI is rendered) and actionForm (selector for button/area that opens provider-specific steps, e.g. PIX QR).

Seamless (payment Web) only

ParameterTypeRequiredDescription
vaultedTokenstringNoSaved payment method token for one-click or saved-card payment. Pass when reusing a previously enrolled card.
paymentMethodTypestringNoType of payment method to mount when using Seamless (e.g. card, APM). Determines which form or provider UI is shown.

Custom texts

ParameterTypeRequiredDescription
textsobjectNoCustom text for payment form buttons and labels (e.g. customerForm.submitButton, paymentOtp.sendOtpButton). Use to match your application language or branding.

Enrollment parameters (full reference)

Parameters for yuno.mountEnrollmentLite and yuno.mountEnrollmentHeadless. All parameters used in Enrollment flows (Web) are listed here with full detail.

ParameterTypeRequiredDescription
customerSessionstringYesCustomer session ID from your backend (Create customer session API). Required. Associates the enrolled payment method with a specific customer.
countryCodestringYesISO country code (e.g. US, BR). Determines available enrollment options. See Country coverage.
languagestringNoLanguage code for the UI (e.g. en, en-US). Defaults to browser language when available.
showLoadingbooleanNoWhen true, shows the loading spinner during enrollment. Default true.
onLoadingfunctionNoCallback when loading state changes during enrollment.
elementSelectorstringNoCSS selector where the enrollment form mounts. Required when not using default modal behavior.
cardobjectNoCard form options (same structure as payment flows: type, styles, texts, hideCardholderName, onChange, isCreditCardProcessingOnly, etc.).
yunoEnrollmentStatusfunctionNoCallback when enrollment ends. Receives vaultedToken and status. Status values: CREATED, EXPIRED, REJECTED, READY_TO_ENROLL, ENROLL_IN_PROCESS, UNENROLL_IN_PROCESS, ENROLLED, DECLINED, CANCELED, ERROR, UNENROLLED.
issuersFormEnablebooleanNoWhen true, shows the issuer (bank) list form. Optional.
textsobjectNoCustom text for enrollment form buttons and labels.

Mount external buttons

Use the mountExternalButtons method to render Google Pay and Apple Pay buttons in custom locations within your UI. This gives you control over where these buttons are displayed.

await yuno.mountExternalButtons([
  {
    paymentMethodType: 'APPLE_PAY',
    elementSelector: '#apple-pay',
  },
  {
    paymentMethodType: 'GOOGLE_PAY',
    elementSelector: '#google-pay',
  },
]);

Parameters

ParameterDescription
paymentMethodTypeThe payment method type. Must be either 'APPLE_PAY' or 'GOOGLE_PAY'.
elementSelectorThe CSS selector for the HTML element where the button should be rendered (e.g., '#apple-pay', '.button').

Unmounting buttons

You can unmount a single external button by payment method type:

yuno.unmountExternalButton('APPLE_PAY');

Or unmount all external buttons at once:

yuno.unmountAllExternalButtons();

Enrolling payment methods

You can enroll payment methods (store cards for future use) directly during the payment flow by setting payment_method.vault_on_success = true in the checkout session creation.

When vault_on_success is set to true:

  • The payment method will be automatically enrolled if the payment status is SUCCEEDED
  • If the payment does not succeed, no vaulting will occur
  • The payment response will include a vaulted_token that you can use for future transactions

Example:

{
    "account_id": "...",
    ...
    "payment_method": {
        "vault_on_success": true
    }
}

To generate and receive a vaulted_token when vault_on_success = true, the payment must reference an existing Yuno customer through customer_payer.id in the checkout session. Creating or sending the customer data inline inside the payment request does not create the customer on our side, so no vaulting will occur.

For enrollment flows, see Enrollment flows (Web).