Documentation menu

API reference

All project endpoints live under /api/v1 on your gateway, for example https://pay.example.com/api/v1. They take and return JSON unless noted. The request body limit is 64 KB.

Authentication

Send the project's API key as a bearer token:

Authorization: Bearer tg_live_9pQ2wXz...

Keys are created under the project's Settings, API keys in the dashboard. Mainnet projects get tg_live_... keys and testnet projects tg_test_... keys. In single-store mode the key is API_SECRET_KEY from the server environment. A key belongs to exactly one project and only sees that project's invoices, transfers and webhooks. The server stores only a SHA-256 hash of each key.

A missing, revoked or unknown key, or a key whose project is disabled, gets:

{ "error": { "code": "unauthorized", "message": "Missing or invalid API key." } }

with status 401.

Use API keys from your server only. Never put one in browser or mobile code.

Errors

Every error has the same shape:

{ "error": { "code": "order_conflict", "message": "Order \"ORDER-1001\" already has an open invoice for a different amount." } }

Match on code, not on message. The codes:

Status Code When
400 invalid_request The body or query failed validation. The message names the field, for example ttl_minutes: Too big: expected number to be <=1440
400 invalid_amount amount is not a positive decimal, or has more decimals than the token (6 for USDT)
400 amount_too_small Forwarder projects: below SWEEP_MIN_AMOUNT (default 1 USDT), or, when the merchant pays a network fee, less than SWEEP_MIN_AMOUNT would be left after the fee. The message names the smallest amount
401 unauthorized Missing or invalid API key
403 simulation_disabled simulate-payment on a mainnet project, or on a testnet project without simulation enabled
403 forbidden sweep with force: true from an API key (only a dashboard admin may force)
403 project_disabled The project is disabled (seen from the dashboard; API keys of a disabled project get 401)
404 not_found Unknown invoice, transfer or webhook event, or one that belongs to another project
409 order_conflict The order_id has an open invoice for a different amount
409 invalid_state The action does not fit the invoice's state, for example simulating a paid invoice, assigning an already assigned transfer, or accepting an invoice that has no deposit address
409 needs_confirmation accept or assign found something to check (underpaid, outside the payment window, order already paid). Send force: true to go ahead
409 nothing_to_sweep sweep on a deposit address with nothing waiting
409 below_minimum sweep without force on a balance below SWEEP_MIN_AMOUNT, or on a balance that does not exceed the invoice's unpaid network fee
409 legacy_forwarder sweep on an invoice whose deposit address belongs to the previous contract version (forwarder.version: 1). Flush it by hand, see Network fees
429 Rate limit reached (see below)
500 internal_error A bug or an unexpected failure. Details are in the server log
503 amount_slots_exhausted Unique-amount projects: every unique amount near this price is taken by an open invoice. Retry shortly
503 too_many_open_invoices Forwarder projects: more than FORWARDER_MAX_OPEN_INVOICES open invoices
503 forwarder_unavailable Forwarder projects: the project's factory is not verified on this server right now (for example a v1 factory after an upgrade), or the fee collector is misconfigured. Retry later and tell the operator if it persists

Rate limits

Scope Limit
Every route, per client IP 300 requests per minute
GET /pay/:id/status 120 per minute
Dashboard sign-in 10 per minute

Behind a reverse proxy, set TRUST_PROXY=true so limits apply per real client IP instead of per proxy.

The invoice object

{
  "id": "inv_Luonp2fQ0b8rR1cS9yZ5w08",
  "object": "invoice",
  "project_id": "prj_4mJ0c8vQx1Zr2bTn",
  "status": "paid",
  "order_id": "ORDER-1001",
  "amount": "49.9",
  "amount_due": "49.907423",
  "network_fee": null,
  "amount_net": "49.907423",
  "currency": "USDT",
  "network": "tron",
  "token_contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "pay_address": "TJ4kA5wRUM9f3xLtBTrPdT5ri7Q2kbUhAF",
  "checkout_url": "https://pay.example.com/pay/inv_Luonp2fQ0b8rR1cS9yZ5w08",
  "description": "2x Hoodie",
  "metadata": { "customer_id": 42 },
  "success_url": "https://shop.example/orders/ORDER-1001",
  "cancel_url": "https://shop.example/cart",
  "tx_id": "7c2d0b5e4f1a...",
  "tx_url": "https://tronscan.org/#/transaction/7c2d0b5e4f1a...",
  "from_address": "TPyjyZfsYaXStgz2NmAraF1uZcMtkgNan5",
  "amount_paid": "49.907423",
  "settled_manually": false,
  "locale": "en",
  "created_at": "2026-12-04T07:00:52.554Z",
  "expires_at": "2026-12-04T07:30:52.554Z",
  "paid_at": "2026-12-04T07:04:10.120Z",
  "deposit_mode": "amount",
  "amount_received": "49.907423",
  "sweep": null,
  "forwarder": null
}
Field Type Meaning
id string inv_ plus 22 random characters. Hard to guess, so the checkout URL can be shared
object string Always "invoice"
project_id string The project the invoice belongs to
status string pending, confirming, paid or expired
order_id string or null Your order id, as sent
amount string The price you asked for, normalized ("49.90" becomes "49.9")
amount_due string What the customer must send. Unique-amount mode: amount plus a small unique offset. Forwarder mode: equal to amount, plus the network fee when the customer pays it
network_fee object or null Forwarder mode with a fee: { "amount", "payer", "collector" }, see below. null in unique-amount mode and when no fee applies
amount_net string What the project wallet receives for this invoice: amount_paid (or amount_due before payment) minus the network fee. Equal to amount_paid or amount_due when network_fee is null. For accounting, never for the fulfilment check
currency string Token symbol, usually USDT
network string tron for mainnet, tron-nile or tron-shasta for testnets
token_contract string The TRC-20 contract being watched
pay_address string Where the customer pays: the project wallet (unique-amount mode) or the invoice's deposit address (forwarder mode)
checkout_url string The hosted checkout page
description string or null Shown to the customer
metadata object or null Your data, never shown to the customer
success_url, cancel_url string or null Redirect targets
tx_id, tx_url string or null The transaction that settled the invoice and its explorer link
from_address string or null The sender of that transaction
amount_paid string or null What was actually received once paid. Can differ from amount_due after a manual settlement or an overpayment
settled_manually boolean true when a person settled it from the dashboard (assigning a transfer, or Accept in forwarder mode)
locale string or null en, ar, or null for "use the browser's language"
created_at, expires_at, paid_at string or null ISO 8601 timestamps
deposit_mode string amount or forwarder
amount_received string Forwarder mode: the confirmed total sent to pay_address so far, which can be below (partial) or above (overpaid) amount_due. Unique-amount mode: mirrors amount_paid, or "0"
sweep object or null Forwarder mode only, see below
forwarder object or null Forwarder mode only, see below

Status flow: pending becomes confirming when a matching transfer appears on-chain, then paid once it is solidified (irreversible, usually under a minute). pending becomes expired at expires_at. A transfer sent before the deadline but seen after it still moves expired to paid.

sweep (forwarder mode)

null until anything was queued or swept. Then:

{
  "status": "swept",
  "tx_id": "a41c...",
  "tx_url": "https://tronscan.org/#/transaction/a41c...",
  "amount_swept": "48.4",
  "fee_paid": "1.5",
  "swept_at": "2026-12-04T07:06:30.000Z",
  "attempts": 0,
  "error": null
}

status is queued, broadcast (sent, waiting for the result), swept, failed or skipped. skipped is shown as held in the dashboard: a small balance below the automatic minimum, a balance that does not exceed the unpaid network fee, or a v1 address the gateway does not sweep; error says which. amount_swept is what reached the project wallet and fee_paid what reached the operator's fee collector ("0" or the full fee). tx_id is null when someone other than the gateway flushed the address. The sweep is for accounting. Never fulfil on it.

forwarder (forwarder mode)

{
  "factory": "TQx8...",
  "destination": "TJ4kA5wRUM9f3xLtBTrPdT5ri7Q2kbUhAF",
  "salt": "0x5f1e...",
  "version": 2,
  "collector": "TCo11ector...",
  "fee_token": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "fee_units": "1500000"
}
Field Meaning
factory, destination, salt The factory, the project wallet the address pays out to, and the salt derived from the invoice id
version Contract generation. 2 for current invoices; 1 for invoices created before sweep fees, which the gateway no longer sweeps (409 legacy_forwarder)
collector, fee_token, fee_units The fee terms bound into the address: the collector, the token the fee is taken in, and the fee in base units as the factory takes it. null, null and "0" for an address without a fee

With these values anyone can recompute pay_address and flush it, even without Qirsh: the funds can only reach destination, plus at most fee_units of fee_token to collector, once. Keep them with the order.

network_fee (forwarder mode)

{ "amount": "1.5", "payer": "merchant", "collector": "TCo11ector..." }

The fee the gateway operator charges for sweeping this invoice's deposit address, fixed when the invoice was created. With payer: "customer" it is included in amount_due and shown on the checkout. With payer: "merchant" the customer pays amount and the fee comes out of what the project wallet receives. It is charged once per invoice, however many payments arrive. See Network fees for the rules and worked examples.

For the fulfilment check, compare amount_paid ?? amount with your own price for the order. Do not compare with amount_due (it includes a customer-paid fee) or with amount_net (it excludes a merchant-paid fee).

Invoices

Create an invoice

POST /api/v1/invoices

Field Type Rules
amount string (or number) Required. A positive decimal with at most 6 decimals for USDT. Send a string
order_id string 1 to 128 characters, trimmed. Makes the call idempotent
description string Up to 500 characters. Shown on the checkout
metadata object Up to 4096 bytes as JSON. Never shown to the customer
success_url string http(s) URL, up to 2048 characters
cancel_url string http(s) URL, up to 2048 characters
ttl_minutes integer 5 to 1440. Default: the project's invoice lifetime, else INVOICE_TTL_MINUTES (30)
locale string en or ar
curl -X POST https://pay.example.com/api/v1/invoices \
  -H "Authorization: Bearer $QIRSH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":"49.90","order_id":"ORDER-1001","success_url":"https://shop.example/orders/ORDER-1001","cancel_url":"https://shop.example/cart"}'

Returns 201 with the new invoice. When order_id already has an invoice that is not expired and has the same amount, returns 200 with that invoice. A different amount gets 409 order_conflict. When the earlier invoice has expired, a new one is created.

List invoices

GET /api/v1/invoices

Query Meaning
status pending, confirming, paid or expired
sweep_status queued, broadcast, swept, failed or skipped
limit 1 to 200, default 50
before ISO 8601 datetime. Only invoices created before it, for paging

Newest first.

curl "https://pay.example.com/api/v1/invoices?status=paid&limit=20" \
  -H "Authorization: Bearer $QIRSH_API_KEY"
{ "object": "list", "data": [ { "id": "inv_Luonp2fQ0b8rR1cS9yZ5w08", "object": "invoice", "status": "paid" } ] }

To page, pass the created_at of the last invoice you got as before.

Get an invoice

GET /api/v1/invoices/:id

:id is an invoice id or your order_id. For an order_id you get the order's current invoice.

curl https://pay.example.com/api/v1/invoices/ORDER-1001 -H "Authorization: Bearer $QIRSH_API_KEY"

Returns the invoice, or 404 not_found.

Simulate a payment

POST /api/v1/invoices/:id/simulate-payment

Testing only. Marks the invoice paid with a fake transaction id (simtx_...) and sender T_SIMULATED_SENDER, and sends a real, signed invoice.paid webhook. Works only on testnet projects with Allow simulated payments enabled (or ALLOW_SIMULATION=true in single-store mode). Otherwise 403 simulation_disabled. On an invoice that is already paid: 409 invalid_state.

curl -X POST https://pay.example.com/api/v1/invoices/inv_Luonp2fQ0b8rR1cS9yZ5w08/simulate-payment \
  -H "Authorization: Bearer $QIRSH_API_KEY"

Returns the paid invoice. In forwarder mode no funds arrive, so nothing is swept.

Accept a forwarder payment

POST /api/v1/invoices/:id/accept

Body: { "force": true } (optional).

Settles a forwarder invoice with what its deposit address received. Use it for partial payments at expiry, late payments, or a second payment for an order that was already paid. It sends invoice.paid with settled_manually: true and amount_paid set to the amount received.

Without force, these cases answer 409 needs_confirmation with a message that lists what to check: "less than the invoice amount was received", "the payment was completed after the invoice expired", "this order was already paid through another invoice". Other refusals are 409 invalid_state: no deposit address, already paid, nothing received, or no confirmed transfer yet.

curl -X POST https://pay.example.com/api/v1/invoices/inv_Luonp2fQ0b8rR1cS9yZ5w08/accept \
  -H "Authorization: Bearer $QIRSH_API_KEY" -H "Content-Type: application/json" -d '{"force":true}'

Settling is normally a human decision taken in the dashboard. Stores rarely need this route.

Sweep now

POST /api/v1/invoices/:id/sweep

Body: { "force": true } (optional, dashboard admins only).

Queues a sweep of the invoice's deposit address to the project wallet. Returns the invoice with sweep.status queued (or unchanged if a sweep is already queued or in flight).

curl -X POST https://pay.example.com/api/v1/invoices/inv_Luonp2fQ0b8rR1cS9yZ5w08/sweep \
  -H "Authorization: Bearer $QIRSH_API_KEY"

List an invoice's sweep transactions

GET /api/v1/invoices/:id/sweeps

{
  "object": "list",
  "data": [
    {
      "tx_id": "a41c...",
      "tx_url": "https://tronscan.org/#/transaction/a41c...",
      "asset": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
      "reason": "paid",
      "status": "success",
      "amount_expected": "49900000",
      "amount_moved": "49900000",
      "fee_taken": "1500000",
      "fee_limit_trx": "50",
      "fee_trx": "12.3456",
      "energy_used": 118000,
      "error": null,
      "created_at": "2026-12-04T07:05:12.000Z",
      "resolved_at": "2026-12-04T07:06:30.000Z"
    }
  ]
}

asset is the token contract, or TRX. reason is paid (the payment that settled the invoice), stray (a partial, late or extra balance), manual (Sweep now) or recover (TRX or another token sent by mistake). status is signed, broadcast, success, failed or dropped. amount_expected, amount_moved and fee_taken are strings in base units (6 decimals for USDT). amount_moved is everything that left the address; fee_taken is the part of it that went to the fee collector ("0" when no fee was taken, null until the transaction is resolved). fee_trx and energy_used are null until the transaction is resolved.

Stats

GET /api/v1/stats

{
  "total_invoices": 120,
  "paid_count": 97,
  "paid_volume": "4821.53",
  "paid_last_24h": { "count": 6, "volume": "301.2" },
  "open_count": 3,
  "expired_count": 20,
  "conversion_rate": 0.8083333333333333,
  "currency": "USDT"
}

Volumes sum amount_paid (or amount_due where it is not set) of paid invoices.

Transfers

List transfers

GET /api/v1/transfers

The last 100 token transfers seen to the project's current wallet, plus any transfer that settled one of its invoices. ?unmatched=true returns only confirmed transfers that matched no invoice (wrong amount, too late, or a second payment).

curl "https://pay.example.com/api/v1/transfers?unmatched=true" -H "Authorization: Bearer $QIRSH_API_KEY"
{
  "object": "list",
  "data": [
    {
      "id": "5b9e...c1:TJ4kA5wRUM9f3xLtBTrPdT5ri7Q2kbUhAF:49900000",
      "tx_id": "5b9e...c1",
      "tx_url": "https://tronscan.org/#/transaction/5b9e...c1",
      "from_address": "TPyjyZfsYaXStgz2NmAraF1uZcMtkgNan5",
      "to_address": "TJ4kA5wRUM9f3xLtBTrPdT5ri7Q2kbUhAF",
      "amount": "49.9",
      "confirmed": true,
      "invoice_id": null,
      "block_time": "2026-12-04T07:03:41.000Z"
    }
  ]
}

Assign a transfer to an invoice

POST /api/v1/transfers/:id/assign

Body: { "invoice_id": "<invoice id or order_id>", "force": true } (force optional).

Settles a unique-amount invoice by hand with an unmatched, confirmed transfer, for example when a customer sent 49.9 instead of 49.907423. URL-encode the transfer id (it contains colons). The invoice becomes paid with settled_manually: true and amount_paid set to the transfer amount, and an invoice.paid webhook goes out.

Without force, an underpayment or a transfer sent outside the invoice's payment window answers 409 needs_confirmation. Other refusals are 409 invalid_state (transfer not confirmed, already assigned, invoice already paid, or a forwarder invoice, which uses Accept instead) and 404 not_found.

curl -X POST "https://pay.example.com/api/v1/transfers/5b9e...c1%3ATJ4kA5wRUM9f3xLtBTrPdT5ri7Q2kbUhAF%3A49900000/assign" \
  -H "Authorization: Bearer $QIRSH_API_KEY" -H "Content-Type: application/json" \
  -d '{"invoice_id":"ORDER-1001"}'

Returns the updated invoice.

Export

GET /api/v1/exports/invoices.csv

Optional ?status=. Up to 50,000 invoices, newest first, as text/csv with a dated file name. Columns:

id,order_id,status,amount,amount_due,amount_paid,currency,tx_id,from_address,description,created_at,paid_at,deposit_mode,pay_address,amount_received,sweep_status,sweep_tx_id,network_fee,network_fee_payer,amount_net

network_fee and network_fee_payer are empty when no fee applies.

Cells that start with =, +, -, @, a tab or a carriage return get a leading ', so spreadsheets don't run them as formulas.

Webhook log

List webhook events

GET /api/v1/webhooks

The project's last 50 events.

{
  "object": "list",
  "configured": true,
  "data": [
    {
      "id": "evt_8wKq0b1Lr2mN3pQ4sT5uV6",
      "invoice_id": "inv_Luonp2fQ0b8rR1cS9yZ5w08",
      "project_id": "prj_4mJ0c8vQx1Zr2bTn",
      "type": "invoice.paid",
      "status": "delivered",
      "attempts": 1,
      "next_attempt_at": "2026-12-04T07:04:10.150Z",
      "last_status_code": 200,
      "last_error": null,
      "created_at": "2026-12-04T07:04:10.150Z",
      "delivered_at": "2026-12-04T07:04:10.410Z"
    }
  ]
}

status is pending (waiting for its next attempt), delivered or failed (gave up). configured is false when the project has no webhook URL.

Retry an event

POST /api/v1/webhooks/:id/retry

Re-queues the event for delivery now, whatever its status. Returns { "ok": true }, or 404 not_found. The current webhook URL and secret are used.

Send a test event

POST /api/v1/webhooks/test

Sends a signed ping event to the project's webhook URL right away and reports the result. Nothing is stored or retried.

{ "ok": true, "status": 200, "error": null }

Without a webhook URL: { "ok": false, "status": null, "error": "No webhook URL configured." }.

Account

GET /api/v1/account

The project the key belongs to.

{
  "id": "prj_4mJ0c8vQx1Zr2bTn",
  "object": "project",
  "name": "Shop",
  "status": "active",
  "network": "mainnet",
  "pay_address": "TJ4kA5wRUM9f3xLtBTrPdT5ri7Q2kbUhAF",
  "token": { "contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "symbol": "USDT", "decimals": 6 },
  "webhook_url": "https://shop.example/webhooks/qirsh",
  "brand_color": "#007a3d",
  "invoice_ttl_minutes": 30,
  "simulation_enabled": false,
  "env_managed": false,
  "created_at": "2026-11-20T10:00:00.000Z",
  "deposit_mode": "amount",
  "forwarder_factory": null,
  "sweep_fee": "0",
  "sweep_fee_is_default": true,
  "sweep_fee_payer": "merchant",
  "fee_collector": null
}

sweep_fee is the network fee new forwarder invoices of this project get, sweep_fee_is_default is true while it follows the gateway's SWEEP_FEE_DEFAULT, and fee_collector is the operator's collector on this network. The fee is charged only while fee_collector is set and only in forwarder mode. The webhook secret and key hashes are never returned.

Public routes

These need no API key.

Method Path What it does
GET /pay/:id The hosted checkout (HTML). ?lang=en or ?lang=ar picks the language. Unknown ids get a 404 page
GET /pay/:id/status The invoice as the checkout sees it (JSON, below). Rate-limited to 120 per minute
GET /pay/:id/qr.svg QR code of pay_address
GET /health Watcher and sweeper health (below)
GET /admin The dashboard (sign-in page)
GET /assets/:file Static CSS, JS and images from public/
GET / The landing page when LANDING_PAGE=true (default), otherwise a redirect to /admin
GET /docs, /docs/:page This documentation, as HTML
GET /legal, /legal/terms, /legal/privacy, /legal/acceptable-use, /legal/disclaimer, /legal/cookies, /legal/payer-notice The operator's legal pages, when LEGAL_PAGES=true (default)

HTML pages are served with a strict Content Security Policy (no inline scripts, no third-party origins), X-Content-Type-Options: nosniff and Referrer-Policy: no-referrer.

GET /pay/:id/status

A subset that is safe to show the payer. It never includes metadata, order_id or project_id.

{
  "id": "inv_Luonp2fQ0b8rR1cS9yZ5w08",
  "status": "pending",
  "amount_due": "49.907423",
  "network_fee": null,
  "currency": "USDT",
  "network": "tron",
  "pay_address": "TJ4kA5wRUM9f3xLtBTrPdT5ri7Q2kbUhAF",
  "description": "2x Hoodie",
  "expires_at": "2026-12-04T07:30:52.554Z",
  "tx_id": null,
  "tx_url": null,
  "success_url": null,
  "cancel_url": "https://shop.example/cart",
  "deposit_mode": "amount",
  "amount_received": "0",
  "amount_detected": "0",
  "amount_remaining": "49.907423",
  "server_time": "2026-12-04T07:01:10.000Z"
}

success_url is only filled in once the invoice is paid. In forwarder mode amount_detected includes unconfirmed transfers and amount_remaining is what is still missing. network_fee is { "amount": "1.5" } only when the customer pays the fee (it is part of amount_due, and the checkout shows it as a separate line); otherwise null. The collector address is never shown to the payer.

GET /health

{
  "ok": true,
  "watcher": {
    "ok": true,
    "last_poll_at": "2026-12-04T07:01:05.000Z",
    "last_error": null,
    "catching_up": false,
    "deposits_unreconciled": 0
  },
  "sweeper": { "enabled": false, "ok": true, "queued": 0, "in_flight": 0, "failed": 0, "held": 0 }
}

Status 200 while the chain watcher works, 503 when polling has been failing for more than 5 poll intervals (at least 2 minutes). last_error says why. The HTTP status depends on the watcher only. In forwarder mode the sweeper counts show queued, in-flight, failed and held sweeps.

The dashboard API

/dashboard/api/* is the dashboard's own API. It uses the tg_session cookie from POST /dashboard/api/login, and every request that changes something must also send the header X-Qirsh-CSRF: 1 (else 403 csrf). It changes with the dashboard. Don't build store integrations on it. Use /api/v1 with an API key.

The routes below are documented because operators script them or meet their errors in the dashboard. Paths are relative to /dashboard/api. /admin/* routes answer 403 to members.

Password re-entry

Dangerous actions need the signed-in user to have re-entered their password in the last 5 minutes:

Action Route
Change a project's wallet POST /admin/projects/:pid/wallet
Change a project's network or deposit mode, or disable it PATCH /projects/:pid/settings or PATCH /admin/projects/:pid
Rotate the webhook secret POST /projects/:pid/webhook-secret/rotate
Revoke a project's last active API key DELETE /projects/:pid/keys/:kid
Change a user's role, or disable a user PATCH /admin/users/:uid
Reset a user's password POST /admin/users/:uid/reset-password

Without a fresh password these answer:

{ "error": { "code": "reauth_required", "message": "Confirm your password to continue." } }

with status 403. The dashboard then asks for the password and retries.

POST /me/reauth opens the window. It is rate-limited to 10 attempts a minute.

{ "password": "correct horse battery staple" }
{ "ok": true, "reauth_until": "2026-12-05T18:33:10.000Z", "window_seconds": 300 }

A wrong password answers 401 invalid_credentials and is written to the activity log. The window belongs to the session that opened it and ends at sign-out, session expiry or a password change.

GET /me/reauth tells whether the session is inside the window:

{ "fresh": true, "reauth_until": "2026-12-05T18:33:10.000Z" }

Change a project's wallet

POST /admin/projects/:pid/wallet (admins, fresh password)

{ "merchant_address": "TUEZSdKsoDHQMeZwihtdoBiN46zxhGWYdH", "confirm_suffix": "WYdH" }

confirm_suffix is the last 4 characters of the new address, typed by the admin. Only the public address is sent: when the dashboard generates the wallet, the phrase and the private key stay in the browser. The body takes no other fields.

{
  "project": { "id": "prj_4mJ0c8vQx1Zr2bTn", "object": "project", "pay_address": "TUEZSdKsoDHQMeZwihtdoBiN46zxhGWYdH" },
  "previous_address": "TQnuBBKVUiSA6bNfnJvqvmiX2K5U4LP3cn",
  "note": "New invoices pay the new wallet. Invoices created before this change still show the old address."
}

project is the full project object, shortened here. For a forwarder project the note says that invoices created before the change keep deposit addresses that can only sweep to the old wallet.

Status Code When
400 confirmation_mismatch confirm_suffix is not the last 4 characters of merchant_address
400 invalid_request Not a valid TRON address (the checksum is checked), or an unknown field
403 reauth_required No password re-entry in the last 5 minutes
409 unchanged The address is already the project's wallet
409 env_managed The single-store project: change MERCHANT_ADDRESS instead
409 wallet_in_use Another active project uses this wallet on the same network
409 wallet_is_fee_collector The address is the operator's fee collector
409 forwarder_requirements A forwarder project, and the new wallet fails a forwarder check (the failing checks are in error.checks)

The change is recorded in the activity log as project.wallet_changed.

Activity log

GET /admin/audit (admins) returns the whole log, newest first. Query: limit (1 to 500, default 100), project_id, and before (an ISO 8601 time, for paging).

{
  "object": "list",
  "data": [
    {
      "id": "aud_x2Lr9QpTn4Vb7KcM",
      "created_at": "2026-12-05T18:28:41.000Z",
      "actor": { "id": "usr_7hQ2mVx9Lb3Rk8Tn", "email": "[email protected]" },
      "project_id": "prj_4mJ0c8vQx1Zr2bTn",
      "action": "project.wallet_changed",
      "target": null,
      "old": "TQnuBBKVUiSA6bNfnJvqvmiX2K5U4LP3cn",
      "new": "TUEZSdKsoDHQMeZwihtdoBiN46zxhGWYdH",
      "ip": "203.0.113.7"
    }
  ]
}

GET /projects/:pid/audit returns one project's entries to its members and to admins. limit is 1 to 200, default 50. Members do not see ip.

action Recorded when
project.created A project is created (new is the network and wallet)
project.wallet_changed, project.network_changed, project.deposit_mode_changed, project.status_changed One of these settings changes
project.sweep_fee_changed, project.sweep_fee_payer_changed The project's network fee or its payer changes. The fee is in base units; null means it follows SWEEP_FEE_DEFAULT
project.webhook_secret_rotated The webhook secret is rotated (the secret itself is never recorded)
project.api_key_revoked An API key is revoked (target is the key id, old its prefix)
user.role_changed, user.disabled, user.enabled, user.password_reset A user is changed by an admin (target is their email)
auth.reauth_failed A wrong password on a password re-entry

The log never stores secrets. It refuses any value shaped like a private key, an API key or a webhook secret. Entries are kept until the operator deletes them from the database.

Network fee settings

PATCH /projects/:pid/settings and PATCH /admin/projects/:pid take sweep_fee (a decimal string, or null to follow SWEEP_FEE_DEFAULT) and sweep_fee_payer (merchant or customer) from admins. PUT /admin/settings with { "trx_usdt_rate": "0.28" } (or null) sets the TRX price used for the fee recommendation, and GET /admin/forwarder returns the fee wallet status and the per-project fee report. Examples are in Network fees.

Edit this page on GitHub