Install
Install the React SDK
Create and show checkout
1
Create a session on your server
Call the Checkout API from your server with the price and order details. Keep the idempotency key stable for retries of this order; 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
AddreceiptConfig when creating the session to show line items, tax, and seller information. The same React component displays the receipt automatically.
Full receipt example
Full receipt example
Server: create a session with a receipt
receiptConfig fields
After payment, receipt details also appear in the buyer’s Purchases tab on the Locus dashboard.
Display modes
Setmode on LocusCheckout to choose the experience:
For custom buttons, use
useLocusCheckout. It provides openPopup, redirectToCheckout, and getCheckoutUrl.