Checkout
A hosted page where customers pay from the coin they hold, and you receive the exact amount in USDC on Base.
LandedFX never holds the money. The customer's coins go to a provider's one-time address, and the provider delivers USDC straight to your wallet. The customer covers the cost of converting, so you get the exact amount.
Create a session
curl -X POST https://api.landedfx.com/api/v1/checkout/sessions \
-H "x-api-key: $LANDEDFX_KEY" \
-H "Idempotency-Key: order-1042" \
-H "content-type: application/json" \
-d '{
"wallet": "<your Base address>",
"amount": 25,
"title": "Order 1042",
"successUrl": "https://acme.com/thanks?session={CHECKOUT_SESSION_ID}",
"cancelUrl": "https://acme.com/cart",
"clientReferenceId": "order_1042",
"metadata": { "plan": "pro" }
}'Send your customer to data.url. Sessions last 24 hours unless you set expiresInMinutes, from 30 to 1440.
status | Means |
|---|---|
open | Waiting for payment |
complete | Paid. paymentStatus is paid |
expired | Past its time, or expired by you with POST /checkout/sessions/{id}/expire |
Retrying with the same Idempotency-Key returns the first session. The same key with different parameters is refused.
Choose what you accept
Set acceptMode:
| Value | Customers can pay with |
|---|---|
all | Every coin we can route, the default |
majors | Stablecoins and major coins |
stablecoins | Stablecoins only |
custom | Only the keys in acceptAssets, from GET /swap/assets |
Know when you're paid
Subscribe to checkout.session.completed under Integrations. It arrives signed, with your clientReferenceId and metadata. See Webhooks. Don't rely on a customer reaching successUrl, as they may close the page first.
checkout.session.expired tells you a session ended without payment.
Match your brand
{
"branding": {
"displayName": "Acme Store",
"logoUrl": "https://acme.com/logo.png",
"buttonColor": "#0B3F31"
}
}Addresses must be https. Pages still say they're powered by LandedFX.
Embed it
Add one tag, and you get a button that opens checkout over your page:
<script src="https://pay.landedfx.com/embed.js" data-link="LINK_ID" data-label="Pay with crypto" async></script>Or open it yourself:
LandedFX.open('LINK_ID', {
onEvent: (e) => console.log(e.type, e.state, e.final),
});LINK_ID is the end of the session's url. Browser events update your screen. Only the webhook proves payment.