Merchant checkout API
Merchant lets your website create an Invoiceum checkout through the API. The customer pays on an Invoiceum payment page. Crypto goes to the store receive wallet. Invoiceum never holds funds.
This page is the API specification: where to send the request, which headers and JSON fields to pass, and what comes back. How underpayment, overpayment, lock, and cancel work in the account: Merchant account. Stores and keys live under Merchant.
How a payment works
- Your server
POSTs a checkout to Invoiceum (never from browser JavaScript). - The JSON response includes
payment_url. Redirect the customer there. - The customer completes Checkout (billing → paying wallet → pay + TxID). Paying and receive wallets are screened (see Wallet screening).
- When the checkout is fully paid (exact amount, remaining top-up paid in full, or the buyer accepts an overpayment), Invoiceum POSTs a signed
payment.paidpostback. You can alsoGETcheckout status. A short payment or an unaccepted overpayment does not send that postback.
Store transactions and request logs
Wallet Statement is still per wallet. Each store has its own lists under Merchant:
- Transactions — checkouts for that store (amount, status, TxID). Filter by date. Open a row to see the GET/POST log for that checkout.
- Request logs — checkout steps (created, billing, paying wallet, auto-scan, paid, postback), inbound
GET/POSTto/api/v1/checkout, and outbound postbacks. Written underdata/merchant-logs/{storeId}/as a daily.flow.log(readable timeline) plus JSONL. API keys are redacted. Files older than 90 days are removed.
From the store list: Transactions · Logs · Edit.
Enable Merchant
- Open Merchant in the app menu (pale until enabled) and submit an application, or ask an administrator to turn Merchant on.
- After it is on, the button lights up with Stores, New store, API, Checkout invoices, and this documentation.
- Add at least one business receive wallet in Profile.
- Optional: set a default receive wallet under Merchant → API.
- Optional: set a country blacklist or whitelist on the same API page — add countries one by one. Checkout checks the buyer IP (CDN header, then GeoIP), the billing country, and — if IP is unknown on a whitelist — the browser language region. Geo rules apply to the payment page, not to API create.
Until Merchant is enabled the API returns 401. The pale menu button still opens the application form.
Create a store
- Open Merchant and choose Add store.
- Enter a store name and optional website URL.
- Optional: upload a checkout logo (JPEG/PNG). It appears on the payment page. If you skip it, the Profile logo is used.
- Choose One-time billing. Recurring is a placeholder: the API rejects checkouts until it is built.
- Select one or more business receive wallets (see below).
- Optional: turn on A/B rotation and a payment window (see below).
- Optional: set a welcome page (customers go there after the invoice is marked paid).
- Postback URL 1 activates the store (Invoiceum POSTs JSON when the checkout is marked paid — see Short payment and overpayment). You can create the store without it; API checkout returns 403 until the URL is saved. Optional Postback URL 2. Send test postback on the store page sends
event: postback.test— do not fulfill on that event. - Optional: up to two extra webhook URLs (affiliate, CRM, etc.). Same JSON and HMAC as the postbacks. Header
X-Invoiceum-Hookispostbackorwebhook. - Optional checkout emails (off by default, in addition to the postback): sale notice and/or paid invoice PDF to your invoice/account email; extra addresses with the same choice; and a paid invoice PDF to the buyer’s checkout email. The PDF is marked PAID and includes amount, TxID, items, and wallets.
- Optional: Hide first and last name on checkout. The payment page skips those fields even if they are required for digital invoices. Checkout still always collects email. If you already know the buyer, you can still send
first_name/last_namein the API. - Save. Copy the API key immediately — it is shown once. The Store ID looks like
st_plus hex.
Shopify is one optional channel, not a replacement for this API. WooCommerce, KVS, and any server that POSTs to /api/v1/checkout keep the same headers, JSON, and store postback URLs. The Shopify app does not overwrite those hooks. Setup: Shopify app.
Call the API only from your server. Do not put the API key in browser JavaScript, mobile apps, or public pages.
On the store page you can create a test checkout (a small unpaid invoice) to open the payment page. Nothing is taken unless someone actually pays the wallet.
Receive wallets
A store may use several Profile wallets. Only business wallets are allowed. Personal wallets and exchange deposit / shared hot wallets cannot receive Merchant checkout.
- The buyer, on Checkout step 2, picks a cryptocurrency and network from those wallets.
- A crypto
POST(for example"currency": "USDT") must match at least one selected wallet. Fiat checkouts (fiat: trueor a supported fiat code) still settle in crypto from those wallets. - You cannot set the pay-to address from the API. The address always comes from the store wallets.
A/B rotation
If two or more selected wallets share the same asset and the same network (for example two USDT TRC20 addresses), the store can enable A/B rotation. When the buyer chooses that pair, Invoiceum issues the address that has gone longest without an incoming Statement transaction. USDT on Tron is never swapped for USDT on Ethereum, or for ETH.
If only one wallet matches the chosen pair, rotation does nothing: that wallet is used.
Payment window
Optional, from 3 minutes to 24 hours. Copied onto each checkout invoice. The payment link expires at the same time. If you leave No extra limit, the link lasts 7 days (unless you later cap a digital invoice another way).
A TxID sent before the invoice was created, or after this window, is rejected.
Endpoint
Base URL:
https://invoiceum.com/api/v1/checkout
A trailing slash is equivalent. Use HTTPS. JSON in, JSON out. Content-Type: application/json on POST.
| Method | Purpose |
|---|---|
POST | Create a checkout and outgoing invoice. Success: HTTP 201. A safe repeat (same billed amount and currency, checkout still open) returns HTTP 200 and idempotent_replay: true. See Idempotency below |
GET | Read checkout status. Query: checkout_id (alias id), or reference (latest checkout for that order), or idempotency_key. Success: HTTP 200 |
OPTIONS | CORS preflight. HTTP 204 |
Authentication
Send the store ID and API key on every request. Preferred headers:
X-Invoiceum-Store-Id: st_… X-Invoiceum-Api-Key: your_secret Content-Type: application/json
You may instead send Authorization: Bearer your_secret with the store ID header. Store ID may also be ?store_id= on GET. Body fields store_id and api_key work on POST but are not recommended.
Invalid, missing, blocked, or Merchant-disabled stores return HTTP 401:
{ "ok": false, "error": "Invalid store credentials." }
HTTP status codes
| Code | When |
|---|---|
| 200 | GET status found, or POST replay of an open / paid checkout (same billed amount and currency) |
| 201 | POST checkout created (including a new link for an expired, cancelled, or locked order) |
| 204 | OPTIONS |
| 400 | Bad JSON or validation (ok: false, error is a human-readable message) |
| 401 | Bad store ID or API key |
| 404 | GET checkout_id unknown or belongs to another store |
| 405 | Method other than GET / POST / OPTIONS |
| 409 | Idempotency conflict: same key/reference, different amount or currency (code: idempotency_conflict), or the Idempotency-Key already belongs to an expired / cancelled / locked checkout (code: checkout_closed) |
| 500 | Server error creating the checkout |
Every JSON error body looks like:
{ "ok": false, "error": "…" }
Typical 400 messages: missing items, quantity/price invalid, currency does not match a store receive wallet, unsupported fiat, recurring store, invalid email, URL must start with http(s), checkout_id or reference is required on GET.
Create a checkout
POST /api/v1/checkout with a JSON object. Required: at least one line item. Everything else is optional and maps to digital invoice fields.
If you omit Bill To, Checkout collects it. Email is always required on Checkout, even if Email is unchecked in Settings. Other Bill To fields follow Settings.
Minimal example
POST /api/v1/checkout
X-Invoiceum-Store-Id: st_…
X-Invoiceum-Api-Key: your_secret
Content-Type: application/json
{
"items": [
{ "name": "Pro plan", "quantity": 1, "price": 49 }
],
"currency": "USDT",
"fiat": false,
"reference": "order-1001"
}
curl
curl -sS -X POST https://invoiceum.com/api/v1/checkout \
-H "X-Invoiceum-Store-Id: st_YOUR_STORE" \
-H "X-Invoiceum-Api-Key: YOUR_SECRET" \
-H "Content-Type: application/json" \
-d '{
"items": [{"name": "Pro plan", "quantity": 1, "price": 49}],
"currency": "USDT",
"fiat": false,
"reference": "order-1001"
}'
Redirect the customer to the payment_url from the JSON response.
Full example
{
"items": [
{ "name": "Pro plan", "quantity": 1, "price": 49 }
],
"currency": "USDT",
"fiat": false,
"fiat_currency": "USD",
"fiat_equalize": false,
"tax_rate": 0,
"vat_rate": 0,
"invoice_date": "2026-11-06",
"due_date": "2026-11-13",
"due_in_days": 7,
"terms": "Due on receipt",
"notes": "Order 1001",
"bill_to": {
"first_name": "Ada",
"last_name": "Lovelace",
"company_name": "Analytical Engines Ltd",
"email": "ada@example.com",
"phone": "+44 20 0000 0000",
"address_line1": "1 Example Street",
"address_line2": "",
"city": "London",
"state": "",
"postal_code": "EC1A 1BB",
"country": "United Kingdom",
"tax_number": "",
"vat_number": ""
},
"from": {
"company_name": "Your company",
"sender_name": "Jane Smith",
"email": "billing@example.com",
"phone": "",
"address": "",
"country": "",
"tax_number": "",
"vat_number": ""
},
"reference": "order-1001",
"success_url": "https://example.com/thanks"
}
Line items
Use items or line_items. Maximum 50 rows. Each row needs a name, quantity > 0, and a price.
| Field | Aliases | Notes |
|---|---|---|
name | description, title, item | Printed on the invoice (max 500 characters) |
quantity | qty | Defaults to 1 |
price | unit_price, rate, cost | Per unit. If you send amount instead, it is divided by quantity |
Amounts, currency, tax
| Field | Aliases | Notes |
|---|---|---|
currency | Crypto must match one of the store receive wallets (for example USDT). If you send a supported fiat (USD, EUR, CAD, GBP, CHF, UAH), the checkout is treated as fiat-billed | |
fiat | is_fiat, fiat_enabled | true / false. Fiat invoices still pay in a store receive wallet’s crypto |
fiat_currency | USD, EUR, CAD, GBP, CHF or UAH when fiat is on. RUB and BYN are not supported | |
fiat_equalize | 1:1 with the crypto amount. Only for stablecoin wallets | |
tax_rate | tax | Percent 0–100, applied on subtotal |
vat_rate | vat | Percent 0–100, applied on subtotal after tax |
The receive address, network, and crypto asset always come from the store’s selected business wallets (the buyer picks among those on Checkout). You cannot override pay-to from the API.
Dates, terms, notes, reference
| Field | Aliases | Notes |
|---|---|---|
invoice_date | YYYY-MM-DD. Default: today UTC | |
due_date | YYYY-MM-DD. Default: invoice date + 7 days, or + due_in_days | |
due_in_days | 0–365. Ignored if due_date is set | |
terms | Payment terms. Default: “Online checkout via {store name}” | |
notes | Invoice notes | |
reference | order_id, external_id | Your order id (max 120 characters). Used to find an existing checkout. It is not unique forever — see Idempotency |
success_url | welcome_url | http(s) page after paid. Overrides the store welcome URL for this checkout (max 512 characters) |
Invoice numbers are assigned by the account numbering settings. You cannot set the invoice number from the API.
Idempotency (reference and Idempotency-Key)
A second POST must not leave the shop stuck with a dead payment link, and it must not silently change the billed amount of an open sale.
Optional header Idempotency-Key (max 120 characters) is a request key. It is unique per store while it is in use. It is not taken from reference — if you omit the header, Invoiceum does not invent one from the order id.
Body reference (aliases order_id, external_id) is your order id. Several checkouts may share it over time (retry after expiry). GET ?reference= returns the latest checkout for that order.
Lookup on POST: the header key first (if sent), otherwise the latest checkout with that reference.
| Existing checkout | Same billed amount and currency | Different amount or currency |
|---|---|---|
pending, underpaid, overpaid, or paid | HTTP 200, existing checkout, idempotent_replay: true | HTTP 409 code: idempotency_conflict (JSON includes checkout_id, status, amount, currency) |
expired, cancelled, or locked | HTTP 201 — a new checkout (new checkout_id and payment_url), same reference. The old checkout stays as it is. Exception: if you reuse the same Idempotency-Key that created the closed checkout, HTTP 409 code: checkout_closed — send a new header value (keep the same reference) | |
Example: checkout for order-1001 expired. POST the same JSON again (no header, or a new Idempotency-Key) → 201 and a new link. POST a different amount with the same reference while the first checkout is still pending → 409.
If you send both reference and Idempotency-Key with different values:
- The header is stored on the new checkout and is the unique replay slot for that HTTP request.
referenceis stored as the order id (GET by reference, postbackreference).- POST lookup still prefers the header. If that key is new, Invoiceum then looks up the latest checkout with that
referenceso you cannot open a second live sale for the same order. - They are not aliases of each other. Do not put the order id in the header unless you want that string to be the unique request key (then you cannot reuse it after
expired/cancelled/lockedwithout a new header value).
CORS preflight allows the Idempotency-Key header.
Bill To (customer)
Nested object bill_to or customer. Flat aliases also work: bill_to_email, customer_email, and the same pattern for the other fields.
| Field | Aliases | Digital invoice field |
|---|---|---|
first_name / last_name | name, contact_name | Contact name |
company_name | company | Company |
email | Email. If you send it, Checkout skips the email field; if you omit it, Checkout always asks | |
phone | telephone | Phone |
address_line1 | address1, street | Street line 1 |
address_line2 | address2 | Street line 2 |
city | City | |
state | region, province | State / region |
postal_code | zip, zip_code | ZIP / postal code |
address | Full address blob. Used only if the postal fields above are empty | |
country | English name (for example United Kingdom) | |
tax_number | tax | Tax number |
vat_number | vat | VAT number |
From (seller)
Nested object from or seller, or flat from_* keys (for example from_email, from_sender_name). Omitted fields fall back to the account profile printed on invoices: company, sender name, email, phone, tax, VAT, country. Postal fields are the same as Bill To.
| Field | Aliases | Digital invoice field |
|---|---|---|
company_name | company | From company |
sender_name | name, first_name + last_name | Sender |
email | From email | |
phone | telephone | From phone |
address | postal fields as above | From address |
country | From country | |
tax_number | tax | From tax number |
vat_number | vat | From VAT number |
Create response (HTTP 201)
{
"ok": true,
"checkout_id": "chk_…",
"store_id": "st_…",
"reference": "order-1001",
"invoice_number": "42",
"payment_url": "https://invoiceum.com/checkout/?t=…",
"expires_at": "2026-11-13 12:00:00",
"amount": 49,
"currency": "USDT",
"fiat": false,
"crypto_currency": "USDT",
"crypto_amount": 49,
"network": "TRC20",
"status": "pending"
}
| Field | Meaning |
|---|---|
ok | Always true on success |
checkout_id | Public id (chk_ + hex). Use for GET status and to match postbacks |
store_id | The store that issued the checkout |
reference | Your reference / order_id, or empty |
invoice_number | Number assigned on the merchant account |
payment_url | Send the customer here. Path is /checkout/?t= plus a share token |
expires_at | UTC. Default payment link lasts 7 days, or the store checkout payment window if set (3 minutes to 24 hours) |
amount / currency | What you billed (fiat total if fiat, otherwise crypto) |
fiat | true if billed in a supported fiat |
crypto_currency / crypto_amount | On-chain amount at create time. If the buyer picks another accepted asset on Checkout, the amount is repriced (see Payment page) |
network | Network of the receive wallet chosen at create time. Checkout may switch this when the buyer picks another pair |
status | Always pending on create |
Redirect the customer to payment_url. That opens Invoiceum’s Checkout page (a stepped shop flow, not the digital invoice share layout). Recurring stores return HTTP 400 until recurring billing is available.
Checkout status (GET)
GET /api/v1/checkout?checkout_id=chk_… X-Invoiceum-Store-Id: st_… X-Invoiceum-Api-Key: your_secret GET /api/v1/checkout?reference=order-1001 X-Invoiceum-Store-Id: st_… X-Invoiceum-Api-Key: your_secret
checkout_id may also be sent as id. HTTP 200:
{
"ok": true,
"checkout_id": "chk_…",
"store_id": "st_…",
"reference": "order-1001",
"status": "pending",
"invoice_number": "42",
"amount": 49,
"currency": "USDT",
"fiat": false,
"payment_url": "https://invoiceum.com/checkout/?t=…",
"expires_at": "2026-11-13 12:00:00",
"tx_hash": "",
"paid_at": null
}
GET also returns invoice_number for the current checkout invoice (the original number, or a continuation such as 42-1 during a top-up). After a confirmed paid checkout, tx_hash is the last accepted TxID and paid_at is a UTC timestamp. Unknown ids return HTTP 404 Checkout not found.
status values:
| status | Meaning | payment.paid postback |
|---|---|---|
pending | Awaiting payment (including a top-up invoice that has not been paid yet) | No |
underpaid | A matching incoming transfer was short of the crypto due. The buyer is choosing to top up or cancel | No |
overpaid | A matching transfer was more than the due amount. The buyer is choosing to accept or cancel | No |
paid | Exact match, remaining top-up paid in full, or the buyer accepted an overpayment — after the network settlement rules below | Yes |
locked | The third top-up attempt was still short. Checkout cannot take another payment | No |
cancelled | The buyer cancelled after a short payment or overpayment | No |
expired | The payment window / checkout link ended (expires_at) while the sale was still unpaid. GET no longer stays pending | No |
Fulfill the order in your shop only when GET is paid or you receive event: payment.paid. Do not ship on underpaid or overpaid.
Payment page
The customer opens a dedicated Checkout page (not the digital invoice share layout). The page states that payment goes directly to the seller’s wallet and that Invoiceum does not collect or hold funds. Geo blacklist/whitelist, if set, apply here.
Three steps. The QR and receive address stay hidden until the last:
- Billing — email is always required, plus any other Bill To fields you require in Settings. Saved as a client on the merchant account.
- Paying wallet — the customer picks cryptocurrency and network from the store’s business wallets, then enters their own hot or cold wallet address. Withdrawals from centralized exchanges are rejected. The paying address and the store receive address are screened before this step can continue (see Wallet screening).
- Pay — QR and receive address for that asset and network, plus the TxID field.
Wallet screening
Exact address match only, against Invoiceum’s files in data/screening/: US OFAC SDN digital-currency addresses, Tether USDT TRC-20 blacklist (and live Ethereum USDT blacklist), plus optional local_denylist.json. A failed lookup does not block. A confirmed hit does.
Cron: php tools/refresh-address-lists.php. Recommended schedule: once or twice a day (example crontab in the script: 04:15 UTC). Lists older than 36 hours are treated as stale; for USDT on TRON, Checkout then calls Tether’s on-chain isBlackListed if the file is missing or stale. Cron never overwrites local_denylist.json.
When a hit fires:
- Buyer, step 2 — they stay on the paying-wallet step. The QR is not shown. They see the specific reason (OFAC SDN, Tether blacklist, or Invoiceum denylist). Checkout status stays whatever it was (usually
pending). They can try another address. - GET — unchanged (
pending/underpaid/ …). No new status. Nopayment.paid. - Postback — none. Screening is not a paid event.
- Store logs —
paying_wallet_failedwith that message. TxID matching that hits a listed payer or receive address also rejects the hash (buyer sees the message; still no paid postback). - Shop receive wallet listed — the buyer cannot complete step 2 (or a later TxID) for that asset. Saving the address in Profile is already blocked. If a listed address is already on the store, Checkout will not issue a payable QR until the wallet is replaced. GET stays unpaid; you will see the failure in Request logs, not as a checkout status.
If the buyer picks another asset (for example ETH)
They can only pick assets and networks you attached to the store. If they choose ETH and you have an ETH business wallet, Checkout switches the receive address to that wallet (A/B applies if you have more than one ETH address on the same network).
The amount to send is recalculated when they confirm the paying wallet:
- Fiat-billed checkout (USD, EUR, CAD, GBP, CHF or UAH) — the fiat total stays. ETH (or any other coin) is priced from CoinGecko at that moment. 1:1 equalize is only for stablecoins, never for ETH. Details: Exchange rates.
- Crypto-billed checkout (for example 50 USDT) — the USDT due is converted through USD into the chosen coin at the same rates.
- If they already pay in the invoice’s crypto, there is no conversion.
Step 3 and TxID matching use this new crypto amount. Create and GET keep the billed amount / currency from your request. After pay, the postback crypto_currency is the asset that was actually sent.
TxID matching
The pasted hash must be an incoming transfer to the issued receive address. Invoiceum rejects it unless all of these hold:
- Amount — compared to the crypto due (tiny rounding tolerance). An exact match marks the checkout paid. A short payment or overpayment opens a dialog instead of failing silently (see below).
- Asset — same token as the receive wallet (for example ETH, not USDT).
- Time — the transfer is not earlier than invoice creation, and not after the payment window if you set one.
- Receive wallet — the hash is looked up on that store address; a payment to a different address is not found.
- Sender — the on-chain from-address matches the paying wallet from step 2.
- Settlement — the transfer must be confirmed to Invoiceum’s network thresholds before
paid(see below). Mempool / unsolidified transfers are rejected; paste the TxID again after they settle. - One TxID, one invoice — a hash already accepted on any invoice of this merchant account (another checkout, a top-up, or a digital invoice) is rejected. Time-after-create is not enough: two 49 USDT checkouts created before one transfer would otherwise both match. The database unique index is
(user_id, lower(tx hash))for non-empty hashes, so two tabs cannot race the same payment. Invoiceum stores the transaction hash (not a separate log index); one on-chain tx hash therefore cannot pay two invoices on the same account.
When a payment is confirmed
Invoiceum does not mark checkout paid (and does not send payment.paid) on an unconfirmed transfer. Required depth:
| Network | Required |
|---|---|
| TRON (TRX / TRC-20) | Solidified block (~19 blocks, about 57 seconds). TronGrid only_solidified=true |
| Bitcoin | 1 confirmation (included in a block) |
| Ethereum, Arbitrum, Base | 12 confirmations |
| BNB Smart Chain | 15 confirmations |
| Polygon | 30 confirmations |
| Solana | finalized (~32 confirmations) |
After that, a reorg that undoes paid is unlikely on these networks, but Invoiceum is non-custodial: coins already sit on your wallet. If an explorer later reorgs, GET may still show paid for a TxID you already accepted. For very large orders, wait extra confirmations on your side before shipping.
On an exact match, Invoiceum keeps the customer in Clients, keeps the checkout as an outgoing invoice with a checkout chip (filter Origin → Checkout), marks it paid, POSTs the store postback and extra webhooks if set, and offers Continue to the welcome URL (success_url, otherwise the store welcome page).
Short payment and overpayment
Invoiceum does not hold funds. Any refund of a short payment, a cancelled checkout, or extra crypto is arranged between the buyer and you. Checkout only records what arrived on-chain and whether the sale is complete enough to send payment.paid.
Short payment (underpayment)
If a matching incoming transfer (same asset, receive address, paying wallet, and time window) is less than the crypto due, Checkout does not mark the sale paid. The buyer sees a dialog:
- Pay the remaining amount — Invoiceum issues a new outgoing invoice for the shortfall and the buyer repeats the pay step (same paying wallet and receive address, same checkout link). The original payment window still applies.
- Cancel and contact the seller for a refund — checkout status becomes
cancelled. Unpaid invoices on that checkout are declined. No paid postback.
Top-up invoices are numbered as a continuation of the original, for example 42, then 42-1, 42-2, 42-3 (custom labels use the same suffix: INV-001-1). The original invoice stays Partial with the short TxID. The current invoice is the one GET invoice_number and the checkout page show.
The buyer has three top-up attempts after the first short payment. If the third top-up is still short, checkout status becomes locked. They cannot pay again. Checkout tells them to contact you to cancel and request a refund. No paid postback.
A successful payment.paid postback after a short payment is sent only when a later transfer covers the remaining due in full (exact match on the current top-up invoice).
Overpayment
If a matching transfer is more than the crypto due — including when a top-up invoice is overpaid — Checkout shows a dialog:
- Accept this payment and contact the seller about the extra — checkout is marked paid. Then Invoiceum sends
payment.paid(and extra webhooks / sale email / Shopify paid order if those are on). The buyer is asked to contact you about the extra amount. Invoiceum cannot refund it. - Cancel and contact the seller — checkout status becomes
cancelled. No paid postback.
Until the buyer accepts, GET status is overpaid. Do not fulfill.
What you see in the account
- Store Transactions and GET
statusfollow the checkout:pending,underpaid,overpaid,paid,locked,cancelled,expired. - Outgoing invoices: the first invoice is Partial after a short payment; each top-up is a separate invoice with a continuation number; the last invoice is Paid only when the checkout is paid.
- Request logs /
.flow.logrecord steps such asunderpaid,underpay_topup,underpay_locked,overpaid,overpay_accepted,checkout_cancelled,expired,paying_wallet_failed, thenmarked_paidandpostback_sentonly when the sale is actually accepted as paid.
Postback and extra webhooks
When the checkout is marked paid (exact match, remaining top-up paid in full, or accepted overpayment, after settlement), Invoiceum POSTs the same JSON to up to two shop postback URLs and up to two extra webhook URLs. Short payments, waiting overpayments, locked, cancelled, and expired checkouts do not send payment.paid. Duplicate URLs are posted once. Each delivery is written to the store request log.
POST https://example.com/hooks/invoiceum
Content-Type: application/json
X-Invoiceum-Event: payment.paid
X-Invoiceum-Event-Id: evt_…
X-Invoiceum-Timestamp: 1730000000
X-Invoiceum-Hook: postback
X-Invoiceum-Signature: v1=hex_hmac_sha256
User-Agent: Invoiceum-Merchant/1.0
{
"event": "payment.paid",
"event_id": "evt_…",
"store_id": "st_…",
"checkout_id": "chk_…",
"reference": "order-1001",
"invoice_number": "42",
"amount": 49,
"currency": "USDT",
"fiat": false,
"crypto_currency": "USDT",
"tx_hash": "…",
"paid_at": "2026-11-06 12:00:00"
}
Sign with the store webhook secret (not the API key):
X-Invoiceum-Signature: v1=HMAC_SHA256(webhook_secret, timestamp + "." + rawBody)
Verify before you fulfill:
$ts = $_SERVER['HTTP_X_INVOICEUM_TIMESTAMP'] ?? '';
$sig = $_SERVER['HTTP_X_INVOICEUM_SIGNATURE'] ?? '';
$raw = file_get_contents('php://input');
$secrets = array_filter([$webhookSecret, $previousWebhookSecret ?? '']);
$ok = abs(time() - (int) $ts) <= 300;
if ($ok) {
$ok = false;
$signed = $ts . '.' . $raw;
foreach (preg_split('/\s*,\s*/', $sig) ?: [] as $part) {
$part = trim($part);
foreach ($secrets as $secret) {
$expected = 'v1=' . hash_hmac('sha256', $signed, $secret);
if ($part !== '' && hash_equals($expected, $part)) {
$ok = true;
break 2;
}
}
}
}
Loop every comma-separated v1= value. Accept if any matches the current webhook secret or the previous secret (valid 24 hours after rotation). Checking only explode(',', $sig)[0] will reject a valid postback during rotation. Reject if the timestamp is older than 5 minutes (replay window). Deduplicate on X-Invoiceum-Event-Id / event_id — retries reuse the same id.
Retries
Attempt 1 is sent as soon as the checkout is marked paid. If any target does not return HTTP 2xx, Invoiceum retries that checkout until every URL has succeeded or attempts are exhausted:
| Attempt | When |
|---|---|
| 1 | Immediately |
| 2 | 1 minute later |
| 3 | 5 minutes |
| 4 | 15 minutes |
| 5 | 1 hour |
| 6 | 4 hours |
| 7 | 12 hours |
| 8 | 24 hours |
After a 2xx from every target, that event is not sent again. After 8 failed attempts, delivery stops (postback_status abandoned). GET status may trigger a due retry; cron php tools/retry-merchant-postbacks.php (every minute) drains the queue. The JSON body and event_id stay the same on every attempt; only X-Invoiceum-Timestamp and the signature change.
Fulfill only when event is payment.paid and checkout_id / reference match your order. Ignore postback.test. Do not fulfill on GET underpaid, overpaid, or expired. Extra webhooks use X-Invoiceum-Hook: webhook and the same signature. Sale-notification email and Shopify paid-order creation use the same paid moment as this postback.
Security
- Keep the API key on the server for POST/GET checkout. Rotate it from the store page if it leaks (the previous API key stops working immediately). That rotation does not change postback signatures.
- Keep the webhook secret only on the server that verifies postbacks. Rotate it separately; the previous webhook secret still verifies for 24 hours.
- Treat postbacks as untrusted until timestamp +
v1signature match, and ignore events older than 5 minutes. - Store processed
event_idvalues and ignore duplicates. - Match
checkout_idandreferenceto your order before marking it paid in your system. - Invoiceum is non-custodial: the customer pays the issued store wallet on-chain. A postback means the checkout was marked paid after a matching, settled TxID (or an accepted overpayment), not that Invoiceum moved or refunded funds.
Related: Non-custodial crypto processing · Exchange rates · Digital payment links · Outgoing invoices · Profile and settings.
Still stuck? Contact Support or read the Changelog.