Documentation
Checkout

API Checkout

Create one-time hosted checkouts with a server-controlled amount for dynamic carts and orders.

API Checkout

API Checkout is for orders whose final price is known only at checkout time: carts, usage-based orders, account marketplaces, license keys, top-ups, and other dynamic purchases.

Your backend creates a short-lived Checkout Session with the final amount and currency. Yolfi returns a unique ycs_... ID and hosted URL. The buyer opens that URL, chooses a supported network and token, and Yolfi creates an Invoice for that exact server-approved amount.

Hosted payment URLs share one root format. A ycs_... identifier opens a Checkout Session, while a Paylink UUID opens the existing fixed-price Paylink:

https://pay.yolfi.com/ycs_0123456789abcdef0123456789abcdef
https://pay.yolfi.com/550e8400-e29b-41d4-a716-446655440001

A standalone API Checkout Session does not require or create a Paylink. Paylinks remain the reusable, no-code option for fixed-price products.

Choose the right flow

Use caseRecommended objectPrice comes from
Fixed product shared repeatedlyPaylinkSaved Paylink price
Dynamic cart or one-off orderCheckout SessionAuthenticated server request
Fixed Paylink with per-attempt metadata or redirectPaylink-backed Checkout SessionSaved Paylink price

How it fits together

sequenceDiagram
  participant B as Buyer browser
  participant M as Merchant backend
  participant Y as Yolfi API
  participant H as Yolfi hosted checkout

  B->>M: Click Pay
  M->>M: Recalculate and lock the order total
  M->>Y: POST /api/checkout-sessions
  Y-->>M: ycs_... + hosted URL
  M-->>B: Redirect to hosted URL
  B->>H: Choose network and token
  H->>Y: Create Invoice from the session snapshot
  Y-->>H: Deposit address + crypto amount
  B->>Y: Send crypto
  Y-->>M: Signed payment.confirmed webhook
  M->>M: Fulfill order once

The browser never supplies the fiat amount. It only chooses how to pay. Product and cart details remain in the merchant's system; Yolfi stores only the final payment amount and correlation IDs. This keeps price authority on your server and avoids maintaining a catalog of temporary Paylinks.

Quickstart

Create and redirect to your first dynamic checkout

API Reference

Request, response, idempotency, and retrieval fields

Lifecycle

Understand Checkout Session and Invoice statuses

Migration

Move a dynamic Paylink workaround to API Checkout

On this page