Skip to main content

Direct Integration

Build your own checkout UI using the Settlx API directly. This gives you full control over the customer experience while Settlx handles address generation, payment detection, and settlement.

Overview

In a direct integration:
  • Your frontend renders the token/chain selector and payment screen
  • Your backend creates the payment and receives webhooks
  • Settlx generates addresses, monitors the blockchain, and handles settlement

Step 1 — Load available tokens

When your checkout page loads, fetch the list of supported tokens. This endpoint is public — no API key required.

Step 2 — Create the payment

Once the customer selects their chain and token, call POST /api/v1/payments from your backend. This single call creates the payment record and returns the deposit address in one response.
Always pass metadata.orderId. It is included in every webhook payload, allowing you to match the confirmed payment to your internal order without a database lookup.

Step 3 — Display the payment screen

Your frontend displays the address and exact amount returned in the previous step.

Step 4 — Poll for status updates

Poll the public status endpoint every 5–10 seconds to track payment progress. No API key required.

Step 5 — Handle webhooks on your backend

Settlx sends a POST request to your webhookUrl as the payment progresses. Always verify the signature before processing.
The signature format is t=<unix_seconds>,v1=<hex> (Stripe-style). See Webhook Integration for verification examples in Python, PHP, and Go.

Full React example

Integration checklist

1

Fetch token list on page load

Call GET /api/v1/tokens (public) to populate your chain and token selector. Cache the response for up to 5 minutes.
2

Create payment from your backend

After the customer selects their token, call POST /api/v1/payments from your server. Never make this call from the browser — it requires your API key.
3

Display address and QR code

Show the returned address, qrCode, cryptoAmount, and cryptoCurrency to the customer.
4

Poll for status

Poll GET /api/v1/invoices/{invoiceId}/status every 5–10 seconds and update your UI as confirmations arrive.
5

Fulfill the order on invoice.settled

Handle invoice.settled on your backend to fulfill the order. Verify the X-Webhook-Signature header on every delivery.