Skip to main content
Every pay link has a hosted checkout page at https://pay.xenarch.com/l/<link_id>. You can share that URL as it is, open it from a button with the embed script, or render it inside a React app.

Hosted checkout

The buyer connects a wallet on the checkout page and pays in USDC on Base. By default the buyer pays by signature: an EIP-3009 authorization that a third-party x402 facilitator submits on Base, paying the gas. If no facilitator is healthy, or the buyer chooses it, the buyer sends a standard USDC transfer and pays about $0.001 of gas.

Return to your site

Add a return_url query parameter to the checkout URL, or set return_url in the link’s params. After a confirmed payment the checkout sends the buyer to that URL with three query parameters added:
The return parameters are for your thank-you screen only. Anyone can type them into a URL. Fulfill orders from a verified webhook or from the payment record in your dashboard.

Embed script

The embed script turns any element with a data-xenarch-link attribute into a pay button. It has no dependencies and needs no build step.
A click sends the buyer to the hosted checkout with return_url set to the current page. After payment the buyer comes back with the query parameters above. Two script URLs are published:
  • https://cdn.xenarch.dev/pay/v1.js follows non-breaking fixes.
  • https://cdn.xenarch.dev/pay/v1.0.0.js never changes. Pin it if you need byte-stable behavior.
The same code is on npm as @xenarch/embed 1.0.0.

React component

@xenarch/react 1.0.0 exports XenarchCheckout. It needs react and react-dom 18 or later.
Redirect mode renders a link styled as a button and sends the buyer to the hosted checkout. Modal mode renders a button that opens the checkout in an iframe overlay and closes it when the payment confirms. Inline mode renders the checkout iframe in place.

Props

Each event is { type, linkId, txHash? }, where type is one of xenarch:paid, xenarch:underpaid, xenarch:overpaid, xenarch:expired, xenarch:revoked or xenarch:close. The component acts only on postMessage events from https://pay.xenarch.com whose linkId matches its own prop, and it passes on txHash only when it is a well-formed transaction hash. As with the return parameters, use a verified webhook to fulfill orders. The package also exports buildHostedUrl, attachXenarchListener, isValidLinkId and HOSTED_ORIGIN for custom integrations.