Invoiceum
Sign in Create account

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

  1. Your server POSTs a checkout to Invoiceum (never from browser JavaScript).
  2. The JSON response includes payment_url. Redirect the customer there.
  3. The customer completes Checkout (billing → paying wallet → pay + TxID). Paying and receive wallets are screened (see Wallet screening).
  4. 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.paid postback. You can also GET checkout 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:

From the store list: Transactions · Logs · Edit.

Enable Merchant

  1. Open Merchant in the app menu (pale until enabled) and submit an application, or ask an administrator to turn Merchant on.
  2. After it is on, the button lights up with Stores, New store, API, Checkout invoices, and this documentation.
  3. Add at least one business receive wallet in Profile.
  4. Optional: set a default receive wallet under Merchant → API.
  5. 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

  1. Open Merchant and choose Add store.
  2. Enter a store name and optional website URL.
  3. Optional: upload a checkout logo (JPEG/PNG). It appears on the payment page. If you skip it, the Profile logo is used.
  4. Choose One-time billing. Recurring is a placeholder: the API rejects checkouts until it is built.
  5. Select one or more business receive wallets (see below).
  6. Optional: turn on A/B rotation and a payment window (see below).
  7. Optional: set a welcome page (customers go there after the invoice is marked paid).
  8. 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.
  9. Optional: up to two extra webhook URLs (affiliate, CRM, etc.). Same JSON and HMAC as the postbacks. Header X-Invoiceum-Hook is postback or webhook.
  10. 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.
  11. 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_name in the API.
  12. 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.

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.

MethodPurpose
POSTCreate 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
GETRead checkout status. Query: checkout_id (alias id), or reference (latest checkout for that order), or idempotency_key. Success: HTTP 200
OPTIONSCORS 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

CodeWhen
200GET status found, or POST replay of an open / paid checkout (same billed amount and currency)
201POST checkout created (including a new link for an expired, cancelled, or locked order)
204OPTIONS
400Bad JSON or validation (ok: false, error is a human-readable message)
401Bad store ID or API key
404GET checkout_id unknown or belongs to another store
405Method other than GET / POST / OPTIONS
409Idempotency 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)
500Server 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.

FieldAliasesNotes
namedescription, title, itemPrinted on the invoice (max 500 characters)
quantityqtyDefaults to 1
priceunit_price, rate, costPer unit. If you send amount instead, it is divided by quantity

Amounts, currency, tax

FieldAliasesNotes
currencyCrypto 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
fiatis_fiat, fiat_enabledtrue / false. Fiat invoices still pay in a store receive wallet’s crypto
fiat_currencyUSD, EUR, CAD, GBP, CHF or UAH when fiat is on. RUB and BYN are not supported
fiat_equalize1:1 with the crypto amount. Only for stablecoin wallets
tax_ratetaxPercent 0–100, applied on subtotal
vat_ratevatPercent 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

FieldAliasesNotes
invoice_dateYYYY-MM-DD. Default: today UTC
due_dateYYYY-MM-DD. Default: invoice date + 7 days, or + due_in_days
due_in_days0–365. Ignored if due_date is set
termsPayment terms. Default: “Online checkout via {store name}”
notesInvoice notes
referenceorder_id, external_idYour order id (max 120 characters). Used to find an existing checkout. It is not unique forever — see Idempotency
success_urlwelcome_urlhttp(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 checkoutSame billed amount and currencyDifferent amount or currency
pending, underpaid, overpaid, or paidHTTP 200, existing checkout, idempotent_replay: trueHTTP 409 code: idempotency_conflict (JSON includes checkout_id, status, amount, currency)
expired, cancelled, or lockedHTTP 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:

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.

FieldAliasesDigital invoice field
first_name / last_namename, contact_nameContact name
company_namecompanyCompany
emailEmail. If you send it, Checkout skips the email field; if you omit it, Checkout always asks
phonetelephonePhone
address_line1address1, streetStreet line 1
address_line2address2Street line 2
cityCity
stateregion, provinceState / region
postal_codezip, zip_codeZIP / postal code
addressFull address blob. Used only if the postal fields above are empty
countryEnglish name (for example United Kingdom)
tax_numbertaxTax number
vat_numbervatVAT 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.

FieldAliasesDigital invoice field
company_namecompanyFrom company
sender_namename, first_name + last_nameSender
emailFrom email
phonetelephoneFrom phone
addresspostal fields as aboveFrom address
countryFrom country
tax_numbertaxFrom tax number
vat_numbervatFrom 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"
}
FieldMeaning
okAlways true on success
checkout_idPublic id (chk_ + hex). Use for GET status and to match postbacks
store_idThe store that issued the checkout
referenceYour reference / order_id, or empty
invoice_numberNumber assigned on the merchant account
payment_urlSend the customer here. Path is /checkout/?t= plus a share token
expires_atUTC. Default payment link lasts 7 days, or the store checkout payment window if set (3 minutes to 24 hours)
amount / currencyWhat you billed (fiat total if fiat, otherwise crypto)
fiattrue if billed in a supported fiat
crypto_currency / crypto_amountOn-chain amount at create time. If the buyer picks another accepted asset on Checkout, the amount is repriced (see Payment page)
networkNetwork of the receive wallet chosen at create time. Checkout may switch this when the buyer picks another pair
statusAlways 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:

statusMeaningpayment.paid postback
pendingAwaiting payment (including a top-up invoice that has not been paid yet)No
underpaidA matching incoming transfer was short of the crypto due. The buyer is choosing to top up or cancelNo
overpaidA matching transfer was more than the due amount. The buyer is choosing to accept or cancelNo
paidExact match, remaining top-up paid in full, or the buyer accepted an overpayment — after the network settlement rules belowYes
lockedThe third top-up attempt was still short. Checkout cannot take another paymentNo
cancelledThe buyer cancelled after a short payment or overpaymentNo
expiredThe payment window / checkout link ended (expires_at) while the sale was still unpaid. GET no longer stays pendingNo

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:

  1. Billing — email is always required, plus any other Bill To fields you require in Settings. Saved as a client on the merchant account.
  2. 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).
  3. 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:

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:

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:

When a payment is confirmed

Invoiceum does not mark checkout paid (and does not send payment.paid) on an unconfirmed transfer. Required depth:

NetworkRequired
TRON (TRX / TRC-20)Solidified block (~19 blocks, about 57 seconds). TronGrid only_solidified=true
Bitcoin1 confirmation (included in a block)
Ethereum, Arbitrum, Base12 confirmations
BNB Smart Chain15 confirmations
Polygon30 confirmations
Solanafinalized (~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:

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:

Until the buyer accepts, GET status is overpaid. Do not fulfill.

What you see in the account

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:

AttemptWhen
1Immediately
21 minute later
35 minutes
415 minutes
51 hour
64 hours
712 hours
824 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

Related: Non-custodial crypto processing · Exchange rates · Digital payment links · Outgoing invoices · Profile and settings.

Still stuck? Contact Support or read the Changelog.