Skip to main content
Add checkout in two steps: create a session on your server, then show it with the React component. Your API key stays on the server; the browser only needs the session ID.

How it works

Before fulfilling an order, verify the payment with the webhooks guide.

Install

Install the React SDK
Requires React 17+.

Create and show checkout

1

Create a session on your server

Call the Checkout API from your server with the price and order details. Reuse the same idempotencyKey when you retry this order, and use a new key for each new purchase.
Server: create a session
2

Render checkout in your app

Pass the session ID to the LocusCheckout component on the client.
CheckoutPage.tsx

With receipt

Add receiptConfig when you create the session to show line items, subtotal, tax, your logo, company address, and support email. The React component shows the receipt, and the buyer can find it later in Purchases on the Locus dashboard.
Server: create a session with a receipt
Values inside fields are strings, with amounts in USDC. lineItems is a list of { description, amount } objects.

Display modes

Set mode on LocusCheckout to embedded (inside your page), popup (a separate window), or redirect (the hosted page). See display modes. For custom buttons, use useLocusCheckout.

Next steps

Payment webhooks

Verify payments before fulfilling orders.

Merchant integration

Callbacks, custom buttons, and the dashboard.