Headless Checkout
Charge from your own UI. The secret-key SDK lists tokens, returns the exact approve or sign payload, and captures after the customer acts in their wallet.
noderails.checkoutSessions.createRedirect the customer to pay.noderails.com. We handle token pick, wallet, and capture.
noderails.headlessCheckout.*Keep the customer on your site. You show tokens and collect the wallet action.
Secret key on your server
headlessCheckout from your backend only. The browser talks to your API, then the customer's wallet. Do not put sk in the frontend.Flow
- 1create or createFromSubscriptionOpen a session. Do not send the customer to pay.noderails.com.
- 2paymentOptionsShow accepted chains and tokens. Each token includes a spot quote for display.
- 3preparePass the selected token and wallet. You get cryptoAmount and a userAction.
- 4confirmAfter they sign or approve, authorize. ERC-20 is captured here.
- 5submitUserTxOnly if confirm returns AWAITING_USER_TX (native, Solana, or Sui one-time).
One-time payment
What prepare returns
Always: cryptoAmount (this charge, raw units), exchangeRate, optional quoteId, and userAction. For subscriptions,authAmount is the standing approve or permit (~one year).chargeAmount stays one period.
| userAction.type | Your UI | Then confirm with |
|---|---|---|
permit | signTypedData(userAction.typedData) | permitSignature (amount, deadline, v, r, s) |
approve | Send to / data on the token | approvalTxHash |
native_capture / solana_capture / sui_capture | Confirm first. Capture calldata is on the confirm result. | No extra sig. Then submitUserTx. |
sui_wallet_setup | Fund / set up the Sui subscription wallet | Then confirm. Capture is pulled after setup. |
Subscription first charge
Create the subscription, then open a headless session with createFromSubscription. Native tokens are not listed. Later renewals run on the worker. Listen for subscription.renewed and payment.captured. Do not call confirm every cycle.
Billing details
requireBillingDetails is true.After payment
Fulfill on payment.captured. Do not treat the success URL as confirmation.
Methods
| Method | Description |
|---|---|
create(params) | Create a one-time headless session |
createFromSubscription(id) | Create a session for the first subscription charge |
paymentOptions(id) | Tokens, chains, and spot quotes |
prepare(id, params) | Exact amount and wallet userAction |
confirm(id, params) | Authorize and capture when we can pull |
submitUserTx(id, params) | Report the capture hash after AWAITING_USER_TX |