AQUA Pay Web API
Accept Bitcoin payments on any website. One API call creates a checkout session with Lightning and L-BTC payment options, and Bitcoin on-chain and USDT on Liquid when your store has them switched on. Redirect the customer to the hosted checkout or render the QR codes yourself, then get notified via webhook when they pay.
Payment rails at a glance
Every payment session offers Lightning and L-BTC on Liquid. Bitcoin on-chain and USDT on Liquid are optional: switch them on in Settings. Above Indra's Lightning maximum a payment has no Lightning and is paid directly — see USDT on Liquid and the limits below.
| Rail | Customer wallet | Settlement speed | Fires webhook at |
|---|---|---|---|
| Lightning | AQUA, Phoenix, Wallet of Satoshi, any LN wallet | 2–10 seconds | The buyer's invoice is paid and Indra's L-BTC lockup is seen (seconds) |
| Liquid | AQUA, Green, any Liquid wallet | ~60 seconds | Transaction confirmed (1 Liquid block) |
| Bitcoin | Any Bitcoin wallet | 10–60 minutes | The transaction has the confirmations your store chose (1, 2, 3 or 6) |
| USDT | AQUA, any Liquid wallet holding USDT | ~60 seconds | Transaction confirmed (1 Liquid block) |
Indra's fee, 0.25%, applies to Lightning payments only, plus the Liquid network fee of claiming the L-BTC into your wallet (a few dozen sats). An L-BTC, USDT or Bitcoin on-chain payment goes straight to your wallet with no swap; the buyer pays its network fee.
A buyer who pays the Lightning invoice from a wallet that holds L-BTC — AQUA does this — may pay the payment's L-BTC address directly instead. The payment then settles like a Liquid payment, after one Liquid block, and its Lightning invoice simply expires unpaid.
There are two integration modes: hosted (redirect to checkout_url, AQUA Pay handles the UI) and headless (render the QR codes yourself using the raw invoice and address fields). See Headless integration for the second approach.
Quick start
-
1
Get your secret key. It is shown once, when your store is created (on Home and in Dashboard → Developer → API credentials), and is stored only as a hash. If you did not save it, rotate it there to get a new one. It starts with
ak_live_. Keep it on your server — never put it in HTML or commit it to version control. -
2
Create a payment session from your backend:
Node.jsconst resp = await fetch('https://pay.aqua.net/api/v1/payments', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.AQUA_PAY_SECRET_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ amount: 49.99, currency: 'EUR', redirect_url: 'https://yoursite.com/order/complete', }), }); const { checkout_url } = await resp.json(); // redirect the customer to checkout_url
cURLcurl -X POST https://pay.aqua.net/api/v1/payments \ -H "Authorization: Bearer $AQUA_PAY_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{"amount":49.99,"currency":"EUR","redirect_url":"https://yoursite.com/order/complete"}' -
3
Redirect the customer to
checkout_url. They'll see a Lightning invoice and an L-BTC address, and a Bitcoin on-chain tab if your store has it switched on. After paying they see a short return page for 10 seconds (with a Continue now button) and are then sent to yourredirect_url. You'll receive a webhook event when payment confirms.
Accounts, stores and roles
An account is a person; a store is what takes payments. Sign in at pay.aqua.net/account with a 6-digit code emailed to you — there are no passwords. Signing up is the same flow: your email, the code, accepting the Terms, naming your first store, then scanning the QR code with AQUA to connect its wallet.
- An account can own several stores. Each store has its own wallet, API keys, payments, links, webhooks and invoice numbering.
- One wallet per store. Two stores on one wallet would hand out the same addresses, so a wallet another store holds is refused with
409 wallet_in_use. Use a different wallet for each store. - Your plan belongs to the account and covers every store it owns.
Roles
Every store has one owner — the account that holds it — and, as its plan allows, managers and bookkeepers, each signing in with their own account (Settings → People). Business includes one manager per store; Enterprise up to three managers and two bookkeepers; Starter none. Open invitations count towards those places. During the private launch every account runs on Business, so a store can have one manager. In the API the bookkeeper role is staff.
| Role | Can |
|---|---|
| Owner | Everything, including what only the owner can do: the Developer tab, API keys, webhooks, the payout wallet, the notification email, billing and deleting the store. |
| Manager | What a bookkeeper can, plus payment links, the test payment, store settings, credit notes, starting and cancelling refunds, and managing bookkeepers. Only the owner invites, pauses or removes managers. |
| Bookkeeper | Read payments and their documents — invoices, receipts, credit notes — resend receipts and export. |
A secret API key belongs to the store, not a person, so it is not role-checked; that is why only the owner can see or rotate it.
Authentication
All API requests require a key in the Authorization header.
Authorization: Bearer <your_api_key>
| Key type | Prefix | Use |
|---|---|---|
| Secret key | ak_live_… |
Server-side only. Grants full access. Never expose in HTML or client-side code. |
| Publishable key | ak_pub_… |
Safe to embed in frontend code and HTML. Can create payments and read them without metadata, reference or created_with. Used with the JS SDK and the embed widget. |
Your secret key is shown once, when the store is created, and only its hash is kept — AQUA Pay cannot show it again. Dashboard → Developer → API credentials rotates it: the new key is shown once, and every earlier secret key stops working at once, with no overlap, so update your server straight away. Find your publishable key in Dashboard → Developer tab → Integration.
Create a payment
POST/api/v1/payments
Creates a Bitcoin checkout session. Returns a Lightning invoice, a Liquid BTC address, and a hosted checkout_url. Use the checkout_url to redirect the customer (hosted flow), or render the invoice/address directly in your own UI (headless flow).
Request headers
| Header | Description | |
|---|---|---|
Authorization | required | Bearer ak_live_… — your secret API key, from your server; or Bearer ak_pub_… — your publishable key, from the buyer's browser (it cannot send reference). |
Idempotency-Key | optional | Unique string (e.g. your internal order ID); secret key only, ignored with a publishable key. Re-sending the same key with the same body replays the original response — safe to retry on network errors. Sending the same key with a different body returns 422 idempotency_key_reused_with_different_payload. Keys expire after 24 hours. |
Request body
| Field | Type | Description | |
|---|---|---|---|
amount | number | required | Amount to charge (e.g. 49.99). amount_fiat is accepted as an alias; amount wins if both are sent. Must convert to at least 1,000 sats at the current BTC rate — smaller amounts return 400; they are never rounded up. At most as many decimals as the currency has (2, or 0 for JPY, HUF, CLP, COP, ARS, KRW, TWD, IDR, CRC, PYG, NGN, UGX, TZS, XOF, XAF, VND, PKR and KZT), else 400 amount_precision. Above Indra's current Lightning limit (500,000 sats today, read live) the payment is created without Lightning and paid directly — see Above Indra's Lightning maximum. Only an amount no method takes (more than 10,000,000 sats for L-BTC and Bitcoin on-chain, and more than 10,000 USDT) is refused, with 400 Amount too large — no payment method takes … sats; the most is … sats, before anything is created. |
currency | string | required | ISO 4217 code — "EUR", "USD", "GBP", "CAD", "AUD", "JPY", "CHF", "DKK", "BRL" |
redirect_url | string | optional | URL to return the customer to after payment. The checkout shows a return page for 10 seconds (with a Continue now button), then opens the URL with payment_id=…&status=paid appended. It must be https://, at most 2,048 characters, with no user name or password, and not a private or local address (localhost, 10.…, 192.168.… and so on) — else 400, see Error codes. Available on every store while AQUA Pay is free during the private launch; once paid plans start, a return page is a Business and Enterprise feature. A secret key will already need one of those plans; with a publishable key on a plan without it, the URL is ignored and the payment is still created. The response's redirect_url is the URL the payment will use — null when it was ignored. |
description | string | optional | Human-readable description shown on the hosted checkout page and the invoice. Longer than 500 characters is cut to 500. |
line_items | array | optional | Itemised breakdown printed on the invoice. Up to 20 objects of {description, qty, unit_price}. The rows must total exactly amount — see below. |
metadata | object | optional | Any key/value pairs you want to attach (max 2 KB, else 400). Included in webhook payloads, and returned by GET /payments/:id to a secret key. |
reference | string | optional | Your own order or invoice number, 1–128 characters with no control characters. Secret key only — a publishable key sending one gets 400 reference_requires_secret_key. Not unique: a new payment for the same order after one expired may carry it too. Returned in the response, in webhooks and by GET /payments/:id to a secret key; find payments by it with GET /payments/list?reference=. |
Which payments to trust: created_with
Every payment records how it was created: secret (your server, with your secret key), publishable (a browser, through the embed — the buyer's browser chose the amount and the metadata) or link (a payment link). It is in the create response, in webhooks and, for a secret key, on GET /payments/:id. Treat metadata and reference as your link to an order only when created_with is secret, and always check that the amount is the order's. It is null on earlier payments not made from a link, whose key was never recorded. Payment-link payments carry no metadata; match them by the link_id in their webhook payload.
Line items
line_items is an optional breakdown printed on the PDF invoice. It never changes the price: amount stays the single source of truth for what the customer pays, and the rows must reconcile to it exactly, or the request is rejected with 400.
{
"amount": 819.88,
"currency": "EUR",
"line_items": [
{ "description": "Design retainer", "qty": 1, "unit_price": 500 },
{ "description": "Hosting (12 months)", "qty": 12, "unit_price": 9.99 },
{ "description": "Support hours", "qty": 2.5, "unit_price": 80 }
]
}
- Maximum 20 rows.
descriptionup to 200 characters;qtypositive, up to 100,000, with at most 3 decimals (e.g.2.5hours);unit_pricefrom 0 to 10,000,000, with no more decimals than the currency has. Anything else is400, naming the row. - Each row's total (
qty×unit_price) is rounded to the currency's precision first, then the rows are summed — so what is printed always adds up. Note thatJPYis zero-decimal. - Omit the field entirely for a single-line invoice using
description. Sending[]is an error. - Also accepted on
POST /api/v1/payment-links(fixed-amount links only), where the rows are copied onto every payment created from the link.
Response 201
{
"payment_id": "pmt_abc123",
"status": "pending",
"amount_fiat": 49.99,
"currency": "EUR",
"amount_sats": 62341,
"invoice_sats": 62341, // the amount in the Lightning invoice — equals amount_sats
"methods": ["lightning", "liquid"],
"lightning_invoice": "lnbc623u1p...",
"liquid_address": "VJL4iV2MML...",
"usdt_amount": null, // USDT on Liquid, when offered: "54.10", paid to liquid_address
"usdt_bip21_uri": null, // the QR content for USDT — see USDT on Liquid
"btc_address": null, // Bitcoin on-chain: null until asked for — see below
"btc_amount_sat": null,
"btc_bip21_uri": null,
"btc_window_ends_at": null,
"btc_confirmations_required": null,
"btc_confirmations": null,
"btc_txid": null,
"btc_stage": "not_allocated",
"checkout_url": "https://pay.aqua.net/pay/pmt_abc123",
"redirect_url": "https://yoursite.com/order/complete", // null when none was sent or it was ignored
"expires_at": "2026-05-15T14:23:00.000Z", // the Lightning invoice: 10 minutes
"created_with": "secret",
"reference": null // the reference you sent, if any
}
Error responses
| Status | Error | When |
|---|---|---|
400 | (message) | A field is missing or invalid: amount, currency, amount_precision, the minimum amount, redirect_url, metadata, reference, line_items — or the store's wallet is not connected, or no payment method takes the amount (above Lightning, L-BTC, USDT and Bitcoin on-chain maximums). |
402 | payments_paused | Once paid plans start: new payments are paused — the plan and its grace period have ended, or the free trial is used up. |
403 | pro_plan_required | Once paid plans start: a secret key on a plan without the REST API. |
409 | request_in_flight | An identical Idempotency-Key was submitted concurrently and is still being processed. |
422 | idempotency_key_reused_with_different_payload | The key was seen before with a different request body. |
429 | rate_limit_exceeded · too_many_open_payments | Too many requests, or too many payments still open — see Rate limits. |
503 | (message) | The exchange rate or Indra could not be reached. Nothing was created; retry. |
Every error, with its exact text, is in Error codes.
Above Indra's Lightning maximum the payment is created without Lightning: lightning_invoice and invoice_sats are null, methods has no lightning, and the buyer pays directly — L-BTC up to 10,000,000 sats (liquid), USDT up to 10,000 USDT (usdt, when offered), Bitcoin on-chain up to 10,000,000 sats (bitcoin, when offered). methods always lists exactly what the payment takes.
The Lightning invoice is valid for 10 minutes (expires_at), and an unpaid payment then expires and the customer sees an "expired" page; a payment without Lightning closes 10 minutes after creation the same way. Two things keep it open longer: once the buyer opens the Bitcoin tab, the payment stays pending until the Bitcoin window ends (60 minutes from when the address was created, btc_window_ends_at); and a Bitcoin, L-BTC or USDT transaction already seen keeps it pending until it confirms. Use invoice_sats for the displayed Lightning amount — it is the amount encoded in the invoice, and equals amount_sats.
Full example
// POST handler for your checkout page app.post('/checkout', async (req, res) => { const resp = await fetch('https://pay.aqua.net/api/v1/payments', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.AQUA_PAY_SECRET_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ amount: req.body.total, currency: 'EUR', redirect_url: `https://yoursite.com/orders/${req.body.orderId}`, metadata: { order_id: req.body.orderId }, }), }); if (!resp.ok) throw new Error('Payment creation failed'); const { checkout_url } = await resp.json(); res.redirect(303, checkout_url); });
Get a payment
GET/api/v1/payments/:payment_id
Retrieve the current state of a payment session. Useful for server-side status polling.
Response 200
{
"payment_id": "pmt_abc123",
"status": "paid",
"amount_fiat": 49.99,
"currency": "EUR",
"amount_sats": 62341,
"invoice_sats": 62341,
"methods": ["lightning", "liquid"],
"lightning_invoice": "lnbc623u1p...",
"liquid_address": "VJL4iV2MML...",
"usdt_amount": null, // as on POST — see USDT on Liquid
"usdt_bip21_uri": null,
"btc_address": null, // the btc_* fields as on POST — see Bitcoin on-chain
"btc_amount_sat": null,
"btc_bip21_uri": null,
"btc_window_ends_at": null,
"btc_confirmations_required": null,
"btc_confirmations": null,
"btc_txid": null,
"btc_stage": "not_allocated",
"checkout_url": "https://pay.aqua.net/pay/pmt_abc123",
"created_at": "2026-05-15T14:08:00.000Z",
"settled_at": "2026-05-15T14:09:41.000Z", // null when pending
"settled_asset": "btc", // btc | usdt once paid; null when pending
"credit_state": "none", // none | partial | full — see Credit notes
"metadata": { "order_id": "1234" }, // secret key only
"reference": "ORD-1234", // secret key only
"created_with": "secret" // secret key only
}
metadata, reference and created_with are returned to a secret key only. A publishable key is public — it is in your web page — and a payment id is in every checkout link, so a publishable key gets the other fields alone.
Payment statuses
| Status | Meaning |
|---|---|
| pending | Awaiting customer payment. The checkout page is live. |
| paid | Payment confirmed. Settled to the merchant's AQUA wallet. |
| expired | Nothing was paid in time: the 10-minute Lightning invoice expired, and any Bitcoin window (60 minutes) ended with nothing seen. |
An expired payment may reopen to pending (payment.reopened) when the exact amount arrives late: L-BTC within 24 hours of creation, or Bitcoin on-chain within 7 days of the end of its window. Treat a later paid as paid.
Payment lifecycle
Your backend AQUA Pay API Customer browser Wallet / Network
│ │ │ │
│ POST /payments │ │ │
│─────────────────────▶│ │ │
│ { checkout_url } │ │ │
│◀─────────────────────│ │ │
│ │ │ │
│ redirect to │ │ │
│ checkout_url ───────────────────────────────▶│ │
│ │ │ scan QR / tap link │
│ │ │─────────────────────▶│
│ │ │ │ pay
│ │◀────────── Lightning paid, lockup seen ───────│
│ │ │ │
│ POST webhook │ │ │
│◀─────────────────────│ return page (10 s) ──▶│ │
│ payment.confirmed │ then redirect_url │ │
List payments
GET/api/v1/payments/list
The store's payments, newest first. Works with any secret key — no plan gate — and from the dashboard.
| Query | Description | |
|---|---|---|
status | optional | all, or a comma-separated subset of pending, paid, expired. Default pending,paid. |
limit | optional | 1 to 200, default 50. |
before | optional | The cursor: next_before from the previous page. |
reference | optional | Exact match on the reference you sent at creation. Not unique — every match is listed. |
200{
"payments": [ { "payment_id": "pmt_abc123", "status": "paid", "created_at": "…", "amount_fiat": 49.99, … } ],
"next_before": "2026-05-15T14:08:00.000Z|pmt_abc123" // null on the last page
}
Each row also carries invoice_channel (lightning, liquid or bitcoin, how it was paid), the buyer's name and email, order_sats (the order in sats — the list's name for amount_sats), service_name (the link title or description), the invoice number and status, credit_note_number and latest_credit_note, underpaid_sats (in sats; null for a USDT underpayment) and underpaid_asset, settled_asset (btc or usdt once paid), reference, created_with and can_replace. An invalid status, before or reference is 400; a publishable key gets 403.
Bitcoin on-chain
Bitcoin on-chain is an optional third payment rail. The buyer pays from any Bitcoin wallet, straight to the Bitcoin account of your connected AQUA wallet — no swap, no Indra fee, and AQUA Pay never holds the coins. The buyer pays the network fee; you pay one when you later spend what you received, which is why Bitcoin is offered only for orders between 20,000 and 10,000,000 sats.
payment.confirmed fires — only when its transaction has the number of confirmations your store chose: 1, 2, 3 or 6. A Bitcoin block takes about 10 minutes, often longer. A payment is never counted before its first confirmation, because an unconfirmed transaction can still be replaced by one that pays someone else.Enable
In Dashboard → Settings → Payment methods, switch on Bitcoin on-chain and choose the confirmations. A change applies to payments whose Bitcoin address is created afterwards, and the store owner is emailed about every change. If the switch reports that your wallet gave no usable Bitcoin account, reconnect the wallet in Settings → Payout wallet (store owner; replacing a connected wallet asks for a code emailed to your account).
Getting the address
When methods includes "bitcoin", the payment does not yet have a Bitcoin address: one is created only when it is going to be shown, so an abandoned checkout uses none. Ask for it with POST /api/v1/payments/:id/bitcoin (secret or publishable key), or from the buyer's page with POST /api/v1/checkout/:id/bitcoin (no auth, same answer). The hosted checkout and the embed do this when the buyer opens the Bitcoin tab; GET /api/v1/checkout/:id says whether to show the tab in bitcoin_available. The call is idempotent — the same address every time.
{
"payment_id": "pmt_abc123",
"btc_address": "bc1q...", // native SegWit, on your wallet's Bitcoin account
"btc_amount_sat": 62341, // send exactly this, in one transaction
"btc_bip21_uri": "bitcoin:bc1q...?amount=0.00062341",
"btc_window_ends_at": "2026-11-01T13:00:00.000Z", // 60 minutes
"btc_confirmations_required": 1,
"btc_confirmations": null,
"btc_txid": null,
"btc_stage": "awaiting_payment"
}
A refusal carries a reason:
| Status | Error | reason |
|---|---|---|
409 | bitcoin_not_available | bitcoin_not_enabled (switched off) · no_bitcoin_account (the wallet gave no usable Bitcoin account) · amount_out_of_range |
409 | payment_not_open | payment_not_open — the payment is no longer pending and has no address |
503 | bitcoin_temporarily_unavailable | address_limit_reached · explorer_unavailable — try again later |
404 | Payment not found | Unknown payment, or another store's |
Lightning and Liquid still work either way.
Stages
btc_stage is on GET /api/v1/payments/:id; a buyer-facing page can poll GET /api/v1/checkout/:id/btc-status (no auth, read-only). It answers with its own short names — {"status", "stage", "confirmations", "confirmations_required", "txid", "window_ends_at"} — and allows 30 polls a minute per payment (more is 429 {"status":"poll_too_fast"}).
| Stage | What it means | Action |
|---|---|---|
not_allocated | No address yet. | Ask for one when the buyer chooses Bitcoin. |
awaiting_payment | The address is open for 60 minutes. | Show the BIP21 QR, the address and the exact amount. |
detected | A transaction paying the amount was seen; btc_confirmations counts up to btc_confirmations_required. | Hide the QR and show the progress. The buyer can close the page. |
paid | Confirmed. payment.confirmed has fired. | Show success. |
window_closed | The 60 minutes ended with nothing seen. | Tell the buyer not to send to this address any more. |
closed | The payment ended another way, or was paid with Lightning or Liquid. | — |
payment.reopened, then payment.confirmed). Less than the amount, or several smaller transactions, never settles: you are emailed and decide with the buyer.Settlement timing comparison
| Rail | Typical speed | payment.confirmed fires when | Confirmation model |
|---|---|---|---|
| Lightning | 2–10 seconds | The buyer's invoice is paid and Indra's L-BTC lockup is seen (seconds) | Instant — preimage reveals atomically |
| Liquid | ~60 seconds | Transaction confirmed | 1 Liquid block (~60s); the amount and asset are verified cryptographically |
| Bitcoin | 10–60 minutes | The transaction has your store's confirmations | 1, 2, 3 or 6 Bitcoin blocks (~10 min each); the amount is read from the transaction itself |
USDT on Liquid
USDT on Liquid is an optional payment method. The buyer pays Tether's USDT on the Liquid network straight to your connected AQUA wallet — to the payment's liquid_address, the same address as its L-BTC. There is no swap and no Indra fee, and AQUA Pay never holds the USDT. The buyer pays the Liquid network fee (in L-BTC, or in USDT with AQUA's fee option).
Enable
Dashboard → Settings → USDT on Liquid (the store's owner or manager). It applies to payments created afterwards; the owner is emailed whenever it changes. It is off by default, and available on every plan.
The amount
Fixed when the payment is created. USDT is priced 1:1 with the US dollar; a price in another currency is converted at the same rate source as the Bitcoin amount (Ankara), and rounded up to the cent. A payment offers USDT up to 10,000 USDT; the 1,000-sat minimum of every payment applies. When USDT is offered, methods includes usdt and the payment carries:
| Field | Meaning |
|---|---|
usdt_amount | The USDT to send, as a decimal string — "54.10" |
usdt_bip21_uri | The QR content: liquidnetwork:<liquid_address>?amount=54.10000000&assetid=ce091c998b83c78bb71a632313ba3760f1763d9cfcffae02258ffa9865a37bd2. AQUA selects USDT and fills the amount in. |
settled_asset | Once paid: usdt for a payment paid in USDT, btc for Lightning, L-BTC or Bitcoin on-chain. null while pending. |
Settlement
A payment that offers USDT takes L-BTC or USDT at its one address, whichever arrives first, in one transaction; amounts in the two assets are never added together. It settles at one Liquid confirmation (about a minute), with the same rules as L-BTC: a transaction from before the payment is ignored, a shortfall is an underpayment (you are emailed, in USDT), and the exact amount arriving within 24 hours of an expired payment reopens it. A webhook's settled_asset and amount_usdt say what it was paid in.
A payment paid in USDT is stated in USDT everywhere: its invoice ("USDT (liquid)", the USDT amount and the rate), the accounting export (paid_asset, amount_usdt), emails and the dashboard — never as a sats amount.
Refunds
A payment received in USDT is refunded in USDT, to a Liquid address the buyer gives, from your AQUA wallet — in the app like any other refund, with its credit note.
Above Indra's Lightning maximum
A payment above Indra's current reverse-swap maximum is created without Lightning and paid directly: lightning_invoice and invoice_sats are null, and methods lists what takes the amount — liquid up to 10,000,000 sats, usdt up to 10,000 USDT, bitcoin up to 10,000,000 sats. If none does, POST /payments answers 400. Such a payment closes 10 minutes after it was created, unless its L-BTC, USDT or Bitcoin transaction has been seen or its Bitcoin window is open.
Headless integration
The hosted checkout — redirect to checkout_url — handles the full payment UI automatically. If you need to embed payment inside your own page (no redirect), use the raw invoice and address fields returned by POST /payments.
QR encoding rules
These rules are critical. Encoding the wrong value breaks wallet scanning silently.
| Rail | Encode in QR | Use as href (tap-to-pay) |
|---|---|---|
| Lightning | Bare BOLT11 string — lnbc623u1p… |
lightning:lnbc623u1p… |
| Liquid | Liquid URI with the amount and the L-BTC asset, so the wallet fills both in — liquidnetwork:VJL4iV2MML…?amount=0.00062341&assetid=6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d, built from liquid_address and amount_sats (8 decimals). The bare address also works; the buyer then types the amount. |
Same URI. A Copy button copies the bare liquid_address |
| Bitcoin | BIP21 URI — bitcoin:bc1q…?amount=0.00062341 (btc_bip21_uri) |
Same BIP21 URI |
| USDT | Liquid URI with the USDT asset and amount — usdt_bip21_uri (liquidnetwork:VJL4iV2MML…?amount=54.10000000&assetid=ce091c99…). Never the bare address: the buyer would have to pick the asset and type the amount. |
Same URI. A Copy button copies the bare liquid_address |
lightning: prefix to the Lightning QR content. AQUA, Phoenix, and most wallets expect the bare BOLT11 string inside the QR image. The lightning: scheme is for clickable <a href="..."> deep links only.invoice_sats vs amount_sats
Always display invoice_sats on the Lightning tab — this is the exact satoshi amount encoded inside the BOLT11 invoice. amount_sats is the converted order total. Since 2026-10-17 the two are always equal: an order below the minimum payment is refused rather than padded up to it, so the buyer never pays more than the price. Use amount_sats for the order total display.
Rendering the tabs
const { methods, lightning_invoice, // bare BOLT11 invoice_sats, // always use this for Lightning amount display liquid_address, // bare Liquid address (for Copy) amount_sats, // use for order total usdt_amount, // USDT to send, when methods has 'usdt' usdt_bip21_uri, // the USDT QR content } = payment; // Lightning tab if (methods.includes('lightning')) { renderQR(lightning_invoice); // bare — no lightning: prefix lnLink.href = `lightning:${lightning_invoice}`; // href only lnSats.textContent = `${invoice_sats.toLocaleString()} sats`; } // Liquid tab if (methods.includes('liquid')) { const lbtc = (amount_sats / 1e8).toFixed(8); renderQR(`liquidnetwork:${liquid_address}?amount=${lbtc}&assetid=${LBTC_ASSET_ID}`); // wallet fills the amount in lqSats.textContent = `${amount_sats.toLocaleString()} sats of L-BTC`; if (!methods.includes('usdt')) lqNote.textContent = 'This address accepts L-BTC only. Do not send USDT.'; } // USDT tab — same address, its own URI with the USDT asset and amount if (methods.includes('usdt')) { renderQR(usdt_bip21_uri); usdtAmount.textContent = `${usdt_amount} USDT on Liquid`; } // Bitcoin on-chain tab — ask for the address when the buyer chooses it if (methods.includes('bitcoin')) { btcTab.addEventListener('click', async () => { const btc = await getBitcoinAddress(payment.payment_id); // your server → POST /payments/:id/bitcoin, or POST /checkout/:id/bitcoin from the page renderQR(btc.btc_bip21_uri); // BIP21 for QR and href btcLink.href = btc.btc_bip21_uri; btcSats.textContent = `${btc.btc_amount_sat.toLocaleString()} sats`; btcNote.textContent = `Settles after ${btc.btc_confirmations_required} confirmation(s) — about 10 minutes each.`; }); }
Polling for status
Poll GET /api/v1/payments/:id from your server and push updates to your frontend. paid is final. expired is not always final: an expired payment may reopen to pending if the exact amount arrives late — L-BTC or USDT within 24 hours of creation, Bitcoin on-chain within 7 days of its window — so after it expires keep checking slowly — or rely on the payment.confirmed webhook.
async function pollUntilSettled(paymentId, apiKey) { const started = Date.now(); while (Date.now() - started < 8 * 86400e3) { // late Bitcoin can still settle up to 7 days after its window const res = await fetch(`https://pay.aqua.net/api/v1/payments/${paymentId}`, { headers: { 'Authorization': `Bearer ${apiKey}` } }); const data = await res.json(); if (data.status === 'paid') return data; // final // pending: every 4 s (every minute once a Bitcoin tx is waiting for confirmations); // expired: may still reopen, so check every 5 minutes const wait = data.status === 'expired' ? 300000 : data.btc_stage === 'detected' ? 60000 : 4000; await new Promise(r => setTimeout(r, wait)); } return null; // never paid }
Collecting buyer details (headless)
The hosted checkout page shows a name/email form to the buyer after payment for PDF invoice generation. In a headless checkout you can call this endpoint directly:
POST/api/v1/checkout/:payment_id/buyer-infono auth
| Field | Type | Description | |
|---|---|---|---|
buyer_name | string | optional | Buyer's full name (cut to 200 chars) |
buyer_email | string | optional | Buyer's email address for invoice delivery (cut to 320 chars; an invalid address is 400) |
buyer_vat | string | optional | Buyer's VAT registration number for B2B invoices (max 100 chars) |
buyer_address | string | optional | Buyer's street address — required for a valid VAT invoice (max 200 chars) |
buyer_city_zip | string | optional | Buyer's postcode and city (max 100 chars) |
buyer_country | string | optional | Buyer's country (max 100 chars) |
At least one of buyer_name or buyer_email is required. Every field is kept on every plan. GET /checkout/:payment_id says whether to show the form in buyer_fields: "full", or null when the store does not collect buyer details. Can be called before or after payment. If called within 30 minutes after payment confirmation, the next version of the invoice is issued under the same number and invoice.reissued fires. After 30 minutes, returns 409. The length limits above cut longer text rather than refuse it. At most 5 submissions per payment in 24 hours; more is 429.
Payment links
Payment links are reusable URLs (pay.aqua.net/pay/lnk_…) that can be shared as-is or embedded as a button. Customers visit the link, enter an amount if needed, and pay — no backend call required at checkout time.
POST /api/v1/payment-links accepts a Bearer ak_live_… secret key in addition to a dashboard session. Create product or booking links programmatically, then embed the returned URL as a plain HTML button — zero backend required after setup. See Links on a static site.Create and manage links in Dashboard → Payment links. With a secret key you can create links (POST /api/v1/payment-links); listing, editing and archiving are dashboard-only. Two types:
- Fixed amount — price is set when creating the link. Customer sees the amount immediately.
- Open amount — customer types any amount before paying. Great for donations or tips.
Plan limits
One unified cap covers everything you have live: each active payment link counts as one active item. The cap is your account's, counted across every store you own. Creating (or re-enabling an archived) item beyond the cap returns 403 plan_limit_reached, with scope, limit, current and tier:
| Today, during the private launch | |
|---|---|
| Active items (payment links), across all stores you own | 500 active items per account |
The planned paid-plan caps are in Plans, trial & grace.
Customer invoices don't count toward the limit — an invoice is a receivable sent to one payer, and it closes itself when paid. Archived items never count. Over the cap, creating or re-enabling is refused; after a move to a plan with a lower cap, the items the owner did not keep take no new payments (see Moving to a plan with lower limits). Current usage is shown in the dashboard.
Public endpoints
These endpoints are called by the hosted checkout page (pay.aqua.net/pay/lnk_…) and the embed widget, and do not require authentication.
GET/api/v1/checkout/link/:link_id
Returns the link's public metadata. An archived link, or one from a suspended store, is 404; a paid invoice link is 410 already_paid.
{
"id": "lnk_abc",
"title": "Coffee tip",
"description": null,
"amount_fiat": null, // the price; null for open-amount links
"currency": "EUR",
"min_amount_fiat": 2, // open amount: bounds in the link's currency, or null
"max_amount_fiat": null,
"min_payable_fiat": 0.5, // the 1,000-sat minimum in this currency right now
"status": "active",
"kind": "link", // link | invoice
"stock_limit": null,
"use_count": 0,
"sold_out": false,
"due_date": null, // invoices
"settled_count": 0,
"settled_fiat": 0,
"checkout_options": { "theme": true, "return_page": true } // plan features
}
POST/api/v1/checkout/link/:link_id/pay
Creates a payment session from the link. For open-amount links, send the amount in the body; a fixed-amount link ignores any amount or currency sent. The body may also carry the buyer's details for the invoice — buyer_name, buyer_email, buyer_vat, buyer_address, buyer_city_zip, buyer_country.
{ "amount_fiat": 10.00, "currency": "EUR" }
amount is accepted as an alias for amount_fiat (amount_fiat wins if both are sent). currency must be one of the supported ISO codes (EUR, USD, GBP, CAD, AUD, JPY, CHF, DKK, BRL); unsupported codes return 400. The buyer may pay in any of them: when the currency differs from the link's, the amount is converted at the current rate before it is checked against the link's minimum and maximum, which are in the link's currency.
| Status | Error | When |
|---|---|---|
400 | Amount must be at least … / at most … | Outside the link's minimum or maximum (stated in the link's currency). |
400 | amount_too_small · amount_precision | Below 0.01, or more decimals than the currency has. |
402 | payments_paused | Once paid plans start: the store's new payments are paused. The body carries only error, message and buyer_message ("Payments are currently deactivated. Please contact the store."). |
404 | Payment link not found or inactive | Unknown or archived link, or a suspended store. |
410 | already_paid · sold_out: This item is sold out. | A paid invoice link, or no stock left. |
429 | too_many_open_payments · link_busy | Too many payments open for the store, this device or this link — see Rate limits. |
503 | (message) | The exchange rate or Indra could not be reached; retry. |
201{ "payment_id": "pmt_xyz", "checkout_url": "https://pay.aqua.net/pay/pmt_xyz" }
Embed a button
Copy the embed code from the dashboard or paste this snippet — replace lnk_… with your link ID:
<a href="https://pay.aqua.net/pay/lnk_abc" style="display:inline-block;background:#E65C00;color:#fff; padding:10px 20px;border-radius:8px;text-decoration:none; font-family:sans-serif;font-weight:600;"> Coffee tip <!-- the dashboard uses the link's title --> </a>
Links on a static site
With a secret key, create a reusable payment link for each product or service. Embed the URL as a plain HTML button — no per-session server call needed.
curl -s -X POST https://pay.aqua.net/api/v1/payment-links \
-H "Authorization: Bearer ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"title": "1hr Consultation",
"amount_fiat": 150.00,
"currency": "USD",
"redirect_url": "https://yoursite.com/booked"
}'
{
"id": "lnk_abc123",
"url": "https://pay.aqua.net/pay/lnk_abc123",
"amount_fiat": 150.00,
"currency": "USD",
"status": "active"
}
<a href="https://pay.aqua.net/pay/lnk_abc123" style="display:inline-block;background:#00C7F9;color:#022173; padding:10px 20px;border-radius:8px;text-decoration:none; font-family:sans-serif;font-weight:600;"> Book Consultation — Pay in Bitcoin </a>
The link is reusable — any number of customers can open it. AQUA Pay hosts the checkout, collects payment, and on success shows a 10-second return page (with Continue now) before opening your redirect_url — a Business and Enterprise feature once paid plans start.
JS SDK
A lightweight browser script that creates a payment session and redirects the customer — no backend needed. Uses your publishable key (ak_pub_…).
Include the SDK
<script src="https://pay.aqua.net/js/aqua-pay.js"></script>
AQUAPay.pay(options)
| Option | Type | Description | |
|---|---|---|---|
publishableKey | string | required | Your ak_pub_… key |
amount | number | required | Amount to charge (e.g. 9.99) |
currency | string | required | ISO 4217 code — "EUR", "USD", "GBP", "CAD", "AUD", "JPY", "CHF", "DKK", "BRL" |
redirectUrl | string | optional | Return URL after payment, https:// only (a Business and Enterprise feature once paid plans start; ignored, never refused, on a plan without it). The checkout shows a return page for 10 seconds, with Continue now, before opening it. |
metadata | object | optional | Key/value pairs (max 2 KB) |
onError | function | optional | Called with an Error if session creation fails. Default: console.error. |
Example
<script src="https://pay.aqua.net/js/aqua-pay.js"></script> <button onclick="payNow()">Pay €9.99 with Bitcoin</button> <script> function payNow() { AQUAPay.pay({ publishableKey: 'ak_pub_YOUR_KEY', amount: 9.99, currency: 'EUR', redirectUrl: 'https://yoursite.com/thank-you', onError: err => alert(err.message), }); } </script>
aqua-pay.js is for the browser only. A server creates payments with the REST API and a secret key.
Embed widget
The embed widget opens a payment link's checkout in a modal on your own page. It needs no key. The embed builder writes the code for you.
Checkout widget
<script src="https://pay.aqua.net/js/checkout.js"></script> <button data-aqua-pay-link="lnk_abc">Buy now</button>
checkout.js is always the latest release. To control updates, load a channel instead: checkout@2.js (non-breaking updates), checkout@2.4.js (patch updates only) or checkout@2.4.0.js (that exact build, never changed). Load either checkout.js or the JS SDK on a page, not both: each defines window.AQUAPay.
| Attribute | Description |
|---|---|
data-aqua-pay-link | The payment link id (lnk_…). Any element with it opens the checkout on click. |
data-aqua-pay-amount, data-aqua-pay-currency | Pre-fill the amount and currency of an open-amount link. |
data-aqua-pay-redirect | An https:// return page after payment (a Business and Enterprise feature once paid plans start; ignored without it). |
data-aqua-pay-name, data-aqua-pay-email, data-aqua-pay-vat | Pre-fill the buyer's details for the invoice. |
data-aqua-pay-theme | dark (default), light or auto (the buyer's system setting) — on a button, or on the <script> tag for every button. AQUAPay.config({ theme }) sets custom colours. Included during the private launch; once paid plans start, a checkout theme is planned for Business and Enterprise, and without it the widget uses its default dark theme. |
From script: AQUAPay.open(linkId, options) — options amount, currency, redirectUrl, theme, buyerName, buyerEmail, buyerVat — AQUAPay.close(), AQUAPay.on(event, fn) and AQUAPay.off(event, fn) for payment.initiated, payment.confirmed, payment.expired, payment.soldout, modal.opened and modal.closed, and AQUAPay.version. Every event is also posted to the page as window.postMessage({ source: 'aqua-pay-checkout', event, detail }). These browser events are for your page's UI; confirm orders with webhooks.
Buttons are found once, when the page loads. A button added later does nothing on its own: call AQUAPay.open(linkId) from its click handler. A custom theme for AQUAPay.config({ theme }) or the theme option is 'dark', 'light', 'auto' or an object of colours: accent, accentHover, accentText, modalBg, overlayBg, headerBg, text, muted, border, inputBg, inputBorder, inputFocus, tabBorder and radius.
After a payment with a return page, the widget shows "Returning to the store" for 10 seconds, with a Continue now button, then opens the URL with payment_id=…&status=paid appended. Closing the widget during the countdown cancels the return.
Webhooks
AQUA Pay sends a signed POST request to your endpoint for every payment, credit-note, invoice-correction and refund event. Set the endpoint in Dashboard → Developer → Webhooks, or with POST /api/v1/webhooks. The first URL you save comes with a signing secret, shown once: every delivery is signed with it, and none is ever sent unsigned.
An event is recorded in the same database transaction as the change it reports, so a payment can never change without its event, and a restart never loses one. Deliveries are retried for about 3 days. An event that happens while no URL is set is recorded but never delivered, not even after you add a URL; read it from the events list.
Events
| Event | When |
|---|---|
payment.confirmed | Payment settled. Exact timing varies by rail: Lightning — the buyer's invoice is paid and Indra's L-BTC lockup is seen (seconds); Liquid — transaction confirmed in one Liquid block (~60 s). This includes a buyer paying from the AQUA wallet, which sends L-BTC straight to the payment's Liquid address even when they scan the Lightning invoice; Bitcoin on-chain — the transaction has the confirmations your store chose (1, 2, 3 or 6; about 10 minutes each); see Bitcoin on-chain. Final: a paid payment never changes status again. |
payment.expired | Session expired without payment: the Lightning invoice expired or failed and, if the buyer opened the Bitcoin tab, its 60-minute window ended with nothing seen. Not always final: if the exact amount arrives late — at the payment's Liquid address within 24 hours of its creation (typically a buyer paying from AQUA near the end of the window), or at its Bitcoin address within 7 days of the window's end — the payment reopens and payment.confirmed follows. Money arriving later is not matched automatically; it is in your wallet regardless. |
payment.reopened | An expired payment is open again: the exact amount arrived late — L-BTC (payment.confirmed normally follows within seconds) or Bitcoin on-chain (payment.confirmed follows once it has your store's confirmations). previous_status is expired. |
credit_note.issued | A credit note was issued for the payment — from a refund or by you. Carries credit_note: number, amount (a decimal string, e.g. "12.50"), currency, source (refund or manual). |
invoice.reissued | A corrected version of the payment's invoice was issued (same number, new version) — the buyer updated their details in the 30-minute window after payment. Nothing is sent when the invoice was not issued yet: the correction simply goes into it. A replacement invoice is a new number, not a new version, and sends no event. |
refund.awaiting_funding | The buyer claimed a refund: on Lightning the swap waits for your L-BTC, on Liquid the buyer's address waits for your transaction. Only send it if your own system started this refund. |
refund.completed | The refund is final: on Lightning the buyer was paid and Indra claimed your L-BTC, on Liquid your transaction has its first confirmation. A credit_note.issued follows when the payment has an invoice to credit. |
refund.failed | The refund failed: on Lightning the buyer's invoice could not be paid or the swap expired (L-BTC you sent is returned, and refund.returned follows once the return confirms; a return finished by hand sends none); on Liquid nothing was sent by a day after the deadline. |
refund.cancelled | The refund was cancelled before anything was sent. |
refund.returned | A failed refund's L-BTC is back in your wallet. Carries returned_sats and return_txid in refund. |
payment.resync | Rare. Some of this payment's events could not be recorded during an incident. Carries missed_sequences and the payment's current status; read the payment with GET /api/v1/payments/:id and update your order from it. |
payment.test | Test event sent from the dashboard or POST /api/v1/webhooks/test. Includes "test": true and only event, event_id, payment_id, link_id, amount_fiat, currency, amount_sats and metadata — it is not stored and has no sequence. |
Payload
{
"event": "payment.confirmed",
"event_id": "evt_3f9c0b7e…", // the same on every retry — deduplicate on it
"sequence": 2, // this payment's events, numbered 1, 2, 3…
"occurred_at": "2026-05-15T14:09:41.000Z",
"previous_status": "pending",
"payment_id": "pmt_abc123",
"link_id": null, // "lnk_…" if payment originated from a link
"invoice_number": "INV-2026-00042",
"amount_fiat": 49.99,
"currency": "EUR",
"amount_sats": 62341,
"amount_usdt": null, // "54.10" when the payment offered USDT
"metadata": { "order_id": "1234" },
"reference": "ORD-1234",
"created_with": "secret", // secret | publishable | link
"settled_at": "2026-05-15T14:09:41.000Z", // when it was paid — the same on every delivery
"settled_asset": "btc" // btc | usdt — what it was paid in
}
Every stored event carries the fields above (payment.test is the exception, see Events; payment.resync has sequence: null). previous_status is the payment's previous status on payment.* events and null on the others. Every payment.* event carries amount_usdt (the USDT the payment offered, or null). payment.confirmed adds settled_at and settled_asset (usdt for USDT on Liquid, btc otherwise), payment.expired adds expired_at, invoice.reissued adds reissued_at (when the corrected version was issued), credit_note.issued adds credit_note, and every refund.* event adds refund: refund_id, status, previous_status, amount, amount_unit (sat or usdt), asset (btc or usdt), method (lightning, liquid or null), refund_sats (null for USDT), credited_fiat, currency, on Liquid once sent txid and verified_by, initiated_via (dashboard or api), created_at and completed_at. A refund event never carries the claim link, the buyer's invoice, Lightning or Liquid address. Ignore an event type you do not know: new ones may be added. The body of an event is fixed when it is first sent: every retry carries exactly the same bytes. invoice_number on payment.confirmed is normally set; if the invoice cannot be numbered within about 6 minutes, the event goes out with null rather than hold up your order, and the invoice follows on its own.
Request headers
| Header | Description |
|---|---|
X-AQUA-Pay-Signature | t=<unix seconds>,v1=<hex>: an HMAC-SHA256, keyed with your signing secret, of the timestamp, a dot and the raw body (t + "." + body). During a secret rotation it carries two v1 values, one per secret. |
X-AQUA-Pay-Event | The event type, as in the body. |
X-AQUA-Pay-Event-ID | The event's id, as in the body: the same on every retry and redelivery. |
X-AQUA-Pay-Delivery-ID | Unique per delivery attempt — for your logs, not for deduplication. It is not the whd_… id of the deliveries list. |
X-AQUA-Pay-Attempt | The attempt number, from 1. |
Content-Type | application/json |
User-Agent | AQUA Pay/1.0 (+https://pay.aqua.net) |
Retries
Your endpoint must answer with a 2xx status within 10 seconds. Anything else is retried, up to 9 attempts in all: after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours, 24 hours and 24 hours (each ±10 %), about 3 days in all. On a 429 or 503 with a Retry-After header, the next attempt waits as asked, up to one hour past its scheduled time, and never comes earlier than scheduled. After the last attempt the delivery is marked failed and shown in your dashboard; your endpoint is never switched off. A redirect (3xx) is never followed and counts as a failure. At most 2 deliveries per store are sent at once. Changing the URL sends the remaining retries to the new one; removing it cancels them, each one at its next attempt (until then it is still listed as pending, and it goes to a new URL if you set one first).
Signature verification
Verify every request before acting on it: check the signature over the raw body, reject a timestamp more than 5 minutes old, and process each event_id only once.
const crypto = require('crypto'); function verify(header, rawBody, secret) { const parts = String(header || '').split(','); const t = Number((parts.find(p => p.startsWith('t=')) || '').slice(2)); if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false; // older than 5 minutes: a replay const expected = Buffer.from(crypto.createHmac('sha256', secret) .update(t + '.').update(rawBody).digest('hex')); return parts.filter(p => p.startsWith('v1=')).some(p => { const got = Buffer.from(p.slice(3)); return got.length === expected.length && crypto.timingSafeEqual(got, expected); }); } app.post('/webhooks/aqua-pay', express.raw({ type: 'application/json' }), (req, res) => { if (!verify(req.headers['x-aqua-pay-signature'], req.body, process.env.AQUA_PAY_WEBHOOK_SECRET)) { return res.sendStatus(401); } const event = JSON.parse(req.body.toString()); if (alreadyProcessed(event.event_id)) return res.sendStatus(200); if (event.event === 'payment.confirmed') { // mark order paid in your database } markProcessed(event.event_id); res.sendStatus(200); });
express.raw() (not express.json()) for the webhook route — the signature covers the raw bytes, not the parsed object.The signing secret
- It is created with your first webhook URL and shown once. Saving a URL on a different host creates a new one, and the old one stops at once: a new receiver never holds a secret the old one knew. A new path on the same host keeps it.
- Rotate replaces it. For 24 hours every delivery is signed with both the new and the old secret (two
v1values), so you can switch your server over without missing a delivery. - AQUA Pay never sends an unsigned webhook. A store whose URL has no secret (one set before secrets were required) gets no deliveries: each one counts as a failed attempt and follows the retry schedule, so it is sent if you create a secret with Rotate within about 3 days, and is marked failed after that (redeliver it then).
Event order
Events can arrive out of order — a retry of an earlier event can land after a later one, and a failing delivery never holds up the next event. Use sequence: each payment's events are numbered 1, 2, 3… in the order they happened.
payment.confirmedis final. Once you have processed it, ignore anypayment.expiredfor that payment.- Ignore an event whose
sequenceis lower than one you already processed for the same payment. payment.confirmedcan followpayment.expired, with or without apayment.reopenedbetween them: treat it as a paid order.- Refund events share the payment's
sequence. A payment can have several refunds (in parts, or a new one after a failed or cancelled one): tell them apart byrefund.refund_id. - When in doubt, read the payment with
GET /api/v1/payments/:id.
Handling duplicates
Delivery is at least once: the same event can arrive more than once (a retry after a timeout your server did not see, or a redelivery). Deduplicate on event_id, never on payment_id — a payment has several events. For invoice.reissued, a buyer may correct their details more than once: each correction is its own event, with a higher sequence; keep the latest.
Deliveries and redelivery
Every delivery is listed in Developer → Webhooks → Recent deliveries, and by GET /api/v1/webhooks/deliveries?state=pending|sent|failed|cancelled (newest first; limit 1–500, default 100; an unknown state is 400). Each row: id (whd_…), state, attempts, http_status, last_error, created_at, completed_at, next_retry, redelivery_of, event_id, event, payment_id, sequence and occurred_at. When a delivery fails for good your dashboard's Home says so, and the store's owner is emailed — at most once a day.
POST /api/v1/webhooks/deliveries/:id/redeliversends the same event again as a new delivery: sameevent_id, same body. Answers201 {"delivery_id"};404 not_found;409 already_pendingwhile one is still pending,409 event_prunedfor an event past its 90 days,409 no_webhook_urlwhen no URL is set.POST /api/v1/webhooks/deliveries/redeliver-faileddoes that for every event whose latest delivery failed, at most 500 a call; the answer says how many werequeued, how many areremainingandmax_per_call.
The events list
GET /api/v1/events?cursor=&limit= lists your store's events, oldest first, in the same shape as the webhook body — whether or not a webhook was delivered for them, including before you set a URL. Use it to catch up after downtime, or instead of webhooks.
- It is a moving stream, not a snapshot: start without a cursor, follow
next_cursorwhilehas_moreis true, store the last cursor, and call again later for newer events. An empty page returns your cursor unchanged. - No event is ever skipped. An event is listed only once every transaction that started before it has finished, so a slow one cannot be overtaken: newer events wait for it (usually milliseconds), then come in order.
- Reusing an older cursor is safe: it lists events again, which you drop by
event_id. 410 cursor_expired: the cursor is older than the 90 days events are kept, or is not this store's;409 cursor_reset: the cursor cannot be resumed. In both cases, resync your orders fromGET /api/v1/payments/listand start again without a cursor.
These routes, like the webhook settings, are for the store's owner in the dashboard, or a secret key — a Business secret key once paid plans start.
Managing the endpoint
| Method | Path | Purpose |
|---|---|---|
GET | /api/v1/webhooks | {url, has_secret, previous_secret_until} |
POST | /api/v1/webhooks | Set the URL ({"url": "https://…"}, public HTTPS only). Answers {ok, url}, plus secret and secret_reason (new or new_host) when a new signing secret was created — shown once. |
DELETE | /api/v1/webhooks | Remove the URL and its secrets; pending deliveries are cancelled at their next attempt. |
POST | /api/v1/webhooks/rotate-secret | A new secret, returned once, with previous_secret_until (the old one keeps signing for 24 hours). |
POST | /api/v1/webhooks/test | Send a signed payment.test now; answers {ok, http_status}, or {ok: false, error} when the endpoint could not be reached. 400 when no URL is set, it has no secret, or it no longer resolves to a public address. |
GET | /api/v1/events | The events list above. limit 1–200 (default 100); a malformed cursor is 400 invalid_cursor. |
Testing webhooks
Click Send test event in the dashboard Webhooks panel to fire a signed payment.test event to your endpoint. The response status is shown immediately.
For local development, use a tunneling tool like ngrok or cloudflared to expose your local server.
Invoices & receipts
AQUA Pay auto-generates a PDF invoice for every settled payment. No configuration needed — it happens automatically on every payment.confirmed event. The invoice includes seller details, buyer details (if provided), a line item, and the payment method used.
Who receives it automatically
- Merchant — emailed to your store's notification email (your account email by default) on every settlement. Opt out in Dashboard → Settings → Invoice settings (the store owner); turning on the invoice digest also replaces these per-payment copies.
- Buyer — emailed to the address they submit on the checkout page, within the 30-minute grace window. Nothing is sent if the buyer doesn't provide an email.
Invoice number format
Invoices are numbered sequentially per merchant: INV-YYYY-NNNNN (e.g. INV-2026-00042), where the year is the UTC year in which the invoice was issued. The number does not change on resend or on a corrected version (reissue). The one exception is a replacement invoice (Business and Enterprise): it is a new invoice with a new number, and from then on the payment's invoice_number — in GET /invoices, the payment list and the download — is the replacement's. No webhook announces it.
An issued invoice does not change
When a payment settles, its invoice is issued once and stored: what it says, its PDF, and a hash of its content. Every download and every resend returns that same file — except an invoice cancelled by a credit note (voided), which is downloaded with a "void" mark over it. A later change to your store's details, logo, footer or VAT setting applies to the next invoice, never to one already issued.
- The invoice shows an issue date and a payment date, both in UTC and labelled as such, and the BTC exchange rate the sats were calculated from, with its source: Ankara (JAN3).
- The footer carries the start of the content hash (
Content hash sha256:…): the SHA-256 of the document's content, which is the same on every copy of that version. A file cannot carry the hash of its own bytes, so the SHA-256 of the PDF file itself is listed beside it byGET /api/v1/payments/:payment_id/documentsand in the accounting export. - A buyer-detail correction creates version 2 under the same invoice number. The new PDF names the version it replaces; every earlier version is kept and stays downloadable with
?version=1. - Invoices issued before stored invoices existed are rebuilt from the records kept at the time, and say so on the PDF.
- Emails are retried for about 15 hours. If one still cannot be delivered, you are emailed and your dashboard's Home lists it (
GET /api/v1/documents/failed-deliveries).
Download a PDF
GET/api/v1/payments/:payment_id/invoice
Returns the invoice PDF for a settled payment as application/pdf. Use this to store invoices in your document management system, serve them from your merchant dashboard, or attach them to your own emails. ?version=N gives an earlier version; ?number= an earlier invoice of the payment (one a replacement superseded).
Request headers
| Header | Description | |
|---|---|---|
Authorization | required | Bearer ak_live_… |
Response
Content-Type: application/pdf · Content-Disposition: attachment; filename="invoice-INV-2026-00042.pdf" (invoice-INV-2026-00042-v2.pdf for version 2)
Returns 404 if the payment is not found, belongs to a different account, or has not yet settled (PDFs are only generated for paid payments); 404 No such invoice version for a version or number that does not exist, and 400 for a version that is not a positive whole number; 409 invoice_not_issued for a paid payment whose invoice is still being numbered — retry in a minute.
Other documents
| Method | Path | Auth | Returns |
|---|---|---|---|
GET | /api/v1/payments/:payment_id/credit-note | secret key or dashboard | The latest credit note PDF, or the one named by ?number=CN-… (credit-note-CN-2026-00001.pdf). 404 when there is none. |
GET | /api/v1/payments/:payment_id/documents | secret key or dashboard | {documents, credit_state, current_invoice}: every invoice version, credit note and replacement — kind, number, version, issued_at, content_hash, file_sha256, reconstructed, total, currency and what it supersedes, credits or replaces — and the invoice in force (number, version, description, buyer). |
GET | /api/v1/invoice/:payment_id | none | The buyer's copy of a paid payment's invoice (receipt-INV-….pdf), linked from the receipt email and the checkout page. 404 until the payment is paid, 409 invoice_not_issued while it is being numbered. |
curl -H "Authorization: Bearer $AQUA_PAY_SECRET_KEY" \
https://pay.aqua.net/api/v1/payments/pmt_abc123/invoice \
--output invoice.pdf
const { Readable } = require('stream'); app.get('/orders/:id/invoice', async (req, res) => { const upstream = await fetch( `https://pay.aqua.net/api/v1/payments/${req.params.id}/invoice`, { headers: { 'Authorization': `Bearer ${process.env.AQUA_PAY_SECRET_KEY}` } } ); if (!upstream.ok) return res.sendStatus(upstream.status); res.setHeader('Content-Type', 'application/pdf'); res.setHeader('Content-Disposition', upstream.headers.get('Content-Disposition') ?? 'attachment; filename="invoice.pdf"'); Readable.fromWeb(upstream.body).pipe(res); });
Credit notes
An invoice is cancelled, in full or in part, by a credit note that references it — never by changing its status. An in-app refund issues one automatically when it completes. You issue one yourself from Payments → ··· → Issue credit note, or with:
POST/api/v1/invoice/:payment_id/credit-notes (dashboard session, manager or owner)
Answers 201 {"credit_note_number", "amount", "currency", "full", "credit_state"} (amount is a decimal string).
| Field | Description | |
|---|---|---|
reason | required | Printed on the credit note (max 200 chars). |
refunded_outside | optional | true when the money went back outside AQUA Pay; outside_note adds a note. |
amount | optional | A partial amount. Omit to credit everything not yet credited. Business and Enterprise. |
refund_method, refund_reference | optional | bank, cash or other, and a reference. Either one means the money went back outside AQUA Pay (refunded_outside is implied). Business and Enterprise. |
| Status | Error | When |
|---|---|---|
400 | reason is required · amount_precision · bad refund_method | The request is incomplete or invalid. |
400 | exceeds_uncredited | More than is not yet credited; remaining_minor says how much is left, in minor units. |
403 | credit_note_needs_advanced | Once paid plans start: a partial amount, a method or a reference, or a second credit note, on a plan without them (code: "feature_not_in_plan"). |
404 | not_found | Unknown or unpaid payment. |
409 | invoice_not_issued · refund_in_progress · already_credited | The invoice is still being numbered; an in-app refund is under way (its credit note follows); nothing is left to credit. |
- Every plan: one credit note per invoice, for the whole amount not yet credited. It cancels the invoice:
invoice_statusbecomesvoided, orrefundedwhen refunded outside AQUA Pay. - Business and Enterprise: several partial credit notes, a refund method and reference, a list (
GET /api/v1/credit-notes, filtered bysource,payment_id,from,to) and a replacement invoice for a fully credited one (POST /api/v1/invoice/:payment_id/replacementwith corrected buyer details or description): a new number for the same payment, naming the invoice it replaces; it takes the sixbuyer_*fields anddescription(up to 500 characters) and answers201 {"invoice_number", "replaces"}, or409 not_fully_creditedwhen the invoice is not fully credited yet. Only when nothing was refunded — a credit only, for an invoice issued with the wrong details; a refunded invoice answers409 refunded_cannot_replace. In the dashboard: Payments → ··· → Issue replacement invoice, offered on such an invoice (can_replaceonGET /payments/list), with the form filled from the invoice as issued. - The credited total never exceeds the invoice. While an in-app refund is in progress no credit note can be issued, and an in-app refund's share of the invoice cannot exceed what is not yet credited. Each completed in-app refund issues its own credit note.
credit_state(none,partial,full) is onGET /payments/:idand the payment details; thecredit_note.issuedwebhook fires for every credit note.PATCH /invoice/:id/statusis retired and answers410 use_credit_note. Invoices marked refunded or voided before keep their status, with no credit note.
Accounting export
GET/api/v1/invoices/export (Business and Enterprise)
One row per document version — every invoice version, credit note and replacement — as it was issued, with the rate and its source, the sats ordered and received, the provider and miner fees, the settlement transaction, the content hash and the file's SHA-256. Each figure that is not read off the document states its provenance: observed (recorded when it happened), derived, estimated (the provider's quote) or not_recorded. Filter with issued_from/issued_to and paid_from/paid_to (UTC, end exclusive). format=csv streams every row with no cap; JSON returns {documents, next_cursor}, up to 1,000 rows a page (limit lowers it), with next_cursor to pass as cursor. Every export is recorded. The delivery view (GET /api/v1/documents/deliveries?state=pending|sent|failed; retry from the dashboard, manager or owner, with POST /api/v1/documents/deliveries/:id/retry) is part of the same feature. Included for every store during the private launch.
On Enterprise (once paid plans start), GET /api/v1/documents/events is the audit log: every document issued, corrected, credited, delivered or exported, and by whom, as JSON or format=csv; GET /api/accounts/audit/events gives it across every store the account owns.
Resend a receipt
POST/api/v1/payments/:payment_id/resend-receipt
Re-sends the issued PDF invoice — the same file, never a new one — to the buyer's email on file. Useful when a customer asks for their receipt again or when the original delivery failed. A failed send is retried automatically.
Request headers
| Header | Description | |
|---|---|---|
Authorization | required | Bearer ak_live_… |
Answers {"ok": true, "sent_to": "…"}. Returns 400 Payment not yet confirmed for an unpaid payment, 400 No buyer email on file for this payment when the buyer never submitted their details, 409 invoice_not_issued while the invoice is still being numbered, and 404 only for an unknown payment.
curl -X POST \
-H "Authorization: Bearer $AQUA_PAY_SECRET_KEY" \
https://pay.aqua.net/api/v1/payments/pmt_abc123/resend-receipt
List all invoices
GET/api/v1/invoices
Returns {invoices, total, truncated}: the store's issued invoices, newest payment first. Append ?format=csv to export as CSV — useful for monthly accounting, VAT returns, and reconciliation. Filter with from and to, which apply to the paid date (both inclusive — unlike the accounting export, whose end is exclusive). JSON is capped at 1,000 rows and CSV at 10,000; when the cap is hit, JSON says truncated: true and CSV carries the header X-AQUA-Pay-Truncated: true — narrow the dates, or use the accounting export.
Request headers
| Header | Description | |
|---|---|---|
Authorization | required | Bearer ak_live_… |
curl -H "Authorization: Bearer $AQUA_PAY_SECRET_KEY" \
https://pay.aqua.net/api/v1/invoices
curl -H "Authorization: Bearer $AQUA_PAY_SECRET_KEY" \ "https://pay.aqua.net/api/v1/invoices?format=csv" \ --output invoices.csv
The CSV has these columns, in this order: invoice_number, invoice_status, paid_at, buyer_name, buyer_email, description, amount_fiat, currency, amount_sats, payment_id.
Buyer info & invoice.reissued
After a customer pays on the hosted checkout, a form appears asking for their name and email. This drives PDF personalisation and receipt delivery. The window stays open for 30 minutes after payment.
What happens when a buyer submits
- A new version of the invoice is issued under the same number, with only the buyer's details changed.
- The new PDF is emailed to the buyer at the address they provided.
- A fresh copy is sent to the merchant (unless opted out via digest or email toggle).
- The
invoice.reissuedwebhook fires with the sameinvoice_number, a highersequenceandreissued_at.
A buyer can resubmit updated details within the 30-minute window (counted from when the payment was paid), up to 5 submissions per payment in 24 hours (more is 429) — each submission issues the next version and fires a new invoice.reissued event. The form takes name, email, VAT number, address, postcode and city, and country. After 30 minutes, the endpoint returns 409.
invoice.reissued, your handler should always overwrite stored buyer details — do not skip on duplicate payment_id like you would for payment.confirmed. Use sequence (not the delivery time) to tell which event is the latest — each correction has a higher one, and it is the same on every retry. reissued_at is when the corrected version was issued. A correction never changes the invoice number (only a replacement invoice does); download the corrected PDF with GET /api/v1/payments/:id/invoice.Idempotent invoice.reissued handler
if (event.event === 'invoice.reissued') { // DO NOT skip on duplicate payment_id — compare sequence instead const existing = db.get('SELECT reissue_sequence FROM orders WHERE payment_id = ?', [event.payment_id]); if (!existing || existing.reissue_sequence == null || event.sequence > existing.reissue_sequence) { db.run( 'UPDATE orders SET reissue_sequence = ?, reissued_at = ? WHERE payment_id = ?', [event.sequence, event.reissued_at, event.payment_id] ); // then fetch the corrected PDF: GET /api/v1/payments/:id/invoice } }
Invoice customisation
These invoice features are configured from Dashboard → Settings → Invoice settings (included free during the private launch):
| Feature | What it does |
|---|---|
| Logo | Your logo appears in the PDF header. Upload a PNG or JPEG of at most 200 KB (16 to 4,096 pixels a side; no SVG) under Settings → Store logo; AQUA Pay keeps it and serves it itself. A public https:// URL still works when no file is uploaded: it is fetched when each invoice is issued (5-second timeout), and the invoice is issued without it if it is unavailable. An issued invoice keeps the logo it was issued with. See also Your logo on buyer pages. |
| Footer | Your own text at the foot of every invoice — bank details, terms, a thank-you — plain text up to 500 characters, on every plan. |
| VAT | Adds a VAT line to every PDF, on every plan. Choose inclusive (VAT is extracted from the total and shown as a separate line) or reverse-charge (a reverse-charge notice is appended — no amount extracted). Set the rate as a decimal (e.g. 0.20 for 20%). |
| Invoice digest | Instead of one merchant email per payment, receive a daily or weekly (Monday) digest, sent at 08:00 UTC, listing the invoiced sales of the last 24 hours (daily) or 7 days (weekly). Useful for high-volume accounts. |
Your logo on buyer pages
On Starter and Business, the pages and messages your buyers see carry the AQUA Pay logo and "Powered by AQUA Pay". On Enterprise (once paid plans start — not during the private launch), once you upload a logo under Settings → Store logo, your logo replaces AQUA Pay's, and small Terms · Privacy links take the place of the AQUA Pay attribution, on:
- the hosted pay page and POS terminals,
- the buyer's refund claim page,
- the emails your buyers receive (receipts, credit notes and refund messages), which still name AQUA Pay as the sender on your behalf,
- printed QR stickers,
- and the embed widget's footer (from widget 2.8.0).
The logo is shown on a white tile, so a dark logo stays readable in dark mode. Without an uploaded logo, every page keeps AQUA Pay's branding. The choice is made each time a page loads: if the plan ends (after any grace period) or the logo is removed, AQUA Pay's branding returns on the next load, and payments in progress are not affected. The checkout responses carry a branding object (logo_url, logo_width, logo_height, attribution, store_name); attribution: true means AQUA Pay's branding is shown. Your logo must be one you have the right to use (Terms, Section 11).
Refunds
A refund returns what the buyer paid, in the asset they paid in: sats for a Bitcoin payment (Lightning, L-BTC or Bitcoin on-chain), USDT for a USDT payment — never an amount converted at an exchange rate. AQUA Pay never holds your funds, so you send every refund yourself, from AQUA. The buyer chooses where to receive it: Lightning, or a Liquid address.
- You start the refund — in the dashboard (Payments → ··· → Refund) or with a secret key — for everything not yet refunded, or a part of it. The buyer gets a claim link by email, valid 48 hours; when the payment has no buyer email, you pass the link on yourself.
- The buyer opens the link and chooses (
refund.awaiting_funding):- Lightning (sats only, within Indra's refund limits): the buyer enters a Lightning invoice or address, an Indra swap is created, and you are emailed the L-BTC amount and the address to send it to. Indra pays the buyer and claims your L-BTC.
- Liquid (sats as L-BTC, or USDT; the only route for USDT and for refunds above Indra's limit): the buyer enters a Liquid address, and you are emailed the amount and address. Send it from AQUA within 7 days, in one transaction to that address only. AQUA Pay finds it on the Liquid chain, reading what your wallet sent from your own coins and change.
- The refund completes (
refund.completed) — on Lightning when Indra claims your L-BTC, on Liquid at the transaction's first confirmation — and a credit note is issued for it.
Network and swap fees are yours, on top of the amount. You can refund a payment in several parts, one at a time, until everything paid is refunded. If a Lightning refund cannot be paid or its swap expires, it fails (refund.failed) and any L-BTC you sent is returned to your wallet (refund.returned) — usually at once; at worst after the swap's timeout, about 5 weeks. A Liquid refund with nothing sent fails one day after its deadline. A refund that reached the buyer counts as refunded even if it failed afterwards, so nothing is refunded twice. Telling your customers your refund policy is yours to do: nothing at checkout or on invoices states it.
Endpoints
| Method | Path | Purpose |
|---|---|---|
POST | /api/v1/invoice/:payment_id/refund | Start a refund |
GET | /api/v1/invoice/:payment_id/refund | The payment's latest refund, with earlier ones in history |
DELETE | /api/v1/invoice/:payment_id/refund | Cancel a refund the buyer has not claimed yet, or a Liquid refund you have not sent (409 otherwise) |
POST | /api/v1/invoice/:payment_id/refund/transaction | Report the transaction that sent a Liquid refund ({"txid"}), when the dashboard does not show it as sent |
They take a dashboard session or a secret key (ak_live_…, Business and Enterprise once paid plans start); a publishable key is refused. In the dashboard, starting, cancelling and reporting need the manager or owner role and reading needs a bookkeeper; the owner is emailed when a manager starts one.
Start a refund
| Field | Description | |
|---|---|---|
amount | optional | In the asset paid: a whole number of sats (at least 1,000), or for a USDT payment a USDT amount with at most two decimals ("12.50"). Default: everything not yet refunded. Never more than that. |
include_tip | optional | A POS sale with a tip: refunds are bounded by the bill's share unless true. |
reason | optional | Up to 200 characters, for your records and the credit note. |
Idempotency-Key header | optional | Secret-key starts only (ignored for a dashboard session). 1 to 255 characters, else 400 invalid_idempotency_key. Kept with the refund for its lifetime: the same key and request answer 200 with that refund, even after it moved on; the same key with a different request is 422 idempotency_key_reused_with_different_payload. |
{
"refund_id": "ref_…",
"payment_id": "pmt_abc123",
"status": "awaiting_buyer",
"amount": 20000, // "12.50" for USDT
"amount_unit": "sat", // or "usdt"
"asset": "btc", // or "usdt"
"method": null, // "lightning" or "liquid" once the buyer chooses
"refund_sats": 20000, // null for USDT
"credited_fiat": 20, // what its credit note will credit
"currency": "EUR",
"refund_reason": "Order cancelled",
"initiated_via": "api",
"has_buyer_email": true,
"claim_link": "https://pay.aqua.net/refund/…", // the buyer's credential — returned here only
"expires_at": "2026-11-01T12:00:00.000Z",
"created_at": "2026-10-30T12:00:00.000Z"
}
A refund started from the dashboard answers 200 with refund_id, claim_link, claim_token, the amount fields above, has_buyer_email and expires_at. The claim link is returned only by the call that started the refund (and by its Idempotency-Key replay while the buyer can still use it), never by a secret key's GET. credited_fiat is the refund's share of what was paid, applied to the invoice total; the refund that takes what is left credits the rest exactly.
| Status | Error | When |
|---|---|---|
400 | Only confirmed payments can be refunded | The payment is not paid. |
400 | Cannot refund a voided invoice | The invoice was cancelled by a credit note; any refund then happens outside AQUA Pay. |
400 | fiat_refunds_retired | The request has mode: "fiat" or fiat_amount. Refunds are in the asset paid: send amount. |
400 | invalid_amount | amount is not a whole number of sats, or a USDT amount with at most two decimals. |
400 | exceeds_refundable · exceeds_bill · exceeds_uncredited | More than was paid and not yet refunded; more than the bill's share of a tipped sale; or more than the credit notes leave (refundable says how much may still be refunded). |
400 | below_minimum | A Bitcoin refund under 1,000 sats. |
400 | invalid_idempotency_key | The key is not 1–255 characters. |
404 | Payment not found · No refund found for this payment | Unknown payment; or, on GET and DELETE, no refund yet. |
409 | refund_in_progress | Another refund of the payment is in progress. |
409 | already_refunded · already_credited | Everything paid is refunded, or the invoice is credited in full. |
409 | Refund cannot be cancelled at this stage | DELETE after the buyer claimed it on Lightning, or after a Liquid transaction was seen. |
429 | refund_rate_limited | Too many secret-key starts — see below. |
Reporting a Liquid transaction. AQUA Pay completes a Liquid refund on its own when your wallet's send can be read from your coins and change. If it cannot (coins from elsewhere, several payments in one send), POST …/refund/transaction with its txid: it must exist, pay the buyer's address and not be older than the claim (400 invalid_txid, tx_not_found, tx_not_to_buyer, tx_before_claim; 409 tx_already_used, refund_not_waiting, tx_already_found; 503 if the explorer cannot be reached). The refund completes at its first confirmation and its credit note says the transaction was reported by you.
Refund statuses
| Status | Meaning |
|---|---|
awaiting_buyer | The claim link is live; the buyer has not chosen yet. Can be cancelled. |
awaiting_payment | The buyer chose. Lightning: the swap waits for your L-BTC. Liquid: waiting for your transaction to the buyer's address (cancellable until one is seen). |
mempool | Your transaction was seen. |
paid | Lightning: the buyer has the sats — not yet final. |
complete | Final; the credit note is issued. |
failed | Lightning: the buyer could not be paid or the swap expired; L-BTC you sent is returned (return_state). Liquid: nothing was sent by one day after the deadline. |
cancelled | Cancelled before anything was sent. |
GET /api/v1/invoice/:payment_id/refund returns the latest refund: refund_id, status, the amount fields (amount, amount_unit, asset, method, refund_sats, credited_fiat, currency), refund_reason, initiated_via, created_at; on Lightning lockup_address and lockup_amount_sat (where and how much to send), timeout_block_height and timeout_blocks_left (the funding deadline; null when unknown), sub_swap_id, return_state, return_txid and returned_sats; on Liquid buyer_liquid_address, deadline_at, txid and verified_by (chain, or merchant when you reported it); claim_token_expires_at, refund_completed_at; for the payment refunded_amount and refundable_amount (in the asset paid), refundable_amount_bill (a tipped POS sale: what is left without include_tip; null otherwise) and can_retry (a new refund may be started); and the earlier refunds in history. A dashboard session also gets claim_token; a secret key never does.
return_state is null until a failed Lightning refund needs a return, then pending → broadcast → confirmed; failed while the return is being retried; not_needed when nothing was ever sent; resolved when it was finished by hand. Refunds started before 2026-10-19 are returned by hand.
429 refund_rate_limited, with Retry-After). Refunds started in the dashboard are not limited. If you did not start a refund, send nothing — it expires on its own — and rotate the key in Developer.Connect a wallet by API
POST/api/v1/connect/descriptor
Connects an HD wallet by supplying its descriptors directly: the SLIP-0077 Liquid descriptor and, for Bitcoin on-chain, the same wallet's Bitcoin account. This bypasses the AQUA QR scan flow and is meant for a store whose server controls its own wallet. Auth: Bearer ak_live_… — a missing or publishable key is 401 Secret API key required, a revoked one 401 Invalid or revoked API key. Included during the private launch; once paid plans start it is planned for Business and Enterprise (403 feature_not_in_plan, feature agentOnboarding). The dashboard's QR connect stays on every plan.
btc_descriptor, since the QR scan includes the Bitcoin account. Without it the store connects with no Bitcoin, and Bitcoin on-chain is refused with bitcoin_not_available, reason: no_bitcoin_account.Request body
| Field | Type | Description | |
|---|---|---|---|
lbtc_descriptor | string | required | SLIP-0077 Liquid confidential descriptor. Must start with ct(slip77( (as must btcln_descriptor). Max 500 chars. |
btcln_descriptor | string | required | Stored for the AQUA payload; not used for address derivation. Pass the same descriptor as lbtc_descriptor. |
btc_descriptor | string | optional | The same wallet's Bitcoin account, for Bitcoin on-chain: wpkh([fingerprint/84'/0'/0']xpub.../0/*), with the same master fingerprint as lbtc_descriptor. 400 invalid_btc_descriptor otherwise, with reason (invalid or fingerprint_mismatch) and detail; 409 wallet_in_use if another store holds it. Max 500 chars. |
Descriptor format
ct(slip77(master_blinding_key_hex),elsh(wpkh([fingerprint/49'/1776'/0']xpub.../0/*)))
This is the format exported by the AQUA wallet (JAN3) and compatible wallets using BIP49 paths on the Liquid Network. The path 49'/1776'/0' is Liquid mainnet.
Response 200
{ "connected": true }
409. To replace it, the store's owner reconnects in Dashboard → Settings → Payout wallet, with a code emailed to the account. One wallet serves one store: a wallet another store holds is refused with 409 wallet_in_use (create a new wallet in AQUA for each store), and a descriptor that cannot be read with 400 invalid_descriptor.Full cURL example
curl -s -X POST https://pay.aqua.net/api/v1/connect/descriptor \
-H "Authorization: Bearer ak_live_..." \
-H "Content-Type: application/json" \
-d '{
"lbtc_descriptor": "ct(slip77(aabbcc...),elsh(wpkh([fp/49'"'"'/1776'"'"'/0'"'"']xpub.../0/*)))",
"btcln_descriptor": "ct(slip77(aabbcc...),elsh(wpkh([fp/49'"'"'/1776'"'"'/0'"'"']xpub.../0/*)))",
"btc_descriptor": "wpkh([fp/84'"'"'/0'"'"'/0'"'"']xpub.../0/*)"
}'
Plans, trial & grace
AQUA Pay is free during the private launch: every account runs on Business, within the limits in Rate limits, and its owner can switch it to Starter at pay.aqua.net/account and back at any time — both are free. Enterprise features (bookkeepers, more managers, your logo on buyer pages, the document audit log) wait for paid plans. Paid plans start after the private launch, on a date we will announce. What follows describes them as planned.
Planned paid plans
One plan covers an account and every store it owns. It is bought and managed at pay.aqua.net/account by the account, never from a store's dashboard. These are planned prices, not prices being charged. No paid plan is on sale during the private launch. Which payment methods are offered, including for Enterprise annual, will be confirmed when paid plans begin.
| Starter | Business | Enterprise | |
|---|---|---|---|
| Monthly | $9 | $20 | $200 |
| Yearly | $97 | $216 | $2,160 |
| Stores | 1 store per account | 3 stores per account | 20 stores per account |
| Active items | 5 active items per account | 50 active items per account | 500 active items per account |
| Payment creation | 30 requests a minute per account | 120 requests a minute per account | 600 requests a minute per account |
| Open payments | 50 open payments per account; 50 open payments per store | 250 open payments per account; 250 open payments per store | 1,000 open payments per account; 250 open payments per store |
| Invoices with VAT lines and buyer details; one full credit note per invoice | ✓ | ✓ | ✓ |
| REST API (secret key), wallet connect by API, logo, invoice digest, return page, checkout theme, accounting export and delivery view, partial credit notes and replacement invoices | — | ✓ | ✓ |
| The document audit log | — | — | ✓ |
| Your logo instead of AQUA Pay's on buyer pages, buyer emails and QR stickers | — | — | ✓ |
| A store team, per store | — | 1 manager | 3 managers and 2 bookkeepers |
Enterprise limits are subject to confirmation before paid plans begin, pending the wallet gap-limit check. Planned Enterprise benefits include priority support and onboarding. On a paid plan, the open-payment caps also cover payments started from a payment link.
Trial
Once paid plans start, a new account that has never held a plan, paid or complimentary, has Starter features and 5 free payments — one trial per email address, counted across every store the account owns. Only settled payments count. When they are used, new payments are paused with 402 payments_paused (reason: "trial_used") until a plan is chosen at pay.aqua.net/account, and the owner is emailed. An account that has held a plan gets no trial. The trial is never reset or extended automatically; AQUA Pay support can lift an ended trial.
Moving to a plan with lower limits
- A lower plan starts when the current paid time ends. Until then, everything keeps working on the current plan.
- If the account has more stores, products and links, or POS terminals per store than the lower plan allows, the owner chooses which stay active at pay.aqua.net/account before buying it. Until a selection that fits is saved, buying that plan answers
409 plan_selection_required. The owner can change the selection at any time. - What is not kept takes no new payments once the lower plan starts:
402 payments_pausedwithreason: "store_deactivated","link_deactivated"or"terminal_deactivated". Buyers are told "Payments are currently deactivated. Please contact the store." Nothing is deleted: links keep their address, records, invoices and refunds stay available, payments already started complete, and the store's dashboard works as before. - An upgrade makes everything active again at once. Customer invoices never count and are never deactivated.
Grace period
- When any plan ends — paid or complimentary — the account keeps it for 4 days, measured to the minute from the moment it ended.
- During the grace period payments go on, but every store the account owns is frozen: no new payment links or POS terminals, no edits to them, and no new checkout settings. These changes answer
402 store_frozen. Archiving a link, revoking a terminal and switching an option off still work. - After the grace period, new payments are paused:
402 payments_paused(reason: "plan_ended"). Buyers are told "Payments are currently deactivated. Please contact the store." The plan never falls back to the trial or a lower tier: the account keeps its last plan's features, its stores stay frozen, and it renews at pay.aqua.net/account. - A payment already created, or already paid, is never affected: settlement, claims and refunds never depend on the plan.
Rate limits
The limits in force today, during the private launch. Limits reset on a rolling window. The planned paid-plan limits are in Plans, trial & grace.
Payment creation — today, during the private launch
| What | Limit today | Answer when reached |
|---|---|---|
POST /payments, per store | 30 requests a minute per store | 429 rate_limit_exceeded, scope: "store" |
POST /payments, per account (every store it owns) | 300 requests a minute per account | 429 rate_limit_exceeded, scope: "account" |
Other /api/v1/payments requests with a secret key — GET /payments/:id, the list, details and documents — per account, counted apart from payment creation | 300 requests a minute per account | 429 rate_limit_exceeded, scope: "account" ("store" for a store with no owner) |
/api/v1/payments requests without a valid secret key — a publishable key, a dashboard session, a missing or invalid key — per client IP address | 30 requests a minute per IP address | 429, error: "Rate limit exceeded" (no scope) |
POST /payments with a publishable key (ak_pub_…), per client IP address | 10 requests a minute per IP address | 429 rate_limit_exceeded |
| Open payments, per store | 50 open payments per store | 429 too_many_open_payments, scope: "store" |
| Open payments, per account | 500 open payments per account | 429 too_many_open_payments, scope: "account" |
| Stores an account owns | 10 stores per account | 409 store_limit_reached |
| Active items (payment links) | 500 active items per account | 403 plan_limit_reached |
ak_live_…) is not held to the per-IP limit: one backend can create payments up to the store and account limits above, for every store the account owns. Polling and the other secret-key requests have their own budget, so they never use up payment creation. Webhooks still spare you most of the polling.Payment links and the hosted checkout
A buyer paying through a payment link (POST /checkout/link/:id/pay) is limited by pending payments, checked before anything is created. During the private launch the account's open-payment caps above do not apply to it; on a paid plan they do, as well as these:
| What | Limit | Answer when reached |
|---|---|---|
| Pending link payments, per store | 500 pending payments per store | 429 too_many_open_payments |
| Pending payments, per link | 200 pending payments per link | 429 link_busy |
| Pending payments, per buyer's IP address | 15 pending payments per IP address | 429 too_many_open_payments ("Too many pending payments from this device") |
Public checkout endpoints (/api/v1/checkout/*), except the status polls below | 120 requests a minute per IP address | 429, error: "Rate limit exceeded" |
Checkout status polls (GET /api/v1/checkout/{id}/status, /lbtc-status, /btc-status, /btc-chain-status) | 600 requests a minute per IP address | 429, error: "Rate limit exceeded" |
L-BTC status checks (GET /checkout/:id/lbtc-status) | 30 checks a minute per payment | 429, status: "poll_too_fast" |
Bitcoin on-chain status checks (GET /checkout/:id/btc-status) | 30 checks a minute per payment | 429, status: "poll_too_fast" |
Retired chain-swap status checks (GET /checkout/:id/btc-chain-status) | 6 checks a minute per payment | 429, stage: "poll_too_fast" |
Other endpoints
| What | Limit |
|---|---|
API key management (/api/v1/keys) | 30 requests a minute per IP address |
Invoice and refund routes (/api/v1/invoice/* — the public invoice download and every refund route) | 120 requests a minute per IP address |
Refunds started with a secret key (POST /api/v1/invoice/:id/refund) | 10 refunds an hour per store and 50 refunds a day per store — 429 refund_rate_limited |
Dashboard test payment (/api/v1/test-payment) | 30 requests a minute per IP address |
Wallet descriptor upload (/api/v1/connect/descriptor) | 30 requests a minute per IP address |
Sign-in code requests at /account | 50 requests per 15 minutes per IP address, and 3 codes per 15 minutes per email address, 5 codes per day per email address from one IP address and 20 codes per day per email address |
| Sign-in code checks | 10 requests per 15 minutes per IP address; each code dies after 5 wrong guesses |
When a request-rate limit is exceeded the API returns 429 Too Many Requests with a Retry-After header (seconds until the window resets). Every POST /payments response carries the RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset and RateLimit-Policy headers of the limit that will refuse first. The open-payment cap answers 429 (too_many_open_payments) without Retry-After: it clears as open payments are paid or expire. The store and account limits say which was hit: scope (store or account) and limit, and the open-payment cap also current and the plan's tier.
Error reference
All errors return JSON with an error field describing what went wrong. Your code should always check the HTTP status code first, then inspect error for the specific reason. Many payment errors also include a docs_url field linking directly to the relevant section of this page — follow it when present; refund, Bitcoin, wallet-connect and link-checkout errors do not carry one.
HTTP/1.1 400 Bad Request
{
"error": "amount and currency are required",
"docs_url": "https://pay.aqua.net/docs#create-payment"
}
Payment creation errors
| HTTP | Error | Meaning |
|---|---|---|
400 | amount and currency are required | Missing required fields in request body. |
400 | Unsupported currency "…". Supported: … | The currency is not one of EUR, USD, GBP, CAD, AUD, JPY, CHF, DKK, BRL, SEK, NOK, PLN, CZK, HUF, RON, TRY, MXN, CLP, COP, ARS, NZD, SGD, HKD, KRW, INR, TWD, THB, IDR, ILS, AED, SAR, ZAR, HNL, GTQ, CRC, PEN, UYU, DOP, PYG, NGN, KES, GHS, UGX, TZS, XOF, XAF, PHP, VND, PKR, MYR, KZT, UAH, GEL (the list is also at GET /api/v1/currencies). |
400 | amount_precision | A fiat amount has more decimal places than its currency: 2, or 0 for JPY, HUF, CLP, COP, ARS, KRW, TWD, IDR, CRC, PYG, NGN, UGX, TZS, XOF, XAF, VND, PKR and KZT. The body names the field and its max_decimals. Every fiat amount is checked this way — payments, payment links (amount, minimum, maximum), the open-amount checkout and fiat refunds. Amounts must be a plain decimal (12.50 or "12.50"); "12.50EUR", "1e3" or " 10" are refused as invalid. Round to the currency's precision before sending. |
400 | Amount too small — the minimum payment is 1000 sats (…) | The fiat amount converts to less than 1,000 sats, or less than Indra's own minimum if that is ever higher. The message gives the minimum in force and its current fiat equivalent. Public link data (GET /checkout/link/:id) exposes it as min_payable_fiat so you can validate before submitting. |
400 | amount_below_minimum | Creating/editing a link with a fixed price below the 1,000-sat floor ×1.25 rate-drift margin, or a min_amount_fiat below the plain floor (minimums self-correct on the buyer page, so no margin applies). The message tells you the current minimum. |
400 | Amount too large — no payment method takes … sats; the most is … sats | The amount is above every method this payment could use: Lightning (Indra's current maximum), L-BTC direct and Bitcoin on-chain (10,000,000 sats) and USDT (10,000 USDT, when offered). Nothing was created. |
400 | Wallet not connected — connect your AQUA wallet first | No AQUA wallet linked to this account. Connect it from the setup card on the dashboard's Home. |
400 | metadata must be 2KB or less | The metadata object serialises to more than 2,048 bytes. |
400 | reference_requires_secret_key | reference was sent with a publishable key. Set it from your server, with a secret key. |
400 | invalid_reference | reference is not a string of 1–128 characters without control characters. |
400 | amount must be a positive number | The amount is missing, zero, negative or not a plain decimal. |
400 | redirect_url must be a valid URL · redirect_url must use HTTPS · redirect_url must be 2048 characters or fewer · redirect_url must not contain credentials | The redirect_url is not a URL, not https://, too long, or carries a user name or password. |
400 | URL must not point to a private or local address | The redirect_url host is localhost or a private, loopback or link-local address. |
400 | line_items… | A line item is invalid (the message names the row and field), there are more than 20, or they do not add up to the amount. See Line items. |
401 | Invalid or missing API key | Authorization header is missing, malformed, or the key has been revoked. |
402 | payments_paused | Not returned while AQUA Pay is free during the private launch. Once paid plans start, the store's new payments are paused: its owner's plan and its grace period have ended (reason: "plan_ended"), or the account's free trial is used up (reason: "trial_used"), or the store, payment link or POS terminal was not kept by its owner on a plan with lower limits (reason: "store_deactivated", "link_deactivated" or "terminal_deactivated" — see Moving to a plan with lower limits). The body carries error, reason, paused_since, message and buyer_message ("Payments are currently deactivated. Please contact the store."); the public link and POS checkout get only error, message and buyer_message. Renew or choose a plan at pay.aqua.net/account. Payments already created are unaffected. It replaced the earlier trial error on 2026-11-19 (see the changelog). See Plans, trial & grace. |
402 | store_frozen | Not returned while AQUA Pay is free during the private launch. Once paid plans start, a change refused while the plan is in its grace period or payments are paused: creating or editing a payment link or POS terminal, or a new checkout setting. The body carries stage (grace or paused), reason and message. Archiving, revoking a terminal and switching an option off still work. See Plans, trial & grace. |
403 | Secret key required for this endpoint | A publishable key (ak_pub_…) was used on a route that requires a secret key (ak_live_…). |
403 | email_not_verified | The store's email is not verified — this blocks all payment creation, for every key type. A store created from an account is verified when it is created; an older store is verified when its owner signs in at pay.aqua.net/account with the email code sent to that address. Then retry. |
403 | pro_plan_required | During the private launch, returned only to an account its owner switched to Starter. Once paid plans start, secret-key (ak_live_…) REST access needs the Business or Enterprise plan; publishable keys always work. |
403 | feature_not_in_plan | During the private launch, every account runs on Business (or Starter, by its owner's choice), so a Starter account's Business features and every account's Enterprise features are refused this way. A feature the account's plan does not include is refused with code: "feature_not_in_plan" and the fields feature, tier and required_tier (the tier pro is Business); error keeps an existing code where one exists (pro_plan_required). Nothing already paid or in progress is ever refused. |
403 | plan_limit_reached | Active-item cap reached (payment links, across all stores you own — see Rate limits). Archive an item. Existing items keep working. |
410 | service_retired | The product catalogue is switched off: GET and POST /api/v1/products, and PATCH and DELETE /api/v1/products/:id, answer 410 with service and message. Use payment links instead. Creating or changing a payment link to kind campaign answers 400 campaign_retired: campaigns are switched off too. |
404 | Payment not found | The payment_id does not exist or belongs to a different merchant account. |
409 | request_in_flight | An identical Idempotency-Key is already being processed. Wait for the first request to complete, then retry. |
400 | invalid_idempotency_key | A refund's Idempotency-Key is empty or longer than 255 characters. |
422 | idempotency_key_reused_with_different_payload | The same idempotency key was sent with a different request body. Use a new key for the new request. |
429 | rate_limit_exceeded | The store's or the account's payment-creation limit was reached (scope says which; see Rate limits). Back off and retry after the Retry-After header value (seconds). The per-IP limit answers 429 with error: "Rate limit exceeded" and no scope. |
429 | refund_rate_limited | The store has started as many refunds with a secret key as it may this hour or day. The body carries limit, window (hour or day) and retry_after; the Retry-After header says the same. Nothing was created or spent. See Refunds. |
429 | too_many_open_payments | The store's or the account's open-payment cap is reached (scope says which; see Rate limits). Wait for existing sessions to expire or settle before creating new ones. |
429 | rate_limit_exceeded (publishable key) | The per-IP-address request rate for publishable keys (see Rate limits). Retry after Retry-After. |
429 | too_many_open_payments (publishable key, no scope) | "Too many pending payments from this device": a cap per IP address on open payments created with a publishable key. Complete or wait for the device's open payments to expire. |
503 | Failed to fetch exchange rate — please retry | The BTC rate could not be fetched and no recent rate is cached (a rate up to 15 minutes old is used while the source is down). Retry after a few seconds. |
503 | Exchange rate temporarily unavailable for this currency — please retry | No rate for this currency right now. A payment is never priced at another currency's rate; retry shortly. |
503 | code: currency_unavailable | Both rate errors above also carry "code": "currency_unavailable", the currency and a Retry-After: 60 header; branch on code, not on the text. A currency is unavailable when the rate source omits it for over 15 minutes, when its rate fails AQUA Pay's sanity check, or for about a minute after a large exchange-rate move while the new level is confirmed. GET /api/v1/currencies lists every currency with available. |
400 | currency_not_supported_by_client | Open-amount link checkout only: the link is priced in a currency added after the original nine, the request named another currency, and it did not send link_currency (the link's currency, echoed). Older embed widgets do this; pay in the link's currency, or update the widget. |
503 | Wallet not connected — reconnect your AQUA wallet | An address could not be derived from the store's wallet. Reconnect the wallet from the dashboard. |
503 | Payment provider unavailable — please retry | Indra could not be reached: its current fees or limits were unavailable, or the swap could not be created. No payment or refund was created — nothing is guessed. Usually transient — retry after a few seconds. |
503 | Incomplete response from payment provider — please retry | Indra answered without everything a payment needs. Nothing was created; retry. |
500 | Payment setup failed — please retry · Database error — please retry | An internal error. Retry; if you sent an Idempotency-Key and the retry answers 409 request_in_flight, a payment was already recorded for it — read it rather than create another. |
Wallet connect errors
| HTTP | Endpoint | Meaning |
|---|---|---|
409 | POST /connect/descriptor | wallet_in_use: another store holds this wallet. Each store needs its own wallet. (A plain 409 without it: this store already has a wallet.) |
400 | POST /connect/descriptor | invalid_descriptor: the descriptor could not be read. invalid_btc_descriptor (with reason and detail): the Bitcoin descriptor is invalid or from another wallet. Descriptor too long (max 500 characters). |
401 | POST /connect/descriptor | Secret API key required (missing or publishable key) or Invalid or revoked API key. |
403 | POST /connect/descriptor | feature_not_in_plan (feature agentOnboarding, the wallet-connect-by-API feature) — once paid plans start, below Business. |
Payment link checkout errors
POST /checkout/link/:id/pay — see Payment links for when each applies: 400 Amount must be at least … / at most …, 400 amount_fiat and currency are required for open-amount links, 400 amount_too_small, 404 Payment link not found or inactive, 410 already_paid, 410 sold_out: This item is sold out., 429 too_many_open_payments, 429 link_busy.
Refund and credit-note errors
Listed with their endpoints: Refunds (starting, reading and cancelling a refund) and Credit notes. The buyer's claim page answers 404 or 410 for an unknown or expired link, 410 This refund was cancelled, 400 lightning is required and 400 Could not resolve that Lightning address.
Invoice & receipt errors
| HTTP | Endpoint | Meaning |
|---|---|---|
409 | GET /payments/:id/invoice, GET /invoice/:id, POST /payments/:id/resend-receipt | invoice_not_issued: the payment is paid but its invoice is still being issued, so there is no document to download or resend yet. Settlement issues it within seconds, and a background job issues any it missed within a minute: retry after a minute. A download never assigns an invoice number. |
404 | GET /payments/:id/invoice | Payment not found, belongs to a different account, or has not yet settled. PDFs are only generated for paid payments. No such invoice version: the version or number asked for does not exist. |
400 | GET /payments/:id/invoice | version is not a positive whole number. |
404 | GET /payments/:id/credit-note | No credit note for this payment, or No such credit note for the number asked for. |
400 | POST /payments/:id/resend-receipt | Payment not yet confirmed, or No buyer email on file for this payment (the buyer never submitted details). |
404 | POST /payments/:id/resend-receipt | Payment not found. |
429 | POST /checkout/:id/buyer-info | Too many submissions for this payment — please wait: more than 5 submissions for one payment within 24 hours. |
409 | POST /checkout/:id/buyer-info | Payment confirmed more than 30 minutes ago — the grace window has closed and buyer details can no longer be updated. |
400 | POST /checkout/:id/buyer-info | Neither buyer_name nor buyer_email provided, or buyer_email is not a valid email address. |
Bitcoin on-chain errors
| HTTP | Endpoint | Meaning |
|---|---|---|
409 bitcoin_not_available | POST /payments/:id/bitcoin, POST /checkout/:id/bitcoin | Bitcoin is off for this store, its wallet gave no usable Bitcoin account, the amount is outside the range Bitcoin is offered for, or the payment is a POS sale and the store does not offer Bitcoin at its terminals (not_offered_at_pos) (reason says which). Show Lightning and Liquid only. |
409 payment_not_open | Same | The payment is paid or expired and has no Bitcoin address. |
503 bitcoin_temporarily_unavailable | Same | No address can be given right now (reason: explorer_unavailable or address_limit_reached). Try again later; Lightning and Liquid still work. |
404 Payment not found | Same | Unknown payment, another store's, or a suspended store's open payment. |
429 poll_too_fast | GET /checkout/:id/btc-status | More than 30 polls a minute for one payment. |