Skip to main content
Create a checkout session on your server, then pass its ID to the React component. Your buyers get Locus Wallet, external wallet, and agent payment options in one integration. For session creation and optional receipts, start with the integration example.

Install

Install the React SDK
Requires React 17+.

Embed checkout

CheckoutPage.tsx

Display modes

Use style or className to style the component’s wrapper. The SDK also exports LOCUS_BRAND_COLORS, LOCUS_CTA_GRADIENT, and LOCUS_FONT_FAMILY for surrounding UI.

Payment callbacks

onSuccess receives sessionId, amount, currency, txHash, payerAddress, and paidAt. Use it to show confirmation. Use onCancel for cancelled checkouts and onError to report failures.
Use callbacks to update the UI. Verify payment on your server before fulfilling an order.

Webhooks

Set webhookUrl when creating the session. Locus sends a POST request when a payment confirms or a session expires:

Payload

Payment confirmation event

Signature verification

Verify X-Signature-256 against the raw request body before fulfilling the order. Use the whsec_ secret returned when you create a session with a webhook URL.
verify-webhook.ts
Reject requests with a missing or invalid signature. Match the paid session to your order, verify the amount, and fulfill it only once. The event name and session ID are also sent in X-Webhook-Event and X-Session-Id.

Hook: useLocusCheckout

Use the hook for your own payment buttons:
PayButton.tsx

Merchant dashboard

The dashboard tracks revenue, session count, conversion, and payment methods. Filter by time range or checkout instance, then open a session for payment details. Use an instance ID to group sessions by integration point. Instances are created on first use. Buyers can find receipts in Purchases.
Revenue and checkout conversion analytics

Checkout analytics by instance

API reference

Use checkout.md for session APIs and agent payment requests. The Payment Router documents external wallet transactions.