Integration guide
Accept crypto with Delvapay
This guide takes you from an API key to a settled payment: create a payment intent on your server, open the hosted Link widget in your page, and fulfil the order when a signed webhook arrives. Customers can pay in USDC or any supported coin; you always receive USDC.
On this page
Early access. The API is pre-1.0. Sections tagged evolving describe behaviour that is being rolled out now and may change shape; everything else reflects the current API.
Overview & flow
Every payment gets its own Delvapay deposit address. The customer sends USDC to it from any wallet or exchange, or pays in another coin that a swap provider converts and delivers there as USDC (see Any-asset payments). Once the payment is confirmed, the amount minus the Delvapay fee lands in your Delvapay balance in USDC, and you withdraw it to your own wallet whenever you want. Delvapay runs the checkout, matches the on-chain transfer to the right payment, keeps a double-entry ledger, and notifies your backend.
The API base URL is http://localhost:3000 in local development; production hostnames are issued with live keys. Examples below use $DELVAPAY_API_URL.
- Your server → API
1.POST /payments/intentswith amount, currency, network. - Your server → API
2.POST /link/sessionsreturns a single-useauthCode(10 min). - Your page → Widget
3.openLink({ clientId, authCode })opens the hosted widget in an iframe. - Customer → Widget
4. Picks a wallet and sends USDC, or picks another coin and pays a one-time deposit address. - Delvapay → Chain
5. Watches the transfer and waits for the required confirmations. - Delvapay → Your server
6. Signedpayment.settledwebhook, your balance is credited. Fulfil the order.
Your API key never reaches the browser: the browser only ever sees the short-lived authCode, and
the widget exchanges it for its own session token.
Authentication
Merchant endpoints use API keys sent as a Bearer token. Create keys in the dashboard. Keys are shown once; Delvapay stores only a SHA-256 hash.
dp_test_…: test mode. Creates testnet payments only (Base Sepolia, Ethereum Sepolia).dp_live_…: live mode. Creates mainnet payments only (Base, Ethereum).
The mode is enforced: asking a test key for a mainnet network (or a live key for a testnet) returns 403, so a test integration can never take real payments.
Authorization: Bearer dp_test_xxxxxxxxxxxxxxxxxxxxxxxx
A missing or malformed header returns 401 Missing Authorization: Bearer <api-key>; an
unknown or revoked key returns 401 Invalid API key; a suspended merchant gets
403 Merchant not active. Keep keys server-side only.
Object IDs
Every object has a prefixed ID that tells you what it is, for example
pi_3Nf1FbR5jFwNLiigHqLodT for a payment intent. IDs are case sensitive: store them as
opaque strings of up to 64 characters.
| Prefix | Object |
|---|---|
pi_ | Payment intent |
txn_ | Transaction (a payment attempt on an intent) |
mer_ | Merchant, used as the widget clientId |
key_ | API key (the ID, never the secret: secrets stay dp_test_… / dp_live_…) |
we_ | Webhook endpoint |
evt_ | Webhook event (the id of a webhook body) |
whd_ | Webhook delivery (dashboard delivery log) |
cp_ | Card payment |
scr_ | Compliance finding (riskId in payment.risk_flagged) |
flag_ | Risk flag |
usr_ | Dashboard user |
wd_ | Withdrawal |
wa_ | Withdrawal address (address book entry) |
dep_ | Deposit address (your top-up address) |
tu_ | Top-up |
Every endpoint also accepts the plain UUID form that IDs had before prefixes were introduced, so stored IDs and
existing embed code (a UUID clientId) keep working. An ID with the wrong prefix (for example a
mer_ ID where a payment intent is expected) is treated like an unknown ID.
Create a payment intent
A payment intent represents one amount you want to collect. It expires 30 minutes after creation.
The Idempotency-Key header is required. Use your order ID.
POST /payments/intents
| Field | Type | Notes |
|---|---|---|
amount | string | Decimal string, e.g. "25.00". Never a float. Up to 18 decimals (USDC uses 6). |
currency | "USDC" | Only USDC today. |
network | string? | base, ethereum (live keys; default base) or base-sepolia, ethereum-sepolia (test keys; default base-sepolia). |
curl -X POST "$DELVAPAY_API_URL/payments/intents" \
-H "Authorization: Bearer $DELVAPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order_1042" \
-d '{"amount":"25.00","currency":"USDC","network":"base-sepolia"}'
const API = process.env.DELVAPAY_API_URL!;
const KEY = process.env.DELVAPAY_API_KEY!;
export async function createIntent(orderId: string, amount: string) {
const res = await fetch(`${API}/payments/intents`, {
method: "POST",
headers: {
Authorization: `Bearer ${KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": orderId,
},
body: JSON.stringify({ amount, currency: "USDC", network: "base-sepolia" }),
});
if (!res.ok) throw new Error(`Delvapay ${res.status}: ${await res.text()}`);
return (await res.json()) as PaymentIntent;
}
interface PaymentIntent {
id: string;
status: "CREATED" | "FUNDING_SELECTED" | "CONFIRMING" | "SETTLED" | "FAILED" | "EXPIRED";
amount: string;
currency: "USDC";
network: string;
depositAddress: string | null; // this payment's Delvapay deposit address
settlement: "custodial" | "direct";
expiresAt: string | null; // ISO 8601
createdAt: string;
}
{
"id": "pi_3Nf1FbR5jFwNLiigHqLodT",
"status": "CREATED",
"amount": "25",
"currency": "USDC",
"network": "base-sepolia",
"depositAddress": "0x7d3c9a4e1f52b80c6e9a1d0f4b2c8e5a3f6d1b90",
"payerAddress": null,
"settlement": "custodial",
"feeAmount": null,
"reference": "order_1042",
"expiresAt": "2026-10-02T12:30:00.000Z",
"createdAt": "2026-10-02T12:00:00.000Z"
}
depositAddress belongs to this payment alone. You can show it to the customer yourself
(for example as a QR code): any USDC sent to it on the intent's network is matched to the payment, from
any wallet or exchange. settlement is "custodial" when the payment lands in
your Delvapay balance. It is "direct" only on networks where Delvapay balances are not
available yet: there the deposit address is your settlement wallet, set when the widget opens.
amount is returned in normalized decimal form (trailing zeros may be dropped). Retrieve an
intent at any time with GET /payments/intents/:id (same shape; 404 if it isn't
yours).
Create a Link session
Mint a session for the intent right before you open the widget. The returned authCode is
single-use and valid for 10 minutes. Create a fresh one each time the customer clicks “Pay”.
POST /link/sessions
curl -X POST "$DELVAPAY_API_URL/link/sessions" \
-H "Authorization: Bearer $DELVAPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"paymentIntentId":"pi_3Nf1FbR5jFwNLiigHqLodT"}'
# → { "authCode": "…", "expiresInSeconds": 600 }
Return authCode to your page together with your merchant ID (the clientId, mer_…). Returns 404 if the intent doesn't belong to your account.
Open the widget
@dashpay/link-sdk is a dependency-free loader (~2 KB). It injects a backdrop and an iframe
pointing at the hosted widget, and relays widget events to your callback with a strict origin check.
import { openLink } from "@dashpay/link-sdk";
const { authCode } = await fetch("/api/checkout/dashpay-session", { method: "POST" })
.then((r) => r.json());
const link = openLink({
linkUrl: "https://link.your-delvapay-host.example", // hosted widget origin
clientId: "YOUR_MERCHANT_ID",
authCode,
lang: "en",
style: { pc: "#3b82f6", pt: "#ffffff", br: 24, ir: 16, th: "dark" },
onEvent: (event) => {
switch (event.type) {
case "payment_submitted":
showPendingState(event.txHash);
break;
case "payment_confirmed":
showThankYou(); // UX only: fulfil on the webhook
break;
case "error":
console.warn("Delvapay widget:", event.message);
break;
}
},
onClose: () => console.log("widget closed"),
});
// link.close() closes it programmatically
Options
| Option | Type | Notes |
|---|---|---|
clientId | string | Required. Your merchant ID (mer_…), shown in the dashboard under Settings, Integration. |
authCode | string | Required. From POST /link/sessions. |
linkUrl | string? | Hosted widget origin. Defaults to http://localhost:5199 (local development). |
style | LinkStyle? | White-label theme, see below. |
lang | string? | UI language, default "en". |
onEvent | (event) => void | Widget events, see below. |
onClose | () => void | Called when the widget closes (backdrop click, close button, or close()). |
Theming: LinkStyle
Sent to the widget as base64 JSON and validated there: colours and numbers only, never raw CSS.
| Field | Type | Meaning |
|---|---|---|
pc | string | Primary colour (buttons, highlights), e.g. "#3b82f6" |
pt | string | Text colour on primary |
sc | string | Secondary colour (surfaces) |
st | string | Text colour on secondary |
br | number | Widget border radius (px) |
ir | number | List item border radius (px) |
th | "dark" | "light" | Base theme |
Events
| Event | Payload | When |
|---|---|---|
ready | - | Widget loaded and session accepted. |
payment_submitted | txHash? | The customer's wallet broadcast the transfer. |
payment_confirmed | - | The payment reached SETTLED. |
error | message | Something the customer couldn't recover from in the widget. |
close | - | The widget asked to close; the SDK removes the iframe and calls onClose. |
Browser events are for UX only. Always fulfil orders from the webhook (or by
polling GET /payments/intents/:id). Anything running in the browser can be spoofed.
Payer authorization evolving
When the customer pays from a connected wallet, the widget asks them to sign a short message with it before
sending. Delvapay uses it to screen the paying wallet before any funds move. On networks where payments still
go to your settlement wallet (settlement: "direct"), it is also what attributes the transfer:
only a USDC transfer from that address, mined after the intent was created, can settle the
intent. Payments to a Delvapay deposit address are attributed by the address alone. This happens inside the
widget; you don't need to do anything. The signed text looks like this:
Delvapay payment confirmation
Merchant: Sample store
Amount: 25 USDC on base-sepolia
Pay to: 0x7d3c9a4e1f52b80c6e9a1d0f4b2c8e5a3f6d1b90
Payment ID: 6f1c2a7e-3b0d-4c55-9a8e-0b6f1d2c3e4f
This signature only confirms the payment details. It does not send funds or give access to your wallet.
Payment ID in the signed text is the intent's UUID form (the signed format is fixed). It
refers to the same intent as its pi_ ID.
Smart-contract wallets are supported via EIP-1271 signature validation.
Embed domains evolving
The hosted widget may only be framed by sites you allow. Add your production origins (for example
https://shop.example.com) to your merchant's allowed domains in the
dashboard. The widget server turns that list into a
Content-Security-Policy: frame-ancestors … header for your clientId; browsers
refuse to render the widget on any other origin.
- No allowed domains (or an inactive merchant) means
frame-ancestors 'none', so the widget won't load in production. - Localhost origins are allowed in development builds so you can test locally.
- The policy is public and can be inspected at
GET /link/embed-policy/:clientId→{ "frameAncestors": [...] }.
Supported assets
Your customers can pay with any of the assets below. Whatever they pay with, you receive USDC on your settlement network (Base or Ethereum). USDC on your own settlement network is paid directly; every other row is converted by a swap provider.
| Asset | Network | Id | How the payer pays | Path |
|---|---|---|---|---|
| USDC USD Coin | Base | usdc-base | Wallet (one click) or QR code | Direct if you settle on Base, otherwise swapped |
| USDC USD Coin | Ethereum | usdc-ethereum | Wallet (one click) or QR code | Direct if you settle on Ethereum, otherwise swapped |
| BTC Bitcoin | Bitcoin | btc | Wallet (one click) or QR code | Swapped to USDC |
| ETH Ether | Ethereum | eth-ethereum | Wallet (one click) or QR code | Swapped to USDC |
| ETH Ether | Base | eth-base | Wallet (one click) or QR code | Swapped to USDC |
| ETH Ether | Arbitrum | eth-arbitrum | Wallet (one click) or QR code | Swapped to USDC |
| USDT Tether USD | Ethereum | usdt-ethereum | Wallet (one click) or QR code | Swapped to USDC |
| USDT Tether USD | Tron | usdt-tron | Wallet (one click) or QR code | Swapped to USDC |
| USDT Tether USD | BNB Chain | usdt-bsc | Wallet (one click) or QR code | Swapped to USDC |
| USDT Tether USD | Solana | usdt-solana | Wallet (one click) or QR code | Swapped to USDC |
| BNB BNB | BNB Chain | bnb-bsc | Wallet (one click) or QR code | Swapped to USDC |
| XRP XRP | XRP Ledger | xrp | Copy address + amount | Swapped to USDC |
| SOL Solana | Solana | sol | Wallet (one click) or QR code | Swapped to USDC |
| USDC USD Coin | Solana | usdc-solana | Wallet (one click) or QR code | Swapped to USDC |
| USDC USD Coin | Arbitrum | usdc-arbitrum | Wallet (one click) or QR code | Swapped to USDC |
| TRX Tron | Tron | trx | Wallet (one click) or QR code | Swapped to USDC |
| DOGE Dogecoin | Dogecoin | doge | QR code or copy address | Swapped to USDC |
| ADA Cardano | Cardano | ada | QR code or copy address | Swapped to USDC |
| ZEC Zcash | Zcash | zec | QR code or copy address | Swapped to USDC |
| GRAM Gram (TON) | TON | gram | Wallet (TON Connect) or QR code, from the wallet you enter | Swapped to USDC |
- Wallet (one click): the customer connects a wallet in the widget and approves the transfer there.
- QR / copy address: the widget shows a QR code (a standard payment URI where the chain has one) plus the deposit address and exact amount; any wallet or exchange withdrawal works.
- Conversions run on mainnet only. Intents on
base-sepolia/ethereum-sepoliaoffer USDC only.
How any-asset payments work
You don't integrate anything extra: the same intent, Link session and widget handle it. When the customer picks a coin other than USDC, the widget runs this flow:
-
Refund address. The customer enters an address on the coin's own chain where funds are
returned if the swap can't complete. It's validated for that chain (for example a Cardano refund address
must be a payment-only
addr1v…address, and Zcash supports transparentt1…/t3…addresses only). - Quote & deposit address. Delvapay requests an exact-output quote: the amount of the customer's coin needed so that exactly your intent amount arrives in USDC. The provider issues a one-time deposit address for that quote; it identifies the payment, so no wallet signature is needed.
- Payment. The customer sends the quoted amount to the deposit address, from a connected wallet, by scanning the QR code, or by copy-paste. The quote is valid for the intent's payment window; requesting a new quote replaces the old one in the widget.
-
Swap & delivery. When the deposit is detected the intent moves to
CONFIRMING; the provider converts the funds and sends the USDC to the payment's Delvapay deposit address. Delvapay verifies that delivery on-chain exactly like a direct USDC payment, then the intent becomesSETTLED, your balance is credited and you getpayment.settled.
Refunds, minimums and timing
- Underpayment: if less than the quote's minimum arrives, the provider refunds it to the customer's refund address; the payment isn't settled and the customer can try again.
- Overpayment: the swap still delivers your exact amount and the excess is refunded to the customer.
- Failure: if the swap can't complete, the deposit is refunded to the customer. Refunds are handled by the provider; they never pass through you or Delvapay.
- Minimums: providers set per-asset minimums (commonly ≈ $12–25; currently around $100 for TRX and USDT on TRON and higher for BNB). The widget shows the minimum when an amount is too small.
- Timing: settlement waits for the source chain to confirm the deposit (seconds on Solana, TRON and L2s; roughly 10–60 minutes for Bitcoin, Zcash and Dogecoin) plus the USDC delivery.
- Late funds: a deposit that completes after the intent expired is still credited to your balance; it is flagged for reconciliation.
Fees
The swap provider charges a small conversion fee (about 0.2–0.25%) plus origin-network costs. It is part of the amount quoted to the customer, so exactly the USDC you charged arrives; your Delvapay fee is unchanged.
Providers
Conversions are executed by third-party swap protocols: NEAR Intents 1Click as the primary route, with Relay as a fallback for EVM chains and Solana. The provider used is recorded on each payment and visible in your dashboard.
GRAM (TON)
GRAM (Toncoin, renamed in 2026) is paid on the TON network. TON has no one-time deposit addresses, so the quote is made for the customer's own wallet: they connect it with TON Connect and approve one transfer, or enter their TON address and scan a QR code that carries the required comment. The deposit must come from that same wallet; GRAM sent from any other wallet is refunded. Quotes are short-lived (about 15 minutes) and refreshed automatically. Today GRAM is converted via Relay; NEAR Intents is used automatically when its TON route is available.
Choosing which assets you accept
In the dashboard, Settings → Accepted payment assets lets an owner switch individual assets off; disabled assets aren't offered in the widget. USDC on your settlement network is always accepted. The Payments list shows what each customer paid with, and the payment detail page shows the swap leg (deposit address, source transaction, provider, refund address) with explorer links.
Your balance
Confirmed payments land in your Delvapay balance in USDC, minus the Delvapay fee. One balance covers every network: a payment received on Base can be withdrawn on Ethereum. Test keys see a separate test balance (testnet payments only), live keys the live balance (mainnet only), so testnet money can never be withdrawn as real USDC.
- Available: what you can withdraw now.
- Pending: credited but not available yet (card payments, until they are released).
- In withdrawal: requested withdrawals that are not confirmed on-chain yet.
GET /balance
curl "$DELVAPAY_API_URL/balance" -H "Authorization: Bearer $DELVAPAY_API_KEY"
{
"currency": "USDC",
"pool": "live",
"livemode": true,
"available": "1240.5",
"pending": "0",
"inWithdrawal": "300",
"custodyEnabled": true,
"networks": [
{ "network": "base", "networkFee": "0.1" },
{ "network": "ethereum", "networkFee": "3" }
],
"withdrawals": {
"mode": "AUTOMATIC",
"minAmount": "10",
"maxAmount": "10000",
"dailyMax": "25000",
"maxPerDay": 10,
"coolingOffHours": 24
}
}
Anything sent to a payment's deposit address is credited, even when it doesn't settle the payment: a transfer that arrives after the intent expired, a second payment to a settled intent, or an amount below the intent amount. The Delvapay fee applies, the payment is flagged for review, and the dashboard balance history shows the credit. The dashboard also lists every credit, fee, top-up and withdrawal under Balance.
Withdraw to your wallet
You withdraw your available balance in USDC to an address in your withdrawal address book. Before you start:
- Add addresses in the dashboard only. An owner of your account adds them under Balance → Withdrawal addresses with a two-factor code (Settings → Two-factor authentication). The API can list addresses and withdraw to them, but never create them, so a leaked API key can only send funds to addresses you already approved.
- Cooling-off. A new address can be used after a waiting period (24 hours by default), and only once Delvapay's compliance screening has cleared it. If the address can't be screened, it stays unusable until it can.
-
Network fee. A flat fee per withdrawal, per network (shown in
GET /balance), is taken from the amount: the recipient receivesamount - fee.
Withdrawals within your limits are sent automatically when your account is in automatic mode. In manual mode, or when a request goes over a limit (maximum per withdrawal, daily maximum, number per day), it waits for approval by Delvapay operations first. Requests below the minimum are refused.
GET /withdrawal-addresses
{
"items": [
{
"id": "wa_1kD8sQ2mVb7ZxR4tY9pLcE",
"network": "base",
"address": "0x4b2e9c1a7d3f50e6b8a2c4d1e9f07a3b5c6d8e21",
"label": "Treasury (Ledger)",
"status": "ACTIVE",
"usable": true,
"activatesAt": "2026-11-13T09:15:00.000Z",
"createdAt": "2026-11-12T09:15:00.000Z"
}
]
}
status is SCREENING, ACTIVE or BLOCKED.
usable is true once the address is active and its cooling-off has passed.
POST /withdrawals
The Idempotency-Key header is required: a retry with the same key returns the same withdrawal and never sends twice.
| Field | Type | Notes |
|---|---|---|
amount | string | USDC to take from your available balance, up to 6 decimals. |
addressId | string | A wa_ ID from GET /withdrawal-addresses. |
curl -X POST "$DELVAPAY_API_URL/withdrawals" \
-H "Authorization: Bearer $DELVAPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: payout_2026_11_12" \
-d '{"amount":"300","addressId":"wa_1kD8sQ2mVb7ZxR4tY9pLcE"}'
{
"id": "wd_6pQmZ3cV9tB1nX8rL2kHsA",
"status": "APPROVED",
"amount": "300",
"fee": "0.1",
"netAmount": "299.9",
"currency": "USDC",
"network": "base",
"address": "0x4b2e9c1a7d3f50e6b8a2c4d1e9f07a3b5c6d8e21",
"addressId": "wa_1kD8sQ2mVb7ZxR4tY9pLcE",
"addressLabel": "Treasury (Ledger)",
"route": "AUTOMATIC",
"txHash": null,
"failureReason": null,
"rejectReason": null,
"createdAt": "2026-11-14T10:02:11.000Z",
"approvedAt": "2026-11-14T10:02:11.000Z",
"completedAt": null
}
| Status | Meaning |
|---|---|
PENDING_APPROVAL | Waiting for Delvapay operations (manual mode or over a limit). |
HELD | On hold for review. The amount stays reserved. |
APPROVED | Approved, about to be sent. Can wait here while withdrawals are paused. |
PROCESSING | Sent; waiting for confirmations. txHash is set. |
COMPLETED | Confirmed on-chain. Final. |
REJECTED | Rejected by Delvapay (see rejectReason). The amount is back in your available balance. |
FAILED | The transfer failed on-chain (see failureReason). The amount is back in your available balance. |
List withdrawals with GET /withdrawals (newest first, ?limit= up to 200) and fetch one
with GET /withdrawals/{id}.
When a withdrawal is refused
| Status | Cause |
|---|---|
400 | No Idempotency-Key header. |
403 | A test key with a mainnet address, or a live key with a testnet address. |
404 | Unknown addressId. |
409 | The address is still in cooling-off or screening, blocked or removed, or withdrawals aren't available on its network. |
422 | Below the minimum, not above the network fee, or more than your available balance. |
Top up your balance
Each account has a permanent top-up address per network. USDC sent to it is added to your available balance
after confirmations, with no Delvapay fee, and you get topup.completed. The dashboard shows it
under Balance → Top up with a QR code.
GET /deposit-addresses/topup?network=base
{
"id": "dep_2Hx7bN4qKc9vM1sP5tR8wA",
"network": "base",
"address": "0x91c4e7a2b5d80f3e6c1a9b7d2e4f05a8c3b6d1e7",
"asset": "USDC",
"usdcContract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"warning": "Send only USDC on base. Other tokens or networks are not credited automatically."
}
Send only USDC, and only on the network you asked for. Other tokens, or USDC on another chain, are not credited automatically: contact Delvapay support to recover them.
Webhooks
Register an HTTPS endpoint in the dashboard. You'll get a signing secret that starts with
whsec_. Store it like a password. Delvapay sends a POST with a JSON body on every
payment state change, balance change and withdrawal change.
| Event type | Sent when |
|---|---|
payment.confirming | A matching on-chain transfer was submitted/observed and is waiting for confirmations. |
payment.settled | The transfer reached the required confirmations. Fulfil the order here. |
payment.failed | The transfer reverted or didn't match the intent; see failureReason. |
payment.expired | The intent passed expiresAt without a payment. |
payment.risk_flagged | Delvapay compliance flagged the payer or the received funds (AML). See Compliance. |
balance.updated | Your balance changed (payment credited, withdrawal requested or returned, top-up, card release). data.reason says why. |
withdrawal.created | A withdrawal was requested and the amount reserved. |
withdrawal.approved | Approved (automatically or by Delvapay operations) and about to be sent. |
withdrawal.completed | Confirmed on-chain; withdrawal.txHash is set. |
withdrawal.failed | The transfer failed on-chain; the amount is back in your balance. |
withdrawal.rejected | Rejected by Delvapay operations; the amount is back in your balance. |
topup.completed | USDC sent to your top-up address was credited. |
{
"id": "evt_5ayJE86G6sk9XsQLVR2qVR",
"type": "payment.settled",
"createdAt": "2026-10-02T12:04:51.000Z",
"data": {
"paymentIntentId": "pi_3Nf1FbR5jFwNLiigHqLodT",
"status": "SETTLED",
"amount": "25",
"currency": "USDC",
"network": "base-sepolia",
"txHash": "0x9c…e1",
"feeAmount": "0.25",
"method": "WALLET"
}
}
data.method is how the customer paid: WALLET (USDC from a wallet),
EXCHANGE (exchange account) or SWAP (another coin, converted). For swaps
data.source describes what the customer sent; amount, currency,
network and txHash always describe the USDC that reached the payment's deposit
address. feeAmount is the Delvapay fee already deducted from what was credited to your balance.
{
"id": "evt_2rT8kWq5Lm1Vc7Zb3Nx9Ya",
"type": "balance.updated",
"createdAt": "2026-10-02T12:04:51.000Z",
"data": {
"merchantId": "mer_4Fh2Kd9Lq3Wn6Xc1Vb8MzT",
"currency": "USDC",
"pool": "live",
"livemode": true,
"available": "1240.5",
"pending": "0",
"inWithdrawal": "0",
"reason": "payment_settled"
}
}
{
"id": "evt_7bH3nQ1xVk5Lp9Mc2Rt8Wd",
"type": "withdrawal.completed",
"createdAt": "2026-11-14T10:03:40.000Z",
"data": {
"merchantId": "mer_4Fh2Kd9Lq3Wn6Xc1Vb8MzT",
"withdrawal": {
"id": "wd_6pQmZ3cV9tB1nX8rL2kHsA",
"status": "COMPLETED",
"amount": "300",
"fee": "0.1",
"netAmount": "299.9",
"currency": "USDC",
"network": "base",
"address": "0x4b2e9c1a7d3f50e6b8a2c4d1e9f07a3b5c6d8e21",
"addressId": "wa_1kD8sQ2mVb7ZxR4tY9pLcE",
"route": "AUTOMATIC",
"txHash": "0x3f…a9",
"failureReason": null,
"rejectReason": null,
"createdAt": "2026-11-14T10:02:11.000Z",
"approvedAt": "2026-11-14T10:02:11.000Z",
"completedAt": "2026-11-14T10:03:40.000Z"
}
}
}
Every withdrawal.* event carries the same withdrawal object;
withdrawal.failed and withdrawal.rejected add a top-level reason.
topup.completed carries topup: id (tu_),
network, amount, currency, from and txHash.
Card payments (coming soon, by arrangement). When card payments are switched on for your
account, data.method can also be CARD. Card payments have no txHash:
Delvapay receives the card money and credits your balance in USDC. feeAmount is then the
platform fee plus the card fee, and data.card holds fiatAmount,
fiatCurrency, brand, last4, platformFee,
cardFee and netAmount (the USDC you are owed). Ask your Delvapay contact to enable it.
{
"id": "evt_0OzWAhXsRUDCTsUsX8HEGG",
"type": "payment.settled",
"createdAt": "2026-10-02T12:41:07.000Z",
"data": {
"paymentIntentId": "pi_3Nf1FbR5jFwNLiigHqLodT",
"status": "SETTLED",
"amount": "25",
"currency": "USDC",
"network": "base",
"txHash": "0x4a…7f",
"feeAmount": "0.25",
"method": "SWAP",
"source": {
"asset": "btc",
"network": "bitcoin",
"amount": "0.00031",
"txHash": "b6f1…c09e"
}
}
}
id(evt_…) identifies the delivery and stays the same across retries. Use it to de-duplicate.txHash,feeAmount,failureReasonandsourceare present only when relevant.source.assetis an asset id from Supported assets.- Respond with any
2xxwithin 10 seconds. Do slow work asynchronously. - Failed deliveries are retried up to 5 attempts in total with exponential backoff (about 5 s, 25 s, 2 min, 10 min). After that the delivery is marked dead and can be replayed by Delvapay support.
- Events may arrive out of order; treat
data.statusas the source of truth, or re-fetch the intent.
Verify signatures
Every request carries a delvapay-signature header:
delvapay-signature: t=1791028800,v1=5f0c0e6b…a91d
t is the Unix timestamp (seconds) when the request was signed. v1 is the hex
HMAC-SHA256 of the string "<t>.<raw body>", keyed with your full
whsec_… secret as UTF-8. To verify:
- Read the raw request body, before any JSON parsing or re-serialisation.
- Reject the request if
tis more than 5 minutes from your clock (replay protection). - Compute the HMAC and compare it to
v1with a constant-time comparison.
import { createHmac, timingSafeEqual } from "node:crypto";
const TOLERANCE_SECONDS = 5 * 60;
export function verifyDelvapaySignature(
rawBody: string,
header: string | null,
secret: string, // "whsec_…"
nowSeconds = Math.floor(Date.now() / 1000),
): boolean {
if (!header) return false;
const parts = new Map(
header.split(",").map((kv) => {
const i = kv.indexOf("=");
return [kv.slice(0, i).trim(), kv.slice(i + 1).trim()] as const;
}),
);
const t = parts.get("t");
const v1 = parts.get("v1");
if (!t || !v1 || !/^\d+$/.test(t) || !/^[0-9a-f]+$/i.test(v1)) return false;
if (Math.abs(nowSeconds - Number(t)) > TOLERANCE_SECONDS) return false;
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
const received = Buffer.from(v1, "hex");
return received.length === expected.length && timingSafeEqual(received, expected);
}
// Example: Bun.serve handler
Bun.serve({
port: 8080,
async fetch(req) {
const raw = await req.text();
const ok = verifyDelvapaySignature(
raw,
req.headers.get("delvapay-signature"),
process.env.DELVAPAY_WEBHOOK_SECRET!,
);
if (!ok) return new Response("bad signature", { status: 400 });
const event = JSON.parse(raw);
if (await alreadyProcessed(event.id)) return new Response("ok");
if (event.type === "payment.settled") await fulfilOrder(event.data.paymentIntentId);
return new Response("ok");
},
});
With Express, mount express.raw({ type: "application/json" }) on the webhook route so you
receive the exact bytes that were signed.
Compliance (AML screening)
Delvapay screens payments with a blockchain-analytics provider (Scorechain). The first check happens before the customer pays: the paying wallet (or, for other coins, the refund/sending address) is checked when the customer verifies it in the widget. After a payment arrives, the incoming transaction is screened too. Your withdrawal addresses are screened before first use and again before every withdrawal: a withdrawal is only sent once its address has a clear screening result.
| Risk level | Before payment | After payment | What you see |
|---|---|---|---|
| Low | Allowed | Recorded | Nothing |
| Medium | Allowed (declined if you chose Strict) | Reviewed by Delvapay compliance | Only if compliance shares it with you |
| High (darknet, mixers, scams, stolen funds, ransomware…) | Declined | You are notified | Badge + payment.risk_flagged |
| Severe (sanctions exposure) | Declined | You are notified; mandatory escalation | Badge + payment.risk_flagged |
-
Customers never learn why. A declined customer sees a neutral
"We can't process this payment. Please contact the merchant." The API answers
403{"error":{"code":"payment_declined","message":"We can't process this payment."}}for every risk level, and the widget emitserrorwithpayment_declined. Don't reveal the reason either; nothing was charged. -
Settlement is never reversed. A payment flagged after it arrived stays
SETTLED(the funds are already credited to your balance); the dashboard shows Settled · compliance review and a recommendation, e.g. hold the goods or credits. - Risk tolerance: dashboard → Settings. Standard declines high-risk and sanctioned payers; Strict also declines medium-risk ones. You can tighten Delvapay's baseline, never loosen it.
- If the screening provider is unavailable, payments continue and are screened again in the background.
{
"id": "evt_2Jj79Juu7D0jAUCvzLHeEB",
"type": "payment.risk_flagged",
"createdAt": "2026-10-03T15:12:09.000Z",
"data": {
"riskId": "scr_4hWZ2UOFqiraRSjcycbZGe",
"paymentIntentId": "pi_3Nf1FbR5jFwNLiigHqLodT",
"tier": "HIGH",
"category": "Darknet market",
"categories": ["Darknet market"],
"stage": "post_payment",
"outcome": "flagged",
"recommendation": "Hold delivery of goods/credits until Delvapay compliance completes its review.",
"flaggedAt": "2026-10-03T15:12:08.000Z",
"status": "SETTLED",
"amount": "25",
"currency": "USDC",
"network": "base"
}
}
tier is MEDIUM, HIGH or SEVERE; outcome is
blocked (a customer was declined before paying, nothing received) or flagged
(funds received, under review). One event per finding (riskId); a payment can have several.
Categories are a summary; raw analytics data is never shared.
Idempotency
POST /payments/intents requires an Idempotency-Key header (missing →
400). Keys are scoped to your merchant account and never expire: repeating a request with the
same key returns the original intent instead of creating a new one, so network retries can never
double-charge a customer.
- Use a stable identifier from your system, such as the order ID.
- The original intent is returned even if the retried body differs. Use a new key for a new amount.
- Other writes are naturally idempotent: Link sessions are cheap and single-use, and re-reporting the same transaction hash returns the existing transaction.
Payment states
| Status | Meaning | Webhook |
|---|---|---|
CREATED | Intent created; the widget hasn't been opened yet. | - |
FUNDING_SELECTED | The widget opened and the customer can pay. | - |
CONFIRMING | A transfer was submitted and is waiting for confirmations or, for any-asset payments, the deposit was detected and is being converted. Further payments are refused. | payment.confirming |
SETTLED | Terminal. USDC confirmed at the deposit address; your balance is credited (net of the fee). | payment.settled |
FAILED | Terminal. The transfer reverted or didn't match. | payment.failed |
EXPIRED | Terminal. No payment before expiresAt (30 min). | payment.expired |
QUOTED and EXECUTING are reserved and not used yet. If an any-asset swap is
refunded or fails, the intent returns to FUNDING_SELECTED so the customer can retry (or expires
as usual). Treat unknown statuses as non-terminal.
Errors & status codes
Errors use standard HTTP status codes. Business errors (e.g. 401, 404,
409) return a short plain-text message; read it with res.text(). Validation
(422), rate-limit (429), unknown-route and server errors return JSON:
{"error":{"code":"…","message":"…"}}. Every response carries an x-request-id
header. Include it when contacting support.
| Code | Meaning | Examples |
|---|---|---|
200 | Success | Including an idempotent replay of an existing intent. |
400 | Bad request | Idempotency-Key header is required |
401 | Not authenticated | Missing/invalid API key; invalid or expired authCode. |
403 | Forbidden | Merchant not active; payment_declined in the widget (compliance, see Compliance). |
404 | Not found | Intent doesn't exist or belongs to another merchant. |
409 | Conflict with current state | Payment already confirming/completed, intent expired. |
410 | Gone | The intent behind a session no longer exists. |
422 | Validation failed / limit exceeded | Malformed amount, unsupported network, or an Idempotency-Key reused with a different body (idempotency_key_reused). limit_exceeded: see below. |
429 | Rate limited | Wait Retry-After seconds. |
503 | Temporarily unavailable | offering_paused / maintenance, see below. Honour Retry-After when present. |
5xx | Delvapay error | Retry with backoff; intent creation is safe to retry with the same key. |
Paused offerings & limits
Delvapay can temporarily pause a payment option (for example a network outage, an exchange delaying
withdrawals, or scheduled maintenance) and enforces per-payment and daily limits. These come back as
JSON with the affected scope (GLOBAL, MERCHANT, METHOD,
NETWORK, ASSET, PROVIDER, EXCHANGE, WALLET),
its key and a human-readable reason you can show your customer:
// 503, Retry-After: 840 (when the end is known)
{"error":{"code":"offering_paused","message":"Base network upgrade","scope":"NETWORK","key":"base",
"reason":"Base network upgrade","until":"2026-10-03T14:30:00.000Z"}}
// 422: amounts are USD decimal strings (1 USDC = 1 USD)
{"error":{"code":"limit_exceeded","message":"Maximum payment is $10,000","scope":"GLOBAL","key":"payments",
"reason":"Maximum payment is $10,000","limit":{"kind":"max","limit":"10000","value":"12500"}}}
| Code | Status | What to do |
|---|---|---|
offering_paused | 503 | Paused by Delvapay. Retry after until / Retry-After; other networks or methods may still work. |
maintenance | 503 | Scheduled maintenance window; ends at until. Upcoming windows are shown in your dashboard 24h ahead. |
limit_exceeded | 422 | limit.kind is min, max, daily_cap, payer_daily_cap or open_quotes. Use a different amount, or retry later for rolling 24h caps. |
policy_unavailable | 503 | Transient; retry after a few seconds. |
Where they can occur: POST /payments/intents and POST /link/sessions (so you can
tell the customer before opening the widget), and inside the widget, which shows the reason to the payer.
A pause never affects payments already sent; those always complete and fire webhooks as usual.
Test mode & testnets
Use a dp_test_ key with a testnet network to run the full flow with valueless tokens. Testnet intents accept USDC only: swap providers run on mainnet, so any-asset payments can only be tried with real (small) amounts on a live network.
| Network | Chain ID | USDC contract |
|---|---|---|
base-sepolia | 84532 | 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
ethereum-sepolia | 11155111 | 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 |
base live | 8453 | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
ethereum live | 1 | 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 |
- Test payments land in your test balance (dashboard → Balance, switch to Test). To try withdrawals, add a testnet address to your address book.
- Get test USDC from Circle's faucet at faucet.circle.com (pick Base Sepolia).
- The paying wallet also needs a little testnet ETH for gas on the same network.
- Create an intent with
"network": "base-sepolia", open the widget and pay.
Settlement waits for a fixed number of block confirmations (3 by default), so expect
payment.settled a few seconds after payment.confirming on Base Sepolia.
Rate limits
Limits use fixed one-minute windows. When exceeded, the API responds with 429 Too Many Requests,
a Retry-After header (seconds) and the body
{"error":{"code":"rate_limited","message":"…"}}. Back off on 429 and 5xx.
| Scope | Keyed by | Limit |
|---|---|---|
Merchant API (/payments, /link/sessions) | API key | 600 / min |
Widget endpoints (/link/*) | Client IP | 120 / min |
Wallet registry (/registry/wallets) | Client IP | 120 / min |
Ready to build?
Create an account and grab a test key.