Quickstart
Open a secure hosted checkout and verify the completed order.
RANTAN Hosted Checkout is a server-created payment flow. Your backend fixes the order, your browser opens the hosted UI, and your backend verifies fulfillment.
#Before you begin
You need a RANTAN seller account, an active product with a verified RANTAN Factory NFT, and an HTTPS return destination.
#1. Create a Checkout Session
Create one session from your backend for each merchant order. Use a stable, unique client_reference_id from your own order system.
curl -X POST https://app.rantan.xyz/api/v2/checkout-sessions/ \
-H "Authorization: Bearer $RANTAN_SELLER_JWT" \
-H "Content-Type: application/json" \
-d '{
"product_id": 123,
"client_reference_id": "order_20260730_001",
"quantity": 1,
"return_url": "https://merchant.example/orders/20260730_001",
"allowed_origin": "https://merchant.example"
}'#Session response
Store verification_key with the merchant order. Send only the session id, product id, and client reference to the browser.
{
"id": "c8a9d48e-68b2-48dd-a754-75635cae71d6",
"product_id": 123,
"client_reference_id": "order_20260730_001",
"quantity": 1,
"digital_mode": "",
"request_amount": null,
"return_url": "https://merchant.example/orders/20260730_001",
"allowed_origin": "https://merchant.example",
"status": "open",
"canceled_at": null,
"expires_at": "2026-07-30T09:30:00Z",
"verification_key": "server-only-verification-key",
"checkout_path": "/checkout/123?session_id=c8a9d48e-...",
"verification_path": "/api/v2/checkout-sessions/c8a9d48e-.../verify/",
"cancel_path": "/api/v2/checkout-sessions/c8a9d48e-.../"
}#2. Open hosted Checkout
Load the hosted SDK and open the session-specific popup from a user action such as a Buy button.
<button id="buy">Buy with RANTAN</button>
<script src="https://app.rantan.xyz/checkout-v2.js"></script>
<script>
document.querySelector("#buy").addEventListener("click", async () => {
const result = await RantanCheckout.open({
productId: 123,
sessionId: "c8a9d48e-68b2-48dd-a754-75635cae71d6",
clientReferenceId: "order_20260730_001",
});
// UI notification only. Verify this session from your backend.
await fetch("/api/orders/20260730_001/verify", { method: "POST" });
});
</script>#3. Verify fulfillment
When the popup reports completion or the buyer returns, call the verification endpoint from your backend.
curl https://app.rantan.xyz/api/v2/checkout-sessions/$SESSION_ID/verify/ \
-H "X-Rantan-Checkout-Verification-Key: $CHECKOUT_VERIFICATION_KEY"