Overview#
Payitgo is a crypto payment gateway. Your server creates a payment priced in your own currency (US dollars, or any of 150+ others), your customer pays it in stablecoins or crypto on a checkout page, and Payitgo tells your server with a signed webhook (IPN) when the money has arrived and is final. The money is then sent to your own wallet, or kept in your Payitgo balance until you withdraw it.
- Your server creates a payment with
POST /v1/payments: your order id, the amount (in US dollars, or in any currency you name) and, if you like, the coin. Payitgo answers with a one-time deposit address, the exact crypto amount at a locked rate, and acheckout_url: the hosted checkout page. - You send the customer to
checkout_url, or show the amount, address and QR code on your own page. They have 15 minutes to pay once the coin is set (and an hour to choose a coin first). - The customer pays. The payment becomes
detectingas soon as the money is seen, andconfirmedonce the network has enough confirmations. - Payitgo notifies your server with a webhook at each step, signed with your webhook secret.
- Your server verifies the signature and, on
payment.confirmed, marks the order paid. - The money is settled, less Payitgo's service fee and the network fee: sent to your wallet within minutes (direct settlement, the default, with a
settlement.completedwebhook), or added to your balance (custody), which Payitgo can also pay out for you on a schedule (scheduled settlement).
Webhooks are Payitgo's IPN
X-Webhook-Signature header, an HMAC-SHA256 you check with that secret. Each mode has one webhook URL and one secret, and a payment can name its own webhook_url, a callback for that payment alone (Webhooks).| Key | Mode | Money | Webhook |
|---|---|---|---|
| Test key | Test | No coins: you simulate what the customer pays, nothing real moves | The test webhook URL and its own secret |
| Live key | Live | Real coins on mainnet | The live webhook URL and its own secret |
A key's text does not say its mode: the dashboard shows each key with a Test or Live badge, and the key object's livemode says it (Authentication). The API is the same in both: build and test with the test key, then swap in the live key and the live webhook secret. Nothing works until the owner confirms their email with the link sent at sign-up; then the account is in test mode, and the owner turns live mode on when ready. Customers can pay with USDT (Tron, Ethereum, BNB Smart Chain), USDC (Ethereum, BNB Smart Chain), DAI (Ethereum), TRX, ETH (Ethereum, BNB Smart Chain), BNB, BTC, LTC, DOGE and XRP, and SHIB and PEPE (Ethereum) once you turn them on, in both modes (Currencies).
Base URL
https://api.payitgo.co, as every example calls it; your own addresses (webhooks, success pages) are shown as yourdomain.com. Every library and the React widget call it by default, so you pass no address: their baseUrl (base_url, WithBaseURL) option is Payitgo's API, default https://api.payitgo.co. Every request and response is JSON; amounts are decimal strings such as "49.9".| I want to… | Read |
|---|---|
| Take my first test payment, end to end | Quickstart |
| Use a library (Node.js, Python, PHP, Go, Dart) | Libraries |
| Send my API key correctly, manage keys | Authentication |
| Know every field of a payment, every status, every error | Payments |
| Send customers to the hosted page | Checkout |
| Show the checkout in a modal in my React app | React checkout widget |
| Show the amount, address and QR code on my own page, in my own design | Your own payment page |
| Receive and verify IPN notifications | Webhooks |
| Know which coins and networks are supported | Currencies |
| Understand fees, minimums and where my money goes | Fees and settlement |
| Pay many recipients at once: payroll, prizes, withdrawals | Mass payouts |
| Keep my withdrawals in sync with every payout's outcome, and catch up on missed events | Staying in sync, Replay missed events |
| Test every scenario before going live | Test mode |
| Manage my team, settings, balances and payouts | Account and team |
| Handle errors, rate limits and retries | Errors and limits |
| Take crypto in a WooCommerce shop, with no code | WooCommerce plugin |
Quickstart#
Take one test payment from start to finish: get your keys, create a payment, send the customer to checkout, and handle the webhook. Everything runs in test mode: no coins move, and you simulate what the customer pays.
1. Get your keys and webhook secret#
When you open an account, Payitgo issues a test key and a live key, each 64 hex characters and shown only once: the test key is the one with "livemode": false (the dashboard shows a Test or Live badge next to each key). They work once you confirm your email with the link we send you (until then: 403 this account's email is not confirmed yet). Owners and developers can create more in Dashboard → Developers. Keep them on your server, and use the test key for now. Then read your test webhook's signing secret and tell Payitgo where to send notifications (a public https:// URL; on a laptop, use a tunnel such as ngrok):
export PAYITGO_BASE_URL=https://api.payitgo.co
export PAYITGO_KEY=4f9c2a7e1b8d3f6a0c5e9b2d7a4f1c8e3b6d9a2f5c8e1b4d7a0f3c6e9b2d5a8f # your test key
# Your test webhook and its signing secret: keep it as PAYITGO_WEBHOOK_SECRET
curl -s $PAYITGO_BASE_URL/v1/webhook -H "Authorization: Bearer $PAYITGO_KEY"
# Where notifications go
curl -s -X PUT $PAYITGO_BASE_URL/v1/webhook \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"url": "https://api.yourdomain.com/payitgo/ipn"}'
# A signed "ping" arrives within seconds
curl -s -X POST $PAYITGO_BASE_URL/v1/webhook/test -H "Authorization: Bearer $PAYITGO_KEY"2. Create a payment#
When your customer clicks “Pay with crypto”, your server creates a payment for the order. Without a token, the customer chooses the coin on the checkout page. Save id with your order. Sending the same order_id again while the payment is open returns that same payment (200), so a retried request never makes a second one.
curl -s https://api.payitgo.co/v1/payments \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"order_id": "ORD-1001", "amount": "19.99", "success_url": "https://yourdomain.com/thanks"}'{
"id": "c41e7a9d2b05f3e8a6d17c90",
"order_id": "ORD-1001",
"status": "pending",
"token": "",
"token_options": [
{ "token": "USDT_TRC20", "chain": "tron", "minimum": "6.44", "network_fee": "3.22", "fee_note": "Final in about a minute." },
{ "token": "USDT_BEP20", "chain": "bsc", "minimum": "1", "network_fee": "0.01", "fee_note": "Final in under a minute." }
],
"livemode": false,
"currency": "USD",
"amount": "19.99",
"amount_due": "19.99",
"expires_at": "2026-10-10T10:00:00.832Z",
"checkout_token": "b28d4f61e9a03c75d2e8f1a6",
"checkout_url": "https://payitgo.co/pay/b28d4f61e9a03c75d2e8f1a6",
"…": "…"
}3. Send the customer to checkout#
Redirect the customer to the payment's checkout_url, the hosted checkout: https://payitgo.co/pay/<checkout_token>. The page lets the customer choose a coin, shows the amount, address and QR code, counts down the 15 minutes and updates live. Prefer your own design? See your own payment page.
res.redirect(303, payment.checkout_url); // https://payitgo.co/pay/b28d4f61e9a03c75d2e8f1a6Pay it: simulate the customer
No coins move in test mode: you choose what the customer does. Open checkout_url yourself and choose a coin (or set it with POST /v1/payments/{id}/token), then simulate the customer paying in full:
curl -s -X POST $PAYITGO_BASE_URL/v1/payments/c41e7a9d2b05f3e8a6d17c90/simulate \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"outcome": "confirmed"}'200 OK with the payment, now with "simulation": {"outcome": "confirmed", "state": "running"}. A few seconds later the deposit arrives and the checkout page moves to detecting, then to confirmed, as it would for real coins. To start the simulation without calling again, create the payment with "simulate": "confirmed": it plays as soon as the coin is chosen. Partial payments, expiry, overpayment and the other outcomes: Test mode.
4. Handle the webhook#
Your URL receives payment.detecting (money seen, confirming), then payment.confirmed (final). In a simulation they come seconds apart; a live payment's come as fast as its network confirms (Currencies). Verify the signature on the raw body (v1 is the hex HMAC-SHA256 of t + "." + body, and t must be within 5 minutes), skip events whose id you already processed (a notification can arrive twice), mark the order paid on payment.confirmed, and answer 200 within 10 seconds. Anything else is retried for about a day and a half.
// express.raw keeps the body as bytes: register this route before express.json()
app.post("/payitgo/ipn", express.raw({ type: "application/json" }), async (req, res) => {
let event;
try {
event = payitgo.webhooks.constructEvent(req.body, req.get("X-Webhook-Signature"));
} catch {
return res.sendStatus(400); // not from Payitgo, or tampered with
}
if (!(await events.seen(event.id))) {
if (event.type === "payment.confirmed") {
await orders.markPaid(event.data.order_id); // idempotent
}
await events.remember(event.id);
}
res.sendStatus(200);
});5. Go live#
- The account owner goes live in the dashboard, under Developers › Go live: confirm their email (the link Payitgo emailed them at signup), add a live payout address, see a test payment through, then press Go live. Until then the live key gets
403. - With the live key, read the live webhook's secret (
GET /v1/webhook) and set its URL (PUT /v1/webhook). Test and live have separate URLs and secrets. - Deploy the live key and the live webhook secret, and act only on events with
"livemode": truein production. Remove anysimulatefrom your payment requests: a live key refuses it. - Add a live payout address for each coin you accept, so payments reach your wallet as they are. A coin you have none for is converted into one you have, which costs more. Your first live address of a coin is used at once; another, or a changed one, 24 hours after it is set.
- Make one small real payment end to end.
Authentication#
Your server authenticates every /v1 request with a secret API key. The key also decides the mode: there is no mode parameter.
API keys#
Send the key on every /v1 request, in either header (when both are present, X-API-Key wins):
Authorization: Bearer 4f9c2a7e1b8d3f6a0c5e9b2d7a4f1c8e3b6d9a2f5c8e1b4d7a0f3c6e9b2d5a8f
X-API-Key: 4f9c2a7e1b8d3f6a0c5e9b2d7a4f1c8e3b6d9a2f5c8e1b4d7a0f3c6e9b2d5a8fA key is 64 hex characters. Treat it as an opaque string: it does not say its mode. Your first test key and live key are issued at signup and shown once. Owners and developers create more, and revoke old ones, in Dashboard → Developers. To copy a key again, use its copy button there. A key that makes payouts is the exception: only an owner can copy it, with their password and a two-factor code. Keys made before 23 October 2026 can't be copied: create a new one. To rotate, create the new key, deploy it, then revoke the old one.
Keep keys on your server
payouts on can also pay recipients from your payout wallet: turn it on only for the key of the server that makes payouts, and limit that key to your servers' IP addresses. The checkout routes your customers' browsers call need no key.Test keys and live keys#
| Key | Mode | What it does |
|---|---|---|
| Test key | Test | Test payments, paid by the outcomes you simulate (no coins, no real money), the test webhook and its signing secret |
| Live key | Live | Real payments on mainnet, the live webhook and its signing secret |
You choose the mode when you create a key, and the dashboard shows it as a Test or Live badge next to the key; the key object's livemode is the only way to tell them apart. To ask Payitgo which mode a key is in, call GET /v1/webhook with it: the answer's livemode is the key's mode (the libraries' isLive()).
A test key gets 404 for a live payment, and the other way round. Every payment and every webhook carries "livemode": true or false, so your code can always tell which mode it is looking at.
Read-only keys#
A key created with read access ("access": "read") can only read: GET /v1/payments, GET /v1/payments/{id}, GET /v1/tokens, GET /v1/webhook, GET /v1/events, and the mass payouts' batches, payments and payout wallet (GET /v1/payout-batches/{id}, GET /v1/payouts… including the list of payout requests, GET /v1/payout-wallets). Anything else answers 403 this api key is read-only: it can only read (GET). Give one to a service that reports on payments (an accounting export, a mobile app's order history) and should never create them.
Storefront keys#
Every key belongs to a store. Your main store is your account itself, named after your business: its keys see every payment and manage the webhook. A key of another store (one of your other shops) works like any other key, except that:
- every payment it creates carries the store's
store_id, and it only sees its own store's payments; - its order ids are its own: it creates and finds its own store's orders only (a main store key, the main store's), so two shops on one account can both number their orders from 1;
- it can read the webhook and send a test, but cannot change the account's webhook URL (
403): a store with its own backend setswebhook_urlon each payment instead.
Payout keys#
A key can pay your recipients from your payout wallet (mass payouts) only once the account owner turns payouts on for it. Every key starts with it off. Without it, a key still reads batches, payments and the payout wallet, but taking, sending or removing payout requests, quoting payments and a test top-up answer 403 this api key cannot make payouts: turn payouts on for it in the dashboard. With the payout setting Only IP-limited API keys pay out on (Pay people › Settings), a payout key must also be limited to IP addresses (below), or it gets 403 your payout rules require keys limited to IP addresses: set this key's allowed IPs. A payout key can send the wallet's money to a batch's recipients only: never anywhere else, and it never approves a batch.
The owner turns payouts on for a key in Developers › API keys, confirming with their password and a two-factor code. An owner or developer can turn it off there at any time. Each change applies to the key's next request and lands in your activity log.
Allowed IP addresses#
A key can be limited to your servers' addresses: its allowed_ips, up to 20 IP addresses or CIDR ranges (203.0.113.7, 198.51.100.0/24, IPv6 too). Such a key is refused from any other address, on every /v1 route, with 403 this api key is not accepted from 192.0.2.44: add it to the key's allowed IPs (the address Payitgo saw the request come from). A key with no allowed_ips is accepted from anywhere. Owners and developers set a key's allowed IPs in Developers › API keys. They are only ever changed in the dashboard, so a leaked key can never lift its own limits.
Live mode#
A new account starts in test mode. Until the account owner goes live in the dashboard (Developers › Go live: confirm their email, add a live payout address, see a test payment through, then Go live), every request with the live key is refused with 403 live mode is off for this account: …. Without a confirmed email, going live answers 403 confirm your email first: …. Pausing live payments (Settings › Security) refuses the live key again and stops new live payments; payments already open still complete.
API key errors#
| Status | Error | Cause |
|---|---|---|
| 401 | missing api key | Neither header was sent |
| 401 | invalid api key | Unknown, mistyped or revoked key |
| 403 | live mode is off for this account: … | A live key before the owner went live, or while live payments are paused |
| 403 | merchant account is suspended | Payitgo suspended the account |
| 403 | this api key is read-only: it can only read (GET) | A read-only key used to create or change something |
| 403 | this api key is not accepted from 192.0.2.44: … | The key has allowed_ips, and the request came from another address |
| 403 | this api key cannot make payouts: … | A mass payout write with a key whose payouts is off |
| 403 | your payout rules require keys limited to IP addresses: … | A mass payout write with a key without allowed_ips, while Only IP-limited API keys pay out is on |
| 429 | rate limit exceeded | Too many requests with one key in a short time (limits) |
Payments#
A payment is one request for money from one customer: an amount in your currency (US dollars, or any of 150+ others), the coin they pay with, and a deposit address only this payment uses. Every figure on it is in the currency you priced it in. Your server creates it with your secret key and learns the outcome from webhooks.
| Method | Path | What it does |
|---|---|---|
| POST | /v1/payments | Create a payment (or get back the open payment of the same order) |
| POST | /v1/payments/{id}/token | Set the coin of a payment created without one, or change it before it is paid |
| POST | /v1/payments/{id}/simulate | Test mode: play an outcome on a test payment |
| GET | /v1/payments/{id} | Read one payment, by payment id or by your order id |
| GET | /v1/payments | List payments, newest first |
| GET | /v1/tokens | The coins your customers can pay with, with today's fees and minimums |
Create a payment#
POST/v1/payments· API key
With a token, the payment gets its deposit address, locked rate and 15-minute deadline at once. Without one, the customer chooses the coin first (see below). Send Content-Type: application/json: a body of another type is refused (invalid request body), and a form is not read. Amounts are accepted as numbers or decimal strings, and always returned as decimal strings ("49.9"): parse them with a decimal type, not a float.
| Field | Type | Description |
|---|---|---|
order_id | string, required | Your id for the order, 1 to 128 bytes. An order has at most one open payment per mode and per store |
amount | number or decimal string, required | The price, more than 0, such as "49.90", in currency. It must reach the token's minimum |
currency | string, default USD | The ISO 4217 code of the currency the price is in, such as EUR, GBP or NGN; case does not matter (your currency) |
token | string | The coin, such as USDT_TRC20 (case does not matter). Leave it out to let the customer choose |
tokens | array of strings | Without token: the coins to offer. Default: every coin you accept whose minimum the amount reaches |
description | string | What the customer is paying for, up to 500 bytes. Shown on the hosted checkout |
metadata | object | Your own data: up to 20 keys (40 bytes), string values only (500 bytes) |
customer_email | string | The customer's email address. Payments are filed under a customer per email; a blocked customer gets 403 |
success_url | string | http(s) URL the hosted checkout links to once the payment is confirmed |
cancel_url | string | http(s) URL the hosted checkout links back to if the payment closes unpaid |
webhook_url | string | https:// URL on a public host: this payment's notifications go there instead of your account's webhook URL |
simulate | string | Test keys only: the outcome the payment plays, such as confirmed (outcomes). With token (or for expired) it starts at once; without, when the coin is chosen. wrong_asset needs token. A live key gets 400 |
curl -s https://api.payitgo.co/v1/payments \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{
"order_id": "ORD-1001",
"amount": "49.90",
"token": "USDT_TRC20",
"description": "2 x Acme T-shirt",
"metadata": {"customer_id": "cus_42"},
"customer_email": "[email protected]",
"success_url": "https://yourdomain.com/thanks",
"cancel_url": "https://yourdomain.com/cart"
}'201 Created with the payment. While an order has an open payment (pending, partially_paid or detecting), creating it again returns that payment with 200 and ignores the other fields, so a request that timed out can simply be sent again. Once the payment is closed, the same order_id creates a new one. Order ids are unique per store: two shops can both send "order_id": "1234" and get two payments, as long as each uses its own store's key. The payment's main fields:
| Field | Meaning |
|---|---|
id | Payitgo's id: 24 hex characters. Treat it as an opaque string |
status | Where the payment is in its lifecycle |
crypto_amount | What the customer must send, in token: amount_due ÷ rate_locked, rounded up |
token, chain | The coin and its network: tron, ethereum, bsc, bitcoin, litecoin, dogecoin or xrp ("" until chosen) |
token_name, network | The coin and its network for people: "Tether", "Tron (TRC-20)". Absent until a coin is chosen |
token_ticker, token_icon_url | What people call the coin ("USDT") and its icon, an SVG image (names and icons). Absent until a coin is chosen |
deposit_address | Where to send it, used by this payment only (except on XRP, see destination_tag) |
destination_tag | XRP only: the tag the customer must include |
qr_payload | What to encode in a QR code: the deposit address alone (QR codes). "" until a coin is chosen |
expires_at | The deadline: 15 minutes after the coin was set. Created without a coin, the customer has 1 hour to choose one, then 15 minutes to pay |
currency | What the payment is priced in, upper case: the code you sent, USD when you sent none, or the coin of a payment link priced in a coin (ETH). Every figure below is in it |
amount, amount_due | Your price, and what the customer pays (more when you pass the fees on) |
amount_extra | Optional: what of amount_due the customer pays only to reach the exchange's minimum (a payment too small for its coin's conversion, the fees passed on): you receive it |
fees_paid_by_customer | Whether the customer pays the service and network fees on top of your price (passing fees on) |
crypto_received, amount_received | What has arrived so far, in the coin and in currency |
deposits | Every transfer to the payment, oldest first, with tx_id, token (and its ticker and icon_url), amount (in the coin), value (in currency), confirmations, the sender address (from) and explorer_url. A simulated deposit has "simulated": true and no explorer_url: its tx_id looks like a transaction hash but is on no chain |
deposits[].counted | Whether it counts toward the payment: always for the payment's own token; another asset only with accept other assets on |
deposits[].status | pending (confirming), confirmed (final; settled to you) or failed (never became final; nothing settled) |
deposits[].late | true when it arrived after the payment had closed (late payments) |
deposits[].failed_at, fail_reason | When and why it failed: transaction not found on chain, or confirmation timeout |
confirmations, confirmations_required | The latest deposit's confirmations when last checked (0 before any), and how many make a deposit final on the payment's network |
rate_locked | The price of one token in currency, locked when the coin was chosen. "1" for a stablecoin on a payment in dollars |
checkout_token, checkout_url | The public key to the payer's view, and the hosted checkout page |
overpaid, paid_late | Set when more than 1% too much arrived, or when the payment completed late |
settlement | Where the money goes once final: direct (your payout address), custodial (your balance) or scheduled (your balance, paid out on a schedule). Your account setting when the payment was created (fees and settlement) |
store_id, customer_id, channel | The store whose key created it; the customer its customer_email is filed under; where the customer paid from: mobile or desktop (the hosted checkout), api (without opening it), "" until then |
livemode | false for a test payment (no coins: paid by the outcome you simulate), true for a real one |
simulation | A test payment's simulation, once one is asked for: outcome and state (requested, waiting for the coin; running; done) |
For a BTC or ETH payment, read the money from amount_due, amount_received and each deposit's value, all in the payment's currency; rate_locked is the price of one coin in it. Settlements and payouts carry dollar values (values of coin amounts).
Every error is {"error": "…"}. The ones you are most likely to meet, besides the key errors and 429:
| Status | Error | Cause |
|---|---|---|
| 400 | invalid request body | Not JSON, a Content-Type other than application/json, or a field of the wrong type (an amount that is not a number, a metadata value that is not a string) |
| 400 | order_id is required | Missing order_id, or the body sent as a form (curl -d without -H 'Content-Type: application/json') |
| 400 | order_id is too long | More than 128 bytes |
| 400 | amount must be > 0 | Zero, negative or missing amount |
| 400 | currency must be the ISO 4217 code of a currency (USD, EUR, GBP, NGN…) | Not a currency in use, such as BTC or EURO |
| 400 | amount is worth less than a cent | An amount in another currency worth less than $0.01 |
| 400 | unsupported token in test mode | A token (or an entry of tokens) not offered in the key's mode |
| 400 | not enabled for your account: BTC (turn tokens on in your payment settings) | A token you have not enabled |
| 400 | BTC cannot be paid in right now: choose another token | With token: payments on its network are paused for now. Without token, its coins are left out of the offer |
| 400 | minimum payment in USDT_TRC20 is $6.44 right now (network fees) | With token: amount is under the token's current minimum. The minimum is stated in your currency: "4.50 EUR" for a payment priced in euros |
| 400 | amount is below the minimum of every token on offer | Without token: no coin on offer accepts so small an amount |
| 400 | none of the tokens on offer is available in test mode | Without token: none of tokens is offered in the key's mode |
| 400 | description is too long | More than 500 bytes |
| 400 | metadata key or value is too long | A key over 40 bytes or a value over 500 |
| 400 | metadata may hold at most 20 keys | More than 20 keys |
| 400 | invalid customer_email | Not an email address |
| 400 | webhook_url: url must use https | Also: not absolute, not a public host, one of Payitgo's own hosts, or a host that does not resolve. success_url and cancel_url must be http(s) URLs |
| 403 | this customer is blocked from paying the merchant | You blocked the customer with this customer_email |
| 500 | payment creation failed | On Payitgo's side: retry with the same order_id, it is safe |
| 503 | exchange rate unavailable for currency: try again shortly | No exchange rate for the currency right now. Nothing was created: retry shortly with the same order_id |
And simulate can be refused:
| Status | Error | Cause |
|---|---|---|
| 400 | only test payments can be simulated: use a test key | simulate with a live key |
| 400 | simulate must be one of: confirmed, overpaid, … | An unknown simulate outcome |
| 400 | simulate wrong_asset needs the payment's coin: pass token | "simulate": "wrong_asset" without token |
| 400 | a BTC address only receives BTC: wrong_asset needs a coin on Tron, Ethereum or BNB Smart Chain | wrong_asset with a coin that has no other on its network |
Your currency#
amount is the price in currency: USD when you send none, or any ISO 4217 code such as EUR, GBP or NGN (case does not matter). The currency is how you state the price and how the payment reports back to you: the customer always pays in crypto, and Payitgo works out the coin amount from your price.
curl -s https://api.payitgo.co/v1/payments \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"order_id": "ORD-1004", "amount": "45.50", "currency": "EUR", "token": "USDT_TRC20"}'{
"currency": "EUR",
"amount": "45.5",
"amount_due": "45.5",
"amount_received": "0",
"rate_locked": "0.9243",
"crypto_amount": "49.23",
"token": "USDT_TRC20"
}- Every figure is in your currency.
amount,amount_due,amount_received,amount_extra, each deposit'svalue,rate_lockedand each of thetoken_options(minimum,network_fee,amount_due) are incurrency, on the payment, in its webhooks and on the checkout. A page can show “€45.50” and the coin amount, with nothing to convert. - Fixed at creation. The coin amount is worked out at the exchange rate of the moment; the payment does not follow the currency afterwards, and a retry for an order with an open payment returns it unchanged. A fiat figure has two decimals.
- The minimums are quoted in your currency too, and so is a refusal:
400 minimum payment in BTC is 4.50 EUR right now (network fees). - The rates come from two market data sources (the second when the first does not answer), refreshed every 10 minutes. When neither answers, a rate up to 6 hours old is used; with none at all, the request fails with
503 exchange rate unavailable for currency: try again shortlyand nothing is created.
Other errors, all 400: amount must be > 0, currency must be the ISO 4217 code of a currency (USD, EUR, GBP, NGN…) and amount is worth less than a cent. Your balances, ledger, analytics and settlements stay in dollars, the unit everything in Payitgo is reckoned in.
QR codes#
qr_payload is the deposit address alone, on every network: the same as deposit_address. Show it as a QR code next to the address and the amount.
It carries no amount, token contract or XRP destination tag, on purpose: exchange apps, where many customers pay from, reject payment URIs (ethereum:…, bitcoin:…, xrpl:…) as a malformed address. The customer types the amount, and for XRP the tag, so show both as text with copy buttons.
Let the customer choose the coin#
Create the payment with only order_id and amount. It comes back with "token": "", no address, an expires_at one hour away, and token_options: the coins on offer, each a TokenInfo with its name, network, ticker and icon_url for showing it, minimum, network_fee (and network_fee_bps for a coin that is converted), fee_note and, when you pass fees on, amount_due (what the customer pays in it, everything included) and, for a coin the payment is too small to convert, amount_extra (what of it only reaches the exchange's minimum: yours), every figure in the payment's currency. The hosted checkout shows them. On your own page, set the customer's choice:
POST/v1/payments/{id}/token· API key
curl -s https://api.payitgo.co/v1/payments/c41e7a9d2b05f3e8a6d17c90/token \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"token": "USDT_TRC20"}'{id} is the payment id or your order_id, and token one of the payment's token_options[].token. The answer is the whole payment, now with its address, locked rate, amount, QR payload and a deadline 15 minutes away.
Changing the coin. A customer who picked a coin can pick another before paying: send another of its token_options the same way, by your server or on the hosted checkout. The payment gets a new address (or XRP tag), amount and locked rate, and a new deadline 15 minutes away. token_options is on the payment exactly while this is possible: it was created without a token (a coin you set stays), it is pending, nothing has arrived and its deadline has not passed, the coin was changed fewer than three times, and a test payment's simulation is not running. Sending the coin it already has changes nothing.
Every address a payment was given stays watched as long as its own, so a deposit there still counts. When the first deposit arrives at a previous coin's address, in that coin, the payment is that coin again, on the terms it was chosen on; a later deposit there is credited in that coin at its locked rate. The coins chosen before are in previous_coins, and each deposit's to says which address it was sent to.
| Status | Error | Cause |
|---|---|---|
| 400 | token is required | No token in the body, or the body is not JSON |
| 400 | token is not one of this payment's options | A coin not in token_options |
| 400 | minimum payment in … is $… right now (it is converted on its way to the merchant, and the exchange takes no less) | The coin needs a bigger payment than this one (converted through the exchange, and you pay the fees or hide such coins): offer the other coins |
| 400 | this payment can no longer be paid | The payment is no longer pending (paid, expired), or its deadline has passed |
| 404 | payment not found | No such payment for your key's mode (or, for a storefront's key, for its store) |
| 409 | the coin for this payment can no longer be changed | The payment was created with its coin, something arrived, a test payment's simulation runs, or the coin was changed three times already |
Retrieve and list payments#
GET/v1/payments/{id}· API key
GET/v1/payments· API key
Retrieve takes the payment's id or your order_id (the payment id is tried first): by order id you get the order's open payment of the key's store, or of the main store for a main store key (a closed one is found by its payment id; otherwise 404). List filters by status (one, or several separated by commas), token, chain, store_id, customer_id, link_id, q (search), from and to, and pages with limit (1 to 200, default 50) and offset; it returns payments, total, limit and offset. from and to take RFC 3339 times or YYYY-MM-DD dates (to excluded); q matches a payment id, order id, transaction hash or deposit address exactly, or part of the customer email or description. An unknown status, token or chain matches nothing. A storefront key only sees its own store's payments. Listed payments leave out token_options - retrieve a payment for the coins it offers.
# One payment, by payment id or by your order id (the order's open payment)
curl -s https://api.payitgo.co/v1/payments/8f3a2c1e9b7d4a6f05e1c2d3 -H "Authorization: Bearer $PAYITGO_KEY"
curl -s https://api.payitgo.co/v1/payments/ORD-1001 -H "Authorization: Bearer $PAYITGO_KEY"
# A page of payments, newest first
curl -s 'https://api.payitgo.co/v1/payments?status=confirmed&limit=50&offset=0' -H "Authorization: Bearer $PAYITGO_KEY"Webhooks tell you about every change, so you rarely need to poll. When you do, fetch the payment from your server and trust it over the browser.
List tokens#
GET/v1/tokens?amount=40¤cy=EUR· API key
The coins your customers can pay with in the key's mode, with each one's network fee and minimum right now. With amount, only the coins a payment of that amount would offer; with currency, every figure is in that currency (US dollars without one). Use it to show coins before you create a payment, then create it with the customer's choice as token. Libraries: tokens.list(). The answer is {"currency": "EUR", "tokens": […]}; each entry (a TokenInfo, also the shape of a payment's token_options, then in the payment's currency) has:
| Field | Meaning |
|---|---|
token, chain | The token symbol to use in token and tokens, and its network |
name, network | For people: "USD Coin", "Ethereum (ERC-20)" |
ticker, icon_url | What people call the coin ("USDC") and its icon, an SVG image (names and icons) |
confirmations | How many confirmations make a deposit in it final |
minimum | The smallest amount accepted in it right now |
network_fee, network_fee_bps | The network fee right now: its fixed part, and for a coin that is converted, the share of the payment added on top (180: 1.8%) |
amount_due, amount_extra | With an amount (in token_options, or ?amount=) and the fees passed on: what the customer pays in this coin, and what of it only reaches the exchange's minimum (yours) |
fee_note | A short line for the customer about fees and timing |
Fees and minimums are quoted for where a payment in the coin will really settle. A coin that is converted (into one of your payout coins, or bought by Payitgo for your balance) also has network_fee_bps, the share of the payment converting adds on top of network_fee (fees).
Simulate a test payment#
POST/v1/payments/{id}/simulate· API key (test keys only)
A test payment moves no coins. Choose what happens to it instead: Payitgo plays the deposits, status changes and webhooks a few seconds apart, through the same processing as live coins. {id} is the payment id or your order_id; the body is {"outcome": …}, one of confirmed, overpaid, partially_paid, underpaid, expired, failed, wrong_asset, paid_late or paid_twice (what each does).
curl -s -X POST https://api.payitgo.co/v1/payments/c41e7a9d2b05f3e8a6d17c90/simulate \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"outcome": "partially_paid"}'200 OK with the payment, its simulation started:
{
"id": "c41e7a9d2b05f3e8a6d17c90",
"order_id": "ORD-1002",
"status": "pending",
"token": "USDT_TRC20",
"livemode": false,
"simulation": { "outcome": "partially_paid", "state": "running" },
"…": "…"
}The payment must be pending or partially_paid, and have its coin (except for expired). One simulation runs at a time; once it is done, you can run another (confirmed after partially_paid, to pay the rest). To choose the outcome when you create the payment, pass simulate to POST /v1/payments.
| Status | Error | Cause |
|---|---|---|
| 400 | outcome is required | No outcome in the body, or the body is not JSON |
| 400 | simulate must be one of: confirmed, overpaid, … | An unknown outcome |
| 400 | only test payments can be simulated: use a test key | A live key |
| 400 | choose the payment's coin first | No coin yet, for anything but expired |
| 400 | this payment is confirmed: only a pending or partially paid payment can be simulated | The payment is closed or confirming |
| 400 | a BTC address only receives BTC: wrong_asset needs a coin on Tron, Ethereum or BNB Smart Chain | wrong_asset on a coin that has no other on its network |
| 404 | payment not found | No such payment for your key's mode (or, for a storefront's key, for its store) |
| 409 | a simulation is already running for this payment | Wait for its done |
Lifecycle and statuses#
pending ─────────────────────────┐
│ ▼
├──▶ partially_paid ──▶ detecting ──▶ confirmed
│ │ │
▼ ▼ ▼
expired underpaid failed
│ │
└────┬─────┘
▼ the rest arrives within 24 hours
detecting ──▶ confirmed ("paid_late": true)| Status | Meaning | Webhook | What you do |
|---|---|---|---|
pending | Created; waiting for a coin (if not set) and the money | none | Send the customer to pay |
partially_paid | Part of the amount arrived; there is still time for the rest | payment.partially_paid | Optionally tell the customer |
detecting | Enough arrived; waiting for confirmations | payment.detecting | Show "confirming". Do not ship yet |
confirmed | Final. The money is yours | payment.confirmed | Fulfil the order |
expired | The deadline passed and nothing counted arrived | payment.expired | Cancel, or create a new payment |
underpaid | The deadline passed with part of the amount; what arrived is settled to you | payment.underpaid | Refund, or agree on the rest |
failed | Funds were seen but never became final | payment.failed | Treat as unpaid |
A payment in detecting never expires; it becomes failed if a deposit is not found on chain within 6 hours or not confirmed within 48. Only confirmed means you have been paid: never fulfil from detecting, from a customer landing on your success_url, or from anything the browser says.
Wrong amounts#
- Too little. The payment becomes
partially_paidand the checkout asks for the rest. If it arrives beforeexpires_at, the payment goes on toconfirmed; if not, it becomesunderpaid, and what arrived is still settled to you. - A little too little. A shortfall within your underpayment tolerance (0.5% by default, 0 to 20%, set by the owner) still counts as paid, so a wallet that rounds does not leave the customer stuck.
- Too much. The payment confirms with
"overpaid": true(more than 1% over) and all of it is settled to you. Refund the difference from your own wallet if you wish: the sender is in the deposit'sfrom.
Wrong asset#
A payment's address only receives coins of its own network, but customers do send another token on the same chain (USDC or ETH to a USDT on Ethereum payment, TRX to a USDT on Tron one) or use the other EVM chain (the address is the same on Ethereum and BNB Smart Chain). Each such deposit raises payment.wrong_asset.
| Accept other assets | The deposit | The payment |
|---|---|---|
| Off (default) | Not counted; settled to you in the asset that arrived | Keeps waiting for the coin it asked for |
| On | Counted at its value in the payment's currency (stablecoins at $1, others at the market price when it arrives), if you accept that token | Completes when amount_due is reached |
Either way the money is yours to keep or refund. It is settled like any payment in the coin that arrived: with direct settlement, to your payout address for that coin, or converted into one of your payout coins when you have none for it.
Late payments#
A payment's address is watched for 24 hours after it expires, falls short or confirms. A deposit in that time is marked "late": true, settled to you once final, and reported with payment.late_deposit. If it completes an expired or underpaid payment, the payment moves on to detecting and confirmed with "paid_late": true. A late deposit that is still not enough makes the payment underpaid. A deposit after a payment confirmed (a customer paying twice) marks it overpaid.
What a late deposit is worth. A deposit whose transaction was made after expires_at counts at rate_locked or at the coin's price when it arrives, whichever is lower: the locked rate is no free option on the coin for the day after. A customer who waits for the price to fall pays at the fallen price, and the payment comes up short (underpaid) unless they send the difference. A transaction sent in time but mined after the deadline still gets the locked rate: its block time counts, with about two blocks of grace (Bitcoin 1 hour, Litecoin 15 minutes, Dogecoin 10 minutes, other networks 5 minutes). Stablecoins are always worth $1, and a test payment's simulated deposits always count at rate_locked.
XRP#
XRP payments share one deposit address and are told apart by destination_tag. The customer must include the tag: a transfer without it cannot be matched to the payment and needs Payitgo's support to recover. The hosted checkout shows the tag next to the address; qr_payload does not carry it, so the customer types it in.
Checkout#
Your customer needs to see where to pay, how much, and whether it worked. Send them to the hosted checkout page, or show it all on your own page: the payment your server creates already carries everything the page needs.
Hosted checkout#
Every payment has a checkout_token, and carries its hosted checkout as checkout_url: https://payitgo.co/pay/<checkout_token>. Redirect the customer there, open it in a new tab, or put it in an email. The page:
- greets the customer with your business name and logo;
- lists the coins on offer when you created the payment without a
token, and lets the customer choose one; - shows the exact amount, the network, the deposit address with a QR code and a copy button, the XRP destination tag where there is one, and a countdown to
expires_at, and, for a payment priced in another currency, that price (“€45.50”) next to the dollars; - updates live through
partially_paid,detectingandconfirmed, and shows a “Test payment” banner in test mode; - offers a button to your
success_urlonce confirmed, or a link back to yourcancel_urlwhen the payment closes unpaid.
payment.confirmed webhook, never from a customer landing on success_url.In an email or a chat, checkout_url works anywhere, but mind the deadlines: a payment created with a coin gives the customer 15 minutes, one created without a coin an hour to choose and then 15 minutes. Create the payment when the customer is ready to pay, not when the invoice is drafted.
Your own payment page#
The response of payments.create (or payments.selectToken, when the customer picks the coin on your page) holds everything to render in your own design. Keep your secret key on your server; the page follows progress live with the socket.
| Show | From | Notes |
|---|---|---|
| The exact amount | crypto_amount + token | Must arrive in full: the customer's wallet or exchange fee comes on top |
| The network | network | e.g. "Tron (TRC-20)" (names below). Show it prominently, next to the amount: the same coin exists on several networks |
| The address | deposit_address | With a copy button. One address per payment |
| A QR code | qr_payload | The deposit address alone, so exchange apps accept it; the customer types the amount |
| The destination tag | destination_tag | XRP only, and required: show it as clearly as the address, with a copy button (the QR code does not carry it) |
| The deadline | expires_at | 15 minutes from when the coin was set; the rate is locked until then |
| What is missing | crypto_amount − crypto_received | Only while partially_paid |
| A fee note | network_fee_note | Optional, one line about the network |
| The price and what is due | amount, amount_due + currency | In your currency: show them (“€45.50”) next to the coin amount. For reference only: the customer still sends crypto_amount |
Network names, as network (on the payment and on each of its token_options) gives them: a token is named by its chain and standard, a chain's own coin by the chain alone.
| chain | A token on it | The chain's own coin |
|---|---|---|
tron | Tron (TRC-20): USDT_TRC20 | Tron: TRX |
ethereum | Ethereum (ERC-20): USDT_ERC20, USDC_ERC20, DAI_ERC20, SHIB_ERC20, PEPE_ERC20 | Ethereum: ETH |
bsc | BNB Smart Chain (BEP-20): USDT_BEP20, USDC_BEP20, ETH_BEP20 | BNB Smart Chain: BNB |
bitcoin, litecoin, dogecoin | Bitcoin, Litecoin, Dogecoin: BTC, LTC, DOGE | |
xrp | XRP Ledger: XRP |
Keep the socket open after the countdown ends: money that arrives up to 24 hours after expires_at can still complete the payment, and the socket then sends payment.detecting and payment.confirmed. While a deposit confirms, show confirmations of confirmations_required (“7 of 20”).
Test payments
"livemode": false) show a “test payment” notice. Nothing watches a test payment's address, so real coins sent to it are never seen: the payment is paid by the outcome you simulate instead.Public checkout API#
For a page with no server of its own (a static site, a Flutter app), the routes the hosted page uses are public, keyed by the payment's checkout_token, and callable from any website (CORS). They need no API key and only reveal the payer's view of one payment: your private fields merchant_id, metadata, customer_email, customer_id, webhook_url, checkout_token and checkout_url are left out.
| Method | Path | What it does |
|---|---|---|
| GET | /checkout/{checkout_token} | The payer's view of the payment |
| POST | /checkout/{checkout_token}/token | The customer chooses the coin, or changes it before paying: {"token": "USDT_TRC20"}. Same errors as POST /v1/payments/{id}/token, plus 429 |
| POST | /checkout/{checkout_token}/simulate | Plays an outcome on a test payment (below) |
| GET | /tokens?mode=test | Every token Payitgo supports, without an account, priced for a default account: a catalogue for a public page (for what your customers may pay with, use token_options or GET /v1/tokens). Test mode lists the same coins as live |
| socket.io | subscribe → payment:update | Live updates: the whole payment on every change |
In a Flutter app, the Dart library's PayitgoCheckout wraps these calls; in React, the Payitgo widget does.
Follow it live#
Payitgo serves socket.io (use socket.io-client 4.x) on https://api.payitgo.co. Connect to the default namespace and emit subscribe with the checkout token, with an acknowledgement: it answers with the payment as it is. Then every change arrives as a payment:update event carrying the whole payment. Subscribe again on every connect: it brings the current state after a reconnect.
import { io } from "socket.io-client";
const socket = io("https://api.payitgo.co", { transports: ["websocket"] });
socket.on("connect", async () => { // again after every reconnect
const r = await socket.emitWithAck("subscribe", checkoutToken);
if (r.ok) render(r.payment);
else console.error(r.error); // "payment not found", "checkout token required"
});
socket.on("payment:update", (e) => render(e.payment)); // e.type says what happened| You emit | With | The acknowledgement |
|---|---|---|
subscribe | The checkout token | {"ok": true, "payment": {…}}: the payment as GET /checkout/{checkout_token} returns it. An unknown token: {"ok": false, "error": "payment not found"}, then the socket is disconnected |
unsubscribe | The checkout token | {"ok": true}: no more events for that payment |
One socket can follow several payments: each subscribe adds one. Each payment:update has a type (what happened) and payment, the whole payment after the change: render from it. (A few of its fields are also repeated at the top of the event, where crypto_amount is the amount received so far: read payment instead.)
| type | When |
|---|---|
payment.snapshot | Right after subscribe: the payment as it is |
payment.coin_chosen | The coin was chosen or changed: the payment now has its address, amount and a new expires_at |
payment.partially_paid, payment.detecting, payment.confirmed, payment.underpaid, payment.expired, payment.failed, payment.wrong_asset, payment.late_deposit | The webhook events of the same name |
payment.confirmations | A deposit collected confirmations: show "7 of 20" from payment.confirmations and payment.confirmations_required |
payment.deposit | A deposit became final, or failed, without changing the status |
payment.simulation | A test payment's simulation started, and again when it is over (payment.simulation.state) |
Render any type you do not know from its payment like the others. socket.io-client reconnects by itself after a network drop; a drop of under 2 minutes replays the events missed. Keep the socket open while the page is open, also after expired and underpaid (late payments). If WebSockets are blocked, drop the transports option: socket.io then uses HTTP long-polling, which the gateway serves too.
Simulate from a payment page#
POST/checkout/{checkout_token}/simulate· no authentication · test payments only
A test payment moves no coins: it is paid by an outcome you choose (Test mode). Your server can start one with its key (POST /v1/payments/{id}/simulate); this route lets the payment page itself do it, for example to put “simulate” buttons on a test payment while you build your integration. The body is {"outcome": "confirmed"}, or any other outcome.
curl -s https://api.payitgo.co/checkout/b28d4f61e9a03c75d2e8f1a6/simulate \
-H 'Content-Type: application/json' \
-d '{"outcome": "confirmed"}'200 OK with the payment, as GET /checkout/{checkout_token} returns it, with "simulation": {"outcome": "confirmed", "state": "running"}. The payment then moves as it would for real coins: follow it with the socket. A payment.simulation event comes when the simulation starts (running), a status event for each step played, and payment.simulation again when it is over (done): enable your buttons again then. The payment must be pending or partially_paid, have its coin (except for expired), and run no other simulation.
| Status | Error | Cause |
|---|---|---|
| 400 | outcome is required | No outcome in the body, or the body is not JSON |
| 400 | simulate must be one of: confirmed, overpaid, … | An unknown outcome |
| 400 | only test payments can be simulated: use a test key | A live payment |
| 400 | choose the payment's coin first | No coin yet, for anything but expired |
| 400 | this payment is confirmed: only a pending or partially paid payment can be simulated | The payment is closed or confirming |
| 400 | a BTC address only receives BTC: wrong_asset needs a coin on Tron, Ethereum or BNB Smart Chain | wrong_asset on a coin that has no other on its network |
| 404 | payment not found | No payment has this checkout token |
| 409 | a simulation is already running for this payment | Wait for its done |
| 429 | rate limit exceeded | Too many requests from one visitor in a short time |
Webhooks#
Whenever one of your payments changes, Payitgo sends an HTTPS POST to your server (an IPN). Every notification is signed with your webhook secret, retried until your server acknowledges it, and arrives even if the customer closed the browser. Fulfil orders from these notifications.
Set up your endpoint#
Your account has two webhooks, one per mode, each with a URL (optional, null until you set it) and a signing secret (64 hex characters). Your API key picks the mode: with your test key you read and change the test webhook, with your live key the live one (the answer's livemode says which). Notifications with nowhere to go are not sent, and setting a URL later does not send them: set your URL before you take payments. Every event is kept all the same, so GET /v1/events can replay it.
| Method | Path | What it does |
|---|---|---|
| GET | /v1/webhook | Read the URL and the signing secret |
| PUT | /v1/webhook | Set the URL: {"url": "https://…"}. Public https only, on your own server (not one of Payitgo's hosts), no redirects. Safe to retry |
| DELETE | /v1/webhook | Remove the URL; the secret is kept |
| POST | /v1/webhook/test | Queue a signed ping to the URL (202 with the delivery, sent within seconds). With no URL for the mode: 400 no webhook url is set for this mode: set one first |
Libraries: webhooks.get(), webhooks.set(url), webhooks.remove(), webhooks.test(). The account owner can roll the secret in the dashboard: the new secret signs every notification from then on, retries of older ones included, and the old one stops working at once. Deploy code that accepts both, roll, store the new one, then remove the old.
| Notification | Goes to |
|---|---|
payment.*, settlement.* of a payment created with webhook_url | That payment's webhook_url |
payment.*, settlement.* of any other payment | The webhook URL of the payment's mode |
payout.* | The live webhook URL (payouts from your balance are live only) |
payout_item.* of a mass payout payment created with its own webhook_url (a payout request, or a batch row) | That payment's webhook_url |
payout_batch.*, payout_item.* of a batch created with webhook_url | That batch's webhook_url (a payment's own wins) |
payout_batch.*, payout_item.* of any other batch, payout_schedule.*, payout_wallet.* | The webhook URL of the batch's (or the schedule's, or the withdrawal's) mode |
ping | The webhook URL of the key's mode |
Events#
| Type | Sent when | data |
|---|---|---|
payment.partially_paid | Part of the amount arrived; the rest can still come before expires_at | Payment |
payment.detecting | The full amount arrived; waiting for confirmations. Not final | Payment |
payment.confirmed | Final: the money is yours. Fulfil the order | Payment |
payment.underpaid | Closed with only part of the amount (at the deadline, or a late deposit that was still not enough) | Payment |
payment.expired | The deadline passed and nothing arrived (or no coin was chosen) | Payment |
payment.failed | Funds were seen but never became final | Payment |
payment.wrong_asset | A deposit in another coin than the payment asked for | Payment |
payment.late_deposit | A deposit after the payment had closed | Payment |
settlement.completed | Direct settlement: your share reached your wallet (data.tx_id; for a deposit converted across networks, the exchange's payout to your wallet, and data.conversion says what it became, with "via": "exchange"). A test settlement completes on paper, with no tx_id | Settlement |
settlement.failed | Direct settlement: it could not be sent; Payitgo retries or returns it to your balance | Settlement |
payout.approved | Payitgo approved a payout you requested | Payout |
payout.rejected | Payitgo rejected a payout; the amount is back in your balance (data.review_note says why) | Payout |
payout.sent | A payout is on chain (data.tx_id) | Payout |
payout_batch.quoted, .pending_approval, .approved, .rejected, .awaiting_funds, .processing, .completed, .canceled | Each step of a mass payout batch (when each is sent). payout_batch.awaiting_funds: data.waiting says why (funds, with the shortfall to send; daily_limit; paused), sent again whenever the reason changes. payout_batch.canceled by Payitgo has data.canceled_by "system" | Batch |
payout_item.processing, .returned | A payout request left your list for a batch (data.batch_id), or came back to it (data.status invalid, data.errors; not final) | Payment (item) |
payout_item.sent, .failed, .canceled, .claimed, .claim_expired | A payment to a recipient is on chain (data.tx_id), was given up (data.fail_reason; its money stays in the payout wallet), was canceled before it was sent whatever canceled it (data.cancel_reason, data.canceled_by), or a claim link was claimed or ended unclaimed | Payment (item) |
payout_schedule.run | A payout schedule ran: data.last_batch_id is the batch it made, or data.last_error says why it could not | Schedule (without its items) |
payout_schedule.funding_needed | A schedule's run is remind_days away and the payout wallet couldn't cover it: data.shortfall says what to send where | {"schedule", "shortfall"} |
payout_wallet.withdrawn, .withdrawal_failed | A withdrawal from the payout wallet reached your payout address (data.tx_id), or could not be sent (data.fail_reason; its money stays in the wallet) | Withdrawal |
ping | You sent a test | {"message": "pong"} |
No event is sent when a payment is created. One deposit can raise two events at once: a late deposit that completes a payment raises payment.detecting and payment.late_deposit, both with the same payment. A claim link's payment in a payout_item.* event carries its link, claim.url, and for a link without an email its PIN, claim.pin. Every mass payout payment ends with exactly one of payout_item.sent, .failed, .canceled or .claim_expired, recorded with the change itself so none is lost (staying in sync).
The notification#
POST /payitgo/ipn HTTP/1.1
Content-Type: application/json
User-Agent: payitgo-webhooks/1.0
X-Webhook-Id: 8e3c1a7f5d9b2e4c6a0f1d3b
X-Webhook-Event: payment.confirmed
X-Webhook-Attempt: 1
X-Webhook-Signature: t=1791619398,v1=37098bbd98dba570cf350275781003849426785222f9c6dc68d6193870059846{
"created_at": "2026-10-10T09:04:03.771240512Z",
"data": {
"id": "c41e7a9d2b05f3e8a6d17c90",
"order_id": "ORD-1001",
"status": "confirmed",
"token": "USDT_TRC20",
"chain": "tron",
"livemode": false,
"currency": "USD",
"amount": "19.99",
"amount_due": "19.99",
"amount_received": "19.99",
"crypto_amount": "19.99",
"crypto_received": "19.99",
"…": "…"
},
"id": "2b8f4d6a0c1e3f5a7b9d2c4e",
"livemode": false,
"type": "payment.confirmed"
}id is the event's id (24 hex characters, an opaque string), the same on every retry and redelivery: deduplicate on it. data is the payment as GET /v1/payments/{id} returns it (but never with checkout_token, checkout_url or token_options), the settlement, the payout, the mass payout batch or its payment, the schedule, or the withdrawal; every amount in a coin has its value next to it. A simulated test payment's carries its simulation, and its deposits "simulated": true. Never fulfil a real order from an event with "livemode": false.
Values of coin amounts#
The amounts in a coin in data come with their values, so you can book a BTC or ETH payment without looking up a price. A payment's values are in its own currency, the one you priced it in (your currency); a settlement's and a payout's are in dollars. Either is at the rate fixed at the time (the payment's locked rate, the settlement, the payout request), not today's price. Like every amount, they are decimal strings without trailing zeros ("0.5" is $0.50, or 0.50 of your currency).
| Object | In the coin | Its value |
|---|---|---|
| Payment | crypto_amount | amount_due, in the payment's currency; amount is the price before the fees passed on |
| Payment | crypto_received | amount_received, in currency |
| Payment | deposits[].amount | deposits[].value, in currency (at rate_locked, or at the market price for another coin) |
| Payment | rate_locked: the price of one token in currency, locked when the coin was chosen | |
| Settlement | amount | usd_value, in dollars |
| Settlement | fee | fee_usd: everything charged on the deposit, as one sum |
| Settlement | net | net_usd: usd_value less fee_usd, so the dollar figures add up |
| Settlement | usd_rate: the dollar price of one token used (usd_value ÷ amount, to 8 decimals) | |
| Payout | amount | amount_usd |
| Payout | send_amount | send_amount_usd |
| Payout | network_fee | network_fee_usd |
| Payout | usd_rate: the coin's dollar price when the payout was requested | |
| Mass payout payment | amount | amount_usd, at its usd_rate: the coin's dollar price when it was priced |
| Mass payout batch | totals[].debit | totals[].debit_usd; the whole batch: total_usd |
For USDT and USDC, usd_rate is "1" and each dollar figure is the coin amount rounded to cents. A BTC deposit of 0.00085 to a payment in dollars locked at $62,400 settles with:
{
"token": "BTC",
"amount": "0.00085",
"fee": "0.000027",
"net": "0.000823",
"usd_value": "53.04",
"usd_rate": "62400",
"fee_usd": "1.68",
"net_usd": "51.36"
}Verify the signature#
The libraries verify a notification in one call, in constant time, and reject a timestamp more than 5 minutes from your clock:
const event = payitgo.webhooks.constructEvent(req.body, req.get("X-Webhook-Signature"));
// throws SignatureVerificationError: answer 400By hand, the recipe is:
X-Webhook-Signature: t=<unix seconds>,v1=<hex>
v1 = hex( HMAC-SHA256( key = secret, message = t + "." + raw_body ) )- Read the raw request body as bytes, before any JSON parsing (Express:
express.raw()before anyexpress.json(); Next.js:await request.text(); Fastify: aparseAs: 'buffer'content-type parser; Flask:request.get_data(); Django:request.body; FastAPI:await request.body(); Laravel:$request->getContent(); Rails:request.raw_post; Go:io.ReadAll(r.Body)). - Split the header on
,and each part on the first=: taketandv1. - HMAC-SHA256 with your mode's secret as the key (the whole string as you read it, as UTF-8 bytes) over
t, then., then the raw body, as lowercase hex. - Compare it with
v1in constant time, and reject atmore than 5 minutes away. Answer400to anything that fails.
import crypto from "node:crypto";
function verify(rawBody, header, secret) {
const parts = Object.fromEntries((header || "").split(",").map((p) => {
const i = p.indexOf("=");
return [p.slice(0, i).trim(), p.slice(i + 1).trim()];
}));
if (!parts.t || !parts.v1) return false;
const expected = crypto.createHmac("sha256", secret).update(parts.t + ".").update(rawBody).digest("hex");
const a = Buffer.from(expected), b = Buffer.from(parts.v1);
if (a.length !== b.length || !crypto.timingSafeEqual(a, b)) return false;
return Math.abs(Date.now() / 1000 - Number(parts.t)) <= 300; // 5 minutes
}Check your code against this example
a3858862701d1ce11ab06cb5dd9bb941d4849283f81fc0c3f0db0d99a2b82d48, t = 1791623565 and the body {"created_at":"2026-10-10T09:12:44.512837Z","data":{"message":"pong"},"id":"5c0e1f9a2b7d4e3c8a6f1b2d","livemode":false,"type":"ping"}, your code must produce 1af0ba31872e3152c422edaf9442c9f0eb4ebd202beebafbaaba14f77336194b (skip the timestamp check for this test).Answering and retries#
Answer any 2xx within 10 seconds; do slow work after answering. The body of your answer is ignored (its first 500 characters are kept in the delivery history). Anything else is a failure: another status, a timeout, a connection or TLS error, and redirects, which are not followed (a 3xx fails, so set the exact final URL). The URL's rules are checked again before every attempt, and Payitgo connects only to a public address: a host that resolves to a private or loopback address by then fails that attempt with refusing url: url must point at a public host (or refused: the address is not public when its address changed between that check and the connection). A failed delivery is tried 7 times in all:
| Attempt | When |
|---|---|
| 1 | Within about 5 seconds of the event |
| 2 | 1 minute after attempt 1 failed |
| 3 | 5 minutes later |
| 4 | 30 minutes later |
| 5 | 2 hours later |
| 6 | 6 hours later |
| 7 | 24 hours later; then the delivery is marked failed (about 33 hours after the event) |
Every attempt is signed afresh (a new t) with the same X-Webhook-Id and body, and an increasing X-Webhook-Attempt. Notifications can arrive twice or out of order: deduplicate on the event id, make fulfilment idempotent, and treat data.status as the truth (for mass payouts, keep a payment's latest data.updated_at and ignore an older one: a final status never changes). A notification to the account's URL goes to the URL as it is at each attempt, so pending retries follow a changed URL. Endpoint down for longer than the retries last? Replay the events you missed.
| Symptom | Check |
|---|---|
| Nothing arrives | Is a URL set for that mode (GET /v1/webhook with the key you create payments with)? Was the payment created with its own webhook_url? No delivery in the history means there was nowhere to send it |
| endpoint answered 3xx | A redirect: set the final URL (exact scheme, host and trailing slash) |
| Timeouts | Your handler takes over 10 seconds: answer first, work after |
| TLS or connection errors | A certificate valid for the host, and a firewall that accepts connections from the internet |
| Signature never matches | Raw bytes before any JSON parsing? The secret of the right mode, not rolled since? The "." between t and the body? Hex compared with hex? |
| Timestamp too old | Your server's clock is off: sync it with NTP |
| The same event twice | Expected now and then: deduplicate on id |
| PUT /v1/webhook answers 403 | A storefront key: use an account-wide key, or set webhook_url on the store's payments |
| PUT /v1/webhook answers url must point at a public host | Payitgo does not post to localhost or private networks: use a public URL or a tunnel |
| Deliveries fail with refusing url: url must point at a public host, or refused: the address is not public | Your host resolved to a private or loopback address when the delivery was sent: point its DNS at a public address |
Replay missed events#
GET/v1/events?type=&after=&created_after=&limit=· any key of the account (read-only too; not a storefront's)
Every event of the key's mode is kept, sent or not (even with no URL set), and listed here oldest first, each exactly as its notification carried it (id, type, livemode, created_at, data), payments' and payouts' alike. After an outage, read from the last event you handled and handle them as you handle notifications: the same ids, so the ones you processed already are skipped.
| Query | Description |
|---|---|
type | Comma-separated: exact types (payout_item.sent) or families (payout_item.*); all when left out |
after | An event's id: the events after it. Keep the last one you handled |
created_after | An RFC 3339 time: the events after it (ignored with after) |
limit | 1 to 200; 100 by default |
curl -s "https://api.payitgo.co/v1/events?type=payment.*,payout_item.*&after=9d4b2f7e1c6a3e08b5d2f1c4" \
-H "Authorization: Bearer $PAYITGO_KEY"{
"events": [
{
"id": "9b1e3c5a7d2f4b6e8a0c1d3f",
"type": "payout_item.canceled",
"livemode": true,
"created_at": "2026-10-20T15:02:44.312Z",
"data": { "id": "5c7e9a1b3d5f7a9c1e3b5d7f", "status": "canceled", "cancel_reason": "rejected", "cancel_note": "paid by bank transfer instead", "…": "…" }
}
],
"has_more": false
}While has_more, read again with after the last id. Events of the last few seconds are left for the next read, so moving forward never skips one; a test ping is never listed. A key that cannot make payouts gets claim links without their url and pin. Errors: 400 for a bad type, created_after or limit, and after is not an event of this mode; 403 a storefront's key cannot read the account's events: use an account key.
Realtime updates#
Your server can follow its payments live over one socket.io connection. Every change arrives the moment Payitgo knows it - a deposit seen, each confirmation, the final status - so the page your customer watches moves within a second, with nothing to poll. Notifications stay the record: fulfil orders from them, and use the socket for screens.
| Address | https://api.payitgo.co, socket.io 4 (socket.io-client 4.x), WebSocket transport, namespace /v1 |
| Authentication | Your secret API key in the handshake, auth: { key } (or Authorization: Bearer). Test, live and read-only keys alike; the key's allowed IPs apply |
| What arrives | payment:update for every change to a payment of the key's mode, with type and the whole payment as GET /v1/payments/{id} returns it. A storefront key gets only its own store's |
import { io } from "socket.io-client";
const socket = io("https://api.payitgo.co/v1", {
transports: ["websocket"],
auth: { key: process.env.PAYITGO_KEY },
});
socket.on("connect", () => {
if (!socket.recovered) refreshOpenOrders(); // your code: read again the payments you follow
});
socket.on("payment:update", ({ type, payment }) => {
showOnYourPage(payment.order_id, payment); // your code: push it to the customer's screen
});
socket.on("connect_error", (err) => console.error(err.message, err.data)); // err.data: { code, message }type is the notification's type when one was sent (payment.detecting, payment.confirmed…), or payment.created, payment.coin_chosen, payment.confirmations (a deposit collected more: confirmations of confirmations_required), payment.deposit or payment.simulation. Clients reconnect by themselves, and a drop of up to two minutes is resumed with every update it missed (socket.recovered); after a longer one, read again the payments you follow. A refused connection is a connect_error whose data is { code, message } - missing_key, invalid_key, forbidden or ip_not_allowed - and a connection Payitgo ends first gets auth:error with key_revoked, key_changed (connect again) or suspended.
Delivery logs and redelivery#
Every notification is kept with each attempt, the URL it went to, your server's status code and the start of its answer. Each delivery carries livemode (false for a delivery of a test event), so test and live deliveries are told apart. See them in Dashboard → Developers, and redeliver any delivery in one click: it starts again with up to seven tries, signed with the current secret and sent to the current URL. Claim links' URLs and PINs in a payload are shown only to the owner and finance members.
Test your handler#
- The signature:
POST /v1/webhook/testsends a signedpingto your test URL within seconds; check that your handler verifies it and answers200. - Real payment events: create a test payment and simulate an outcome: its webhooks arrive a few seconds apart, sent by the same processing as live coins (outcomes and their events). Create one with a
tokenand simulate nothing to getpayment.expired15 minutes later (an hour without one), or simulateexpired. - On your laptop: Payitgo only posts to public
https://URLs. Expose your local server with a tunnel (ngrok, Cloudflare Tunnel or similar) and set its URL as your test webhook URL. - Your error handling: answer
500once and watch the retry arrive a minute later withX-Webhook-Attempt: 2; change one byte of a captured body and check that your handler answers400.
Per-payment webhook URL#
Pass webhook_url when you create a payment, and that payment's payment.* and settlement.* notifications go there instead of the account's URL, signed with the same secret. It must be public https://, and is fixed at creation. Use it for one backend per store or tenant. The libraries take a default for every payment a client creates (webhookUrl, webhook_url, WithWebhookURL).
- A storefront key cannot change the account's URL, so a store sets
webhook_urlon its payments. - Test it with
POST /v1/webhook/testfor the mode's URL, or a simulated test payment for a per-payment URL.
Fees & settlement#
Every deposit that becomes final is settled: Payitgo takes its fees and moves the rest where your account says. You choose where, and who pays the fees. Payitgo handles crypto only: there are no cards, no bank payouts and no fiat.
Fees#
The fees come out of each deposit, in the asset that arrived. Nothing is invoiced.
| Fee | What it is | How much |
|---|---|---|
| Service fee | Payitgo's fee | A percentage agreed with your account: 1% by default, and at least $0.20 |
| Network fee | Moving the deposit out of its address on the blockchain (and converting it, when it is) | Priced from the network right now: cents on most networks, a dollar or two for USDT on Tron (Payitgo rents the energy a Tron transfer needs, well under the cost of burning it). For a converted coin, the quote also covers converting it: the swap or the transfers to the exchange, what the exchange keeps, and the conversion fee |
| Conversion fee | Only for a deposit converted into another coin: into one of your payout coins on its way to your wallet, or bought by Payitgo for your custody balance | 0.5% of what is swapped or converted (the exchange's own fee is in its rate); 1.5% of what Payitgo buys |
On Tron, sending USDT to a payout address that holds no USDT burns about twice the energy (its balance is created): a direct settlement to such an address pays that too, and says so in its note. Keep a little USDT on your Tron payout address to avoid it.
When you pay the fees yourself (fees_paid_by_customer off), a payment must be worth at least twice its token's network fee (and never less than the token's own minimum), so the fees never eat it. GET /v1/tokens shows each coin's minimum and network fee right now: network_fee is the fixed part, whatever the amount, and network_fee_bps, for a coin that is converted, the share of the payment added on top (180 = 1.8%). Each deposit's settlement shows what was charged on it as one sum, its fee.
A coin converted across networks on its way to your wallet (which coins) must also leave the exchange its minimum, with a tenth to spare: about 13 USDT from BNB Smart Chain to Tron. With the fees passed on, that is reached from a price of about $7.70 (the customer pays the exchange's cut on top). A smaller payment is still offered in that coin: the customer is asked for enough to reach the minimum, and you receive the extra (amount_extra on the payment and on each of its token_options). A $5 order, say, asks the customer for about $13.50, and you receive about $7.70. To offer such a coin only from the price that reaches the minimum, turn on hide_below_minimum in your payment settings; when you pay the fees yourself, that is always so. The minimums move with the fees and the exchange: minimum is the current one, in the payment's currency.
Payments paid in parts#
A payment paid in parts is settled once, not once per part. While it is still short (pending or partially_paid), and while another deposit of the same coin is confirming, its final deposits wait. When it confirms, falls short at its deadline (underpaid), expires or fails, the deposits of each coin are settled together: one transfer out of the address, one network fee and one service fee, on their total. The settlement's deposit_txs lists them (deposit_tx is the first), and their total is its amount. A deposit that arrives after that (a late one) is moved by a transfer of its own, and pays its own fees.
The settlement object#
Every final deposit gets a settlement: what arrived, the fees taken, what you received and where it went. It is the data of the settlement.* webhooks, and your team sees each one in the dashboard under Statements, linked to its payment.
| Field | Meaning |
|---|---|
id, payment_id, store_id | The settlement, the payment the deposit was made to, and the payment's store (when it has one) |
deposit_tx, deposit_txs | The deposit's transaction id (the payment's deposits[].tx_id). Settled together, deposit_txs lists every deposit and deposit_tx is the first |
livemode | false for a test settlement |
mode | Where the money actually went: direct (your wallet) or custodial (your balance). A direct payment kept in custody says why in note |
token, chain | The coin settled: what arrived, or what a swap on its own network bought |
amount, fee, net | What is settled, everything charged on it (the service fee, the network fee and any conversion fee, as one sum), and what is yours (amount less fee), in token; in dollars below |
destination, destination_tag | Direct settlement: the payout address it was sent to, and on XRP the tag it was sent with |
tx_id | Direct settlement: the transaction that paid you, once sent (converted across networks, the exchange's payout to your wallet) |
status | pending, completed, held or failed (statuses) |
note | Why it was held, kept in custody or converted the way it was, or what it waits for |
awaits_address | {"until": "…"}: waiting for your new or changed payout address for its coin, used from until; then it is sent there as it is. Its fee is 0 until then (why) |
conversion | When the deposit was converted: via (swap, exchange or platform), from and amount_in, to and amount_out, status (pending, done, or skipped: settled as it arrived) and a note |
created_at, completed_at | When the deposit became final, and when the settlement completed |
Settlements in dollars#
Each settlement carries its amounts in dollars next to the coin, so the dollar figures add up exactly (the payment itself reports in the currency you priced it in). Payouts carry usd_rate, amount_usd, network_fee_usd and send_amount_usd, at the coin's price when you requested the payout. Every field: values of coin amounts.
| Field | Meaning |
|---|---|
usd_value | amount in dollars, to the cent: at the payment's locked rate for its own coin, at the market price for another coin, or what a conversion bought |
usd_rate | The dollar price of one token used: usd_value ÷ amount, to 8 decimals. "1" for USDT and USDC |
fee_usd | fee in dollars at usd_rate, to the cent |
net_usd | What is yours, in dollars: usd_value less fee_usd |
Your account statement#
Download a statement of your account for any period from the dashboard's Statements page, with Download statement. The PDF shows your balance in each coin when the period started and ended, every payment, fee and payout in between with the balance after each, and what the period came to in dollars. Pick this month, last month, the last 3 months, this year, last year, everything since you joined, or your own dates. Every member of your team can download it, in live and in test mode.
Passing the fees on to the customer#
With fees paid by customer on, the default for a new account, the customer pays the fees on top of your price, so you receive the full price. Turn it off in Settings › Payments (owner) and the customer pays your price alone, and the fees come out of what you receive. Each payment keeps the setting it was created under: read its fees_paid_by_customer rather than assuming one. A $100 order in USDT_TRC20 with a $1.39 network fee and the 1% service fee asks the customer for $102.42. The payment's amount stays your price; amount_due and crypto_amount are what the customer pays, and each of the payment's token_options shows its own amount_due so they can pick the cheapest network. For a coin that is converted, the customer pays for converting it too, and your price still reaches you.
amount_due = (amount + network_fee) / (1 − service fee − network_fee_bps ÷ 10 000)
(and at least amount + network_fee + the service fee's minimum, $0.20)With the token's network_fee and network_fee_bps (0 when it is absent) from GET /v1/tokens, every figure in the payment's currency. With fees passed on, the minimums are just each token's own.
Direct settlement (default)#
Payitgo sends what remains of each deposit to your own payout address for that token, minutes after the deposit is final. A coin you have no payout address for is first converted into one you have (see below). Nothing stays with Payitgo. It is the cheapest option when you take few payments: a coin you have a payout address for is not converted, and the network fee covers two transfers (yours, and Payitgo's fee). On XRP, Payitgo's fee stays on its own address, so a direct XRP settlement is a single transfer.
Add a payout address for every coin you accept. It costs nothing, and it makes each coin's payments the cheapest they can be: they are sent to you as they arrived, on their own network, with no swap, and your customers pay only that network's transfers. A coin without one is converted first, and its quote carries the conversion: a TRX payment swapped into USDT costs your customer several dollars more than one sent to your TRX address, and TRX sent as it is costs nothing to move. You can have an address for each coin on each network: USDT on Tron and USDT on BNB Smart Chain are two coins, each with its own address.
Each direct settlement raises settlement.completed once your share is on chain (data.tx_id is the transfer that paid you; for a deposit converted across networks, the exchange's payout to your wallet), or settlement.failed if it could not be sent after repeated tries (Payitgo's team retries it, or returns it to your balance). A payment created with its own webhook_url gets its settlement events there. Custody settlements raise none: the money is in your balance once the payment is confirmed.
| Settlement status | Meaning |
|---|---|
pending | The transfers are being made |
completed | Done. In direct settlement, tx_id is the transfer to your wallet (converted across networks, the exchange's payout to it) |
held | Nothing to move, and note says why: the deposit was smaller than its fees, or it is already where it needs to be |
failed | It could not be sent after repeated tries: Payitgo retries it, or returns it to your balance |
- Add payout addresses in Balance › Payout addresses (owner or finance; your password is asked again). Test payments settle to test addresses, on paper: nothing is ever sent to them.
- Each token is paid to its default payout address in the payment's mode. The first address you add for a token is its default; make another one the default in Balance › Payout addresses.
- Your first live address of a coin is used at once: there was nowhere else for those payments to go. Any address that could redirect payments waits 24 hours (
active_at): another address of a coin, a changed address or tag, or one added after the coin's last address was deleted. So whoever might take over your account cannot redirect your payments at once, and your team is told of every change (asecuritynotification). Test addresses work immediately. - While the address for a deposit's coin is in its 24 hours, the deposit waits on its deposit address until the address is used, and is then sent there as it is, never converted: its settlement is
pending, withawaits_address.until(when the address is used) and anote, and its fees are worked out when it is sent. Changing the address again restarts the wait, for up to 48 hours from the deposit; after that, or when the address is deleted, it is settled as if there were none. - A deposit with no address of its own coin at all is converted into a coin you have a ready payout address for and sent there. When it cannot be, it is kept in your balance instead, in USDT on Tron, and its settlement says why in
note: never lost. Payitgo pays that balance out by itself to your USDT address on BNB Smart Chain (or Ethereum) once you have one in use (payouts); without one, request a payout of it as usual. - On XRP, give the payout address the destination tag your exchange asks for.
Custody (optional)#
Switch to custodial settlement and Payitgo keeps the money as your balance, always in USDT on Tron, so what Payitgo owes you never moves with a coin's price. A custody deposit in any other coin is bought by Payitgo at the market price as it settles (1.5% conversion fee). Request payouts when you like: to any of your live USDT payout addresses, on BNB Smart Chain, Ethereum or Tron, $10 or more, each reviewed by Payitgo before it is sent (payout.approved, payout.rejected, payout.sent). A payout carries the network fee of sending it: about a cent for USDT on BNB Smart Chain, a few dollars on Tron. Test balances are never paid out.
Owners switch in Settings › Payments, and owners and finance request payouts in Balance. The setting is captured when a payment is created: a payment keeps the mode it was created under.
Scheduled payouts (optional)#
Scheduled settlement works like custody, and Payitgo pays your whole balance out for you, in one payout, to your payout address for USDT_TRC20: as each payment is credited, every day, or every week on Mondays (payout_schedule: instant, daily, weekly). Owners set it in Settings › Payments.
- It is the cheapest when you take several USDT on Tron payments a day: each pays the network fee of one transfer instead of the two of direct settlement on Tron (about $1.39 against $2.40), and one payout a day or week pays the rest.
- Payouts go out at a fixed hour, once the payout address is in use (
active_at: another or a changed address waits 24 hours). A balance under the $10 minimum waits for the next one. instantrequests a payout the moment each payment is credited: one per payment, so it suits payments in other coins (they reach you as USDT on Tron without an exchange's fees) and large payments.- Each payout follows the usual steps (
requested,approved,sent) withrequested_by: "scheduler". The merchant object showspayout_scheduled_at, when the balance was last paid out.
Coins you have no payout address for#
The cheapest is not to need this: add a payout address for each coin you accept (why). With direct settlement, a payment in a coin you have no payout address for (say a customer pays in BTC and you only have a USDT on Tron address) is converted into one of your payout coins and sent to your payout address for it. There is nothing to turn on. A wrong-asset deposit is settled the same way.
Which payout coin
The owner chooses it in Settings › Payments (convert_into), from three options.
cheapest(the default;""sets it too): Payitgo compares your payout coins for each payment and converts into the one that costs the least at that payment's amount: the swap or the exchange's take, the transfers, and the 0.5% conversion fee.order: the first of- a coin on its own network that it is swapped into there, a stablecoin first (BNB or USDC into your USDT on BNB Smart Chain, say);
- otherwise USDT on Tron;
- otherwise the coin of your oldest payout address it can be converted into.
- A coin, any coin you have a payout address for (
BTC,USDT_BEP20,ETH…): your preferred payout coin. Every coin you have no address for is converted into it and sent to your default address for it, whenever the payment can be converted into it at its amount (the exchange takes about $5 at least to pay out BTC, a few cents for USDT on BNB Smart Chain); otherwise the fixed order above decides. It is used even where another of your coins would cost less (TRX into your USDT on Tron, say), so choosecheapestto always save.
The difference can be large. Receiving a conversion as USDT on Tron costs a few dollars (the exchange pays the Tron network to send it), as USDT on BNB Smart Chain a few cents. Converting a payment, as quoted on 2026-10-15:
| Paid in | Into USDT on Tron, $20 / $100 | Into USDT on BNB Smart Chain, $20 / $100 |
|---|---|---|
| BTC | $5.37 / $6.65 | $0.53 / $1.73 |
| XRP | $4.85 / $6.21 | $0.33 / $1.60 |
| ETH | $5.08 / $6.46 | $0.35 / $1.68 |
| TRX | $14.82 / $15.46 (swapped on Tron) | $0.33 / $1.66 |
A payment is quoted for the coin chosen when your customer picks theirs, and converted into that coin when it settles, unless you have since added an address for the coin it was paid in (it is then sent as it is) or removed the one it was quoted for (one is chosen again). A coin the exchange would not take that little of is passed over; when none would, the payment is kept in your balance (below).
| Network | Swapped there |
|---|---|
| Ethereum | ETH, USDC and USDT into one another |
| BNB Smart Chain | BNB, USDC and USDT into one another |
| Tron | TRX into USDT |
A swap's price must be within 3% of the market price, and it is refused on chain if it falls more than 0.5% (between stablecoins, 1% otherwise) below the quote; the exchange's own fee is in its price. Across networks (BTC, XRP or ETH into USDT on Tron, say), an exchange converts it and pays your coin out to your payout address: its own rate and network fees apply, and its fixed part (a few dollars) makes converting dear on small payments. What converting costs is in the coin's network fee (GET /v1/tokens), and paid by the customer when you pass the fees on. The settlement's conversion says what happened (via: swap, exchange or platform), and Settings › Payments shows the coin each coin's payments are converted into. A payment too small for the exchange's minimum pays up to it, and you receive the extra (amount_extra), unless you offer such coins only from the price that reaches it (hide_below_minimum, minimums).
A deposit is kept in your balance instead, in USDT on Tron like any custody deposit, with its settlement's note saying why, when:
- it converts into none of your payout coins;
- it is too small for the exchange's minimum (a few dollars, with a margin for the fees):
too small to convert into USDT_TRC20: kept in your balance instead; - a swap is not worth it (its network fees would be over a tenth of its value: small deposits, and on Tron deposits under about $65), the exchange's price is off the market, or the exchange refuses the swap twice;
- the exchange refunds it (its conversion fee is then 1.5% in all).
Nothing is lost: it is paid out to you automatically once you have a USDT address on BNB Smart Chain or Ethereum in use, or request a payout when you like.
- Accept other coins toward a payment (Settings › Payments): a deposit in another coin you accept counts toward the payment at its value (wrong asset).
- Add a payout address for a coin to receive its next payments as they are. To accept only coins you can be paid out in, enable only those.
- Conversion runs in live mode only: in test mode a coin you have no test payout address for is credited to your test balance as it arrived.
In test mode#
Test payments are simulated and move no coins, but they are settled like live ones, on paper:
- Each simulated deposit is settled when it is final (a payment paid in parts once, when it closes), with the same fees as live, and gets its settlement (
"livemode": false). - Coins are never converted: a test deposit settles in the coin that arrived, in direct settlement and in custody alike.
- With direct settlement and a test payout address, the settlement completes at once and sends
settlement.completed. Nothing is sent to the address, so it has notx_id. - In custody, or with no test payout address for the coin, the net amount is credited to your test balance. Test balances are never paid out.
Mass payouts#
Pay your own recipients in batches, from your own payout wallet: salaries and contractors, tournament prizes and affiliate commissions, withdrawals from a trading platform or a marketplace. Your system sends each payout request over the API the moment it comes in, or your team uploads a list in the dashboard. Payitgo checks and prices every payment, your approvers sign off, and Payitgo sends each one as soon as the wallet holds enough.
| At a glance | |
|---|---|
| Coins | 14 coins on 7 networks: USDT on Tron, BNB Smart Chain and Ethereum; USDC on BNB Smart Chain and Ethereum; DAI; ETH on Ethereum and BNB Smart Chain; TRX, BNB, BTC, LTC, DOGE and XRP (networks and coins) |
| Where the money comes from | Your payout wallet: one address per network, yours alone, that you top up |
| What it costs | 0.5% of each payment, never less than $0.50, plus its network fee (fees) |
| How you send payments | Each payout request over the API as it comes in, sent together when you choose (payout requests); or whole batches from the dashboard (rows typed or pasted, or a CSV file) |
| No address? | A claim link: the recipient chooses the coin and their wallet |
| Other coins | Conversion: keep one coin in the wallet and pay in any payout coin |
| Payroll | Schedules: the same batch every week, two weeks or month |
| Safeguards | Approvals, limits per payment, per batch and per day, a wait for new recipients, sanctions screening (approvals and limits) |
How it works#
- Make a batch in the dashboard, or let your payout requests make one. Each payment names a coin, an address, an amount and, if you like, your own
referencefor it and the recipient's name, email and a note. - Payitgo checks and prices it. Every row is checked (the coin, the amount, the address down to its checksum, the sanctions list, your limits) and priced. A row with an error is left out; the rest are
ready. The batch isquoted: its prices hold for an hour. - Submit it. With approvals turned on, it waits for them; otherwise it goes straight to funding.
- It is funded from your payout wallet. When the wallet holds what the batch needs, coin by coin, its money is set aside and it starts. When it does not, the batch waits and says exactly how much to send, and where. It starts by itself once the money is there.
- Payitgo sends it. Its payments go first, up to 50 in each transfer. Each payment gets its transaction id as it goes, and a webhook. Then its fees, for the payments sent.
Payout requests#
The easiest way in. You don't have to build batches: your system sends each payout request the moment it comes in (a trader withdrawing from your platform, a contractor's invoice approved, a prize won) with POST /v1/payouts. Payitgo checks and prices it at once, answers with what it costs, and keeps it in your list of payout requests, as long as your payout wallet holds what it and the requests already waiting in its coin take. When you choose (every hour, at the end of the day, or when someone presses Send in the dashboard), send the list: its valid requests become a batch, priced again at today's fees and submitted, then approved and funded like any batch. Or let the list go by itself (auto-send).
curl -s https://api.payitgo.co/v1/payouts \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"reference": "wd-88231", "asset": "USDT_TRC20", "address": "TR7mNkucnhLZoJQLLJ6DR88jpLQufWxUJi", "amount": "250", "name": "Ana Silva", "email": "[email protected]"}'
# The list, and what sending it takes from the wallet
curl -s https://api.payitgo.co/v1/payouts/inbox -H "Authorization: Bearer $PAYITGO_KEY"
# Send it: every valid request, or {"ids": [...]}
curl -s -X POST https://api.payitgo.co/v1/payouts/send -H "Authorization: Bearer $PAYITGO_KEY"201 Created: {"item": payment}, the payment in your list, ready with what it costs (fee, everything charged on it as one sum; send_amount, what the recipient receives; and debit, what the wallet gives), or invalid with its errors (a wrong network, a sanctioned address, under the minimum): tell your client at once. An invalid request stays in the list, never sent, until you remove it. A request's reference makes it safe to send again: the same reference answers 200 OK with the payment that has it, wherever it is now. Once a request is canceled, failed or expired, its reference is free again: to pay it after all, send a new request (it may reuse the reference); a canceled payment is never brought back. New requests follow your payout settings' fee_paid_by and convert as they are when the request comes in; when sent, each is priced again and follows the conversion setting as it is then.
{
"item": {
"id": "5c7e9a1b3d5f7a9c1e3b5d7f",
"livemode": true,
"batch_id": "0d2f4a6c8e1b3d5f7a9c2e4b",
"reference": "wd-88231",
"recipient": { "name": "Ana Silva", "email": "[email protected]" },
"asset": "USDT_TRC20",
"chain": "tron",
"address": "TR7mNkucnhLZoJQLLJ6DR88jpLQufWxUJi",
"amount": "250",
"send_amount": "250",
"fee": "2.852417",
"debit": "252.852417",
"status": "ready",
"errors": [],
"warnings": [],
"…": "…"
}
}Each request then tells you what became of it, by webhook, with your reference:
payout_item.processing: it left the list for a batch (batch_id): show the withdrawal as processing.payout_item.returned: it came back to the list (not final).payout_item.sent, with thetx_id: mark the withdrawal paid.payout_item.failed: not paid, its money is still in your wallet.payout_item.canceled: it will never be paid, andcancel_reasonsays why (removed from the list, rejected by an approver of your team, its batch canceled, no longer payable): give your client their money back.
Every request ends sent, failed or canceled, and you hear it whoever acted on it: your system, a team member in the dashboard, or Payitgo (staying in sync).
| Method | Path | Key | What it does |
|---|---|---|---|
| POST | /v1/payouts | payouts | Take a request (fields): 201 {"item": payment}; 200 for a reference used already |
| GET | /v1/payouts/inbox?status=&limit=&offset= | any | The list: inbox (a batch with inbox and open true: the totals and counts of the requests waiting; batch routes on it answer 409 this is your list of payout requests: …), coverage per coin (needed, spendable, top_up, what to send to address first), and items in the order they came (status: ready, invalid or both), total, limit (1 to 200, 50 by default), offset |
| POST | /v1/payouts/send | payouts | Send every valid request (up to 10,000 a call: the rest wait for the next), or only {"ids": […]}. 200 {"batch": batch} |
| DELETE | /v1/payouts/{id} | payouts | Remove a request: 200 with the payment, "status": "canceled", "cancel_reason": "removed" |
Take a payout request
The body of POST /v1/payouts is one payment, with these fields.
| Field | Required | Description |
|---|---|---|
asset | yes | A payout coin (any case). With conversion on, any payout coin: the coin the recipient receives |
address | yes, unless a claim link | The recipient's address on the coin's network |
amount | yes | How much of the coin, a decimal string. When the recipient pays the fees, they come out of it |
reference | no, but send one | Your id for this payment, unique in its mode (retries) |
name, email, note | no | Who it is for, and why: kept with it, shown in the dashboard and the results file. A claim link's link is emailed there; otherwise nothing is sent to the email |
tag | no | XRP only: the destination tag the recipient's address needs, an integer |
claim | no | true makes it a claim link, without an address (with no email, you share its link) |
claim_assets | no | The other coins its recipient may choose (up to 10). Giving them makes the payment a claim link |
webhook_url | no | An https:// URL on a public host of yours (not Payitgo's): this request's events go there instead of your account's webhook URL, and it stays with the request when it is sent |
simulate | no | Test mode only. How it ends on paper, sent (the default), failed or failed_after_broadcast (test mode) |
A valid request is taken only when the payout wallet can spend what it debits together with the valid requests already in the list in its coin (less what your fee credit pays). When the chain cannot be read just now, the wallet's last balance read in the 15 minutes before decides.
| Status | Error | Cause |
|---|---|---|
| 400 | invalid request body | Not JSON, or a field of the wrong type |
| 400 | webhook_url: url must use https | An unusable webhook_url (also a host that does not resolve, is not public, or is Payitgo's) |
| 400 | your payout wallet cannot pay this request and those already in your list; send 20.5 USDT on Tron (TRC-20) to TQ8… first, then try again | The wallet holds less than the request and those waiting in its coin take. Nothing is added, and its reference stays free |
| 403 | this api key cannot make payouts: … | A key without payouts on (payout keys) |
| 409 | your list of payout requests is full: send or cancel some first | 100,000 requests waiting |
| 503 | your payout wallet's balance cannot be checked right now; try again in a minute | The balance could not be read and none was read in the last 15 minutes. Nothing is added, so send it again shortly with the same reference |
Send the list
The requests sent move into a new batch (source: "requests", inbox: true, named “Payout requests of 20 Oct 2026 14:00 UTC”), are priced again at today's fees, and the batch is submitted as the key: then approvals, funding and the top-up it may need, as for any batch made with an API key. The answer is that batch: waiting for its approvals, waiting for a top-up (waiting.shortfall says what to send where), or being sent. Up to 100 requests are priced while the call waits; more come back validating, and the batch is submitted by itself once priced. Invalid requests, and the ones you did not pick, stay in the list. Each request sent raises payout_item.processing, with its new batch_id.
A request no longer valid when priced again (prices moved under the minimum, an address added to the sanctions list, your limit per payment lowered) comes back to the list with its errors and raises payout_item.returned; the others go on. It stays in the list, never sent, until you remove it. Should submitting fail (none of its requests is valid any more, or it is over your limit per batch), its requests go back to the list, each saying why (payout_item.returned), that batch is canceled (payout_batch.canceled, canceled_by: "system"), and the answer is the error; for a send priced in the background, your team gets a “Payout requests not sent” notification instead. An empty list, or one with only invalid requests, answers 400 no payout request to send or no valid payout request to send; an id that is not a valid request waiting in the list, 400 payout request … is not a valid request waiting in your list.
Remove a request
A request still in the list is removed: the payment comes back canceled with "cancel_reason": "removed", its reference is free again (it moves to released_reference), it no longer has a batch_id, and its record stays (GET /v1/payouts/{id} keeps answering it). payout_item.canceled is sent. One already sent but not on its way yet is canceled like any payment ("cancel_reason": "canceled"): funded (queued, cooling, sending), its money stays in the wallet and its fee comes back; not funded yet, its batch is totalled again (approvals already given stand), and canceled when nothing is left in it. A request sent at the very moment you remove it is canceled where it went, never reported removed while it is paid. Removing one canceled already answers it again, unchanged: safe to repeat. 409 the payment is sent (or failed, expired) once it is done.
Auto-send
With auto_send_minutes in your payout settings (1 to 1440; 0, the default, sends by hand), the list sends itself once its oldest valid request has waited that long: a withdrawal requested at 14:00 with 30 minutes goes at 14:30, with everything valid that came in since. The batch is made and submitted by auto-send (its created_by), with the approval rules of a batch made with an API key: approvals unless api_auto_submit lets it skip them (never for a new recipient). Auto-send waits while Payitgo has paused your payouts. Turning it on, or shortening it, loosens your rules: it takes effect 24 hours later.
The payout wallet#
Your payout wallet is a set of addresses Payitgo made for your account alone: one per network, the same for every coin of that network. It is made the first time it is asked for (opening the payout wallet page, or GET /v1/payout-wallets), and it never changes. It holds only your money, kept apart from every other account's: top it up with what your batches need. Payitgo runs the wallet for you and signs its transfers, which only ever pay your batches' recipients, your batches' fees, and withdrawals back to your own payout addresses.
| Network | chain | Coins | Network fees paid with |
|---|---|---|---|
| Tron | tron | USDT_TRC20, TRX | Payitgo's TRX on the wallet |
| BNB Smart Chain | bsc | USDT_BEP20, USDC_BEP20, ETH_BEP20, BNB | Payitgo's BNB on the wallet |
| Ethereum | ethereum | USDT_ERC20, USDC_ERC20, DAI_ERC20, ETH | Payitgo's ETH on the wallet |
| Bitcoin | bitcoin | BTC | The wallet's own BTC |
| Litecoin | litecoin | LTC | The wallet's own LTC |
| Dogecoin | dogecoin | DOGE | The wallet's own DOGE |
| XRP Ledger | xrp | XRP | The wallet's own XRP |
On Tron, BNB Smart Chain and Ethereum, Payitgo pays each transfer's network fee with its own coin, kept on the wallet for that, and charges it in each payment's fee: your TRX, BNB or ETH are never spent on fees. On Bitcoin, Litecoin, Dogecoin and the XRP Ledger, the wallet's own coin pays the network: each payment's network fee stays in the wallet, set aside (reserved) until its transaction spends it, and only the platform fee is sent to Payitgo.
- Bitcoin, Litecoin, Dogecoin: a transfer of up to 50 payments is one transaction paying them all, Payitgo's fee for them in one more output (never a transaction of its own), its change back to the wallet. A payment under the coin's smallest output is refused (0.00000546 BTC, 0.0000546 LTC, 0.01 DOGE), and the platform fee is at least that output. Should the network's fee rate rise above what the payments were quoted, their transaction waits until it falls.
- XRP Ledger: the ledger locks a reserve on every account, so the wallet's
balanceis what it holds beyond it, and its first top-up must bring the reserve too (neededand a batch's shortfall include it until the wallet is funded). Paying an address that was never funded takes at least the reserve; an address that needs a destination tag must be given one; an account that accepts only senders it authorised is refused. - ETH and BNB to a contract address are refused: a contract may not handle a plain transfer.
Send only these coins to their network's address
Balances
GET/v1/payout-wallets· any key
The dashboard's Pay people page shows the same addresses and balances.
{
"wallets": [
{
"chain": "tron",
"network": "Tron",
"address": "TMkq7dZ3vN8xR2pB6cH9sJ4fL1wY5tGaQe",
"explorer_url": "https://tronscan.org/#/address/TMkq7dZ3vN8xR2pB6cH9sJ4fL1wY5tGaQe",
"livemode": true,
"assets": [
{ "asset": "USDT_TRC20", "ticker": "USDT", "balance": "500", "reserved": "122.202417", "spendable": "377.797583", "needed": "0", "…": "…" },
{ "asset": "TRX", "ticker": "TRX", "balance": "0", "reserved": "0", "spendable": "0", "needed": "0", "…": "…" }
]
},
{ "chain": "bsc", "network": "BNB Smart Chain", "…": "…" }
]
}Each wallet has its chain, network (for people), address (show it with a QR code), explorer_url (live only), livemode, assets, and an error when its balances could not be read just now (the figures are then 0: try again in a moment). Each asset has its ticker and icon_url, and:
| Field | Meaning |
|---|---|
balance | What the address holds, read from the chain (at most 20 seconds old). Payitgo's own TRX, BNB or ETH kept there for network fees is left out; for XRP, the ledger's reserve; for BTC, LTC and DOGE it counts confirmed coins and the wallet's own change. In test mode, the balance on paper |
reserved | Promised already: payments funded and not sent yet (with their network fee on Bitcoin, Litecoin, Dogecoin and XRP), claim links waiting (their worst-case debit), fees and withdrawals not sent yet |
spendable | balance less reserved: what a new batch or a withdrawal can use |
needed | What your batches waiting for funds need beyond spendable: the top-up to send now. "0" when nothing waits |
withdrawal_fee | What withdrawing it costs right now, taken from the amount: a withdrawal must be more than it |
A batch waiting for funds also says what it lacks, coin by coin, with the address to send it to (its waiting.shortfall).
Unused funds
Top the wallet up as your batches need it, and withdraw whatever you like, whenever you like. Every 6 hours Payitgo looks at each live payout wallet; one holding more than $25,000 of spendable funds (today's threshold) for a week tells your team, at most once a week, with a notification in the payouts category, so unused funds never go unnoticed. It is in your audit log too (payout_wallet.idle).
Withdrawals#
What the wallet holds can be sent back to one of your payout addresses for that coin (one past its 24-hour wait). The owner withdraws it in Pay people, with their password and their two-factor code. No API key can ever withdraw. A key only ever pays a batch's recipients.
A withdrawal pays the network fee of two transfers (yours, and the one taking its fee to Payitgo), in the coin, out of its amount (the coin's withdrawal_fee in the wallet says how much right now): send_amount is what reaches your address. Its status goes requested → sending → sent (with tx_id, and in live mode explorer_url), or failed (fail_reason), which leaves the money in the wallet. Who asked is requested_by, with their email in members. When it is sent, a payout_wallet.withdrawn webhook and a “Payout wallet withdrawal sent” notification follow; when it fails, payout_wallet.withdrawal_failed. Pay people lists your latest withdrawals. While Payitgo has paused payouts on your account, live withdrawals are refused too.
A batch's life#
validating ──▶ quoted ──▶ pending_approval ──▶ awaiting_funds ──▶ processing ──▶ completed
│ ▲ │ │
│ └ add, remove, new quote │
▼ ▼ ▼
canceled rejected canceled (by you, or by Payitgo
when nothing can still be paid)| status | What it means | What can happen next |
|---|---|---|
validating | Its rows are being checked and priced. A batch of more than 100 payments is checked in the background, within a minute or two | quoted by itself; canceled |
quoted | Checked and priced: totals, total_usd, each payment's fee. Its prices hold until quote_expires_at, an hour | Add or remove payments, get a new quote, submit, cancel |
pending_approval | Submitted; waiting for approvals_needed approvals | Approved (it moves on), rejected, canceled |
awaiting_funds | Approved; waiting for the wallet. waiting says why | Funded (processing) by itself; canceled |
processing | Funded: its money is set aside in the wallet, and its fees and payments are being sent | completed; canceling stops the payments not sent yet |
completed | Funded, and every payment is sent, failed, canceled or expired | Final |
canceled | Canceled before it was funded: nothing was sent. By you (canceled_by a member or a key), or by Payitgo (canceled_by: "system"): a send of payout requests that could not be submitted, or a batch none of whose payments could still be paid when it was funded | Final |
rejected | An approver refused it (rejection.reason) | Final |
Only a validating or quoted batch takes new payments. Submitting a batch cancels the payments left out: each invalid one becomes canceled with "cancel_reason": "invalid" (its errors say why), so a submitted batch never holds a payment that cannot be paid. Until it is funded, a payment can still be canceled: the batch is totalled again (approvals already given stand), and canceled when nothing is left. To change a submitted batch otherwise, cancel it and make another. When a batch is rejected or canceled, each of its payments not sent is canceled too and raises payout_item.canceled (cancel_reason rejected, with the approver's reason as cancel_note, or batch_canceled): your system hears about every payment, not only the batch.
Why a batch waits
While awaiting_funds, waiting.reason says what it waits for, and waiting.note says it for people:
| reason | Means | What to do |
|---|---|---|
funds | The wallet holds less than the batch needs of at least one coin. waiting.shortfall lists what is missing: the coin, its network, the amount and the address to send it to | Send that amount to that address. The batch starts by itself, usually within a minute of the money arriving on chain |
daily_limit | Funding it now would pass your daily limit (live only) | Nothing: it is funded from 00:00 UTC. Or raise the limit (which takes 24 hours) |
paused | Payitgo paused payouts on your account | Contact support |
A batch whose prices are over an hour old when it is funded is priced again first, at today's network fees, so the shortfall of a batch that waits a long time can move a little. A payment that can no longer be paid then (under the minimum at today's prices, an address added to the sanctions list, your limit per payment lowered) is canceled ("cancel_reason": "invalid", canceled_by: "system"), its money free in the wallet; the others go on. A batch left with nothing to pay is canceled by Payitgo, and your team is told.
The payments
| status | What it means |
|---|---|
validating | Being checked |
ready | Checked and priced: it goes with the batch |
invalid | Left out: errors say why. It is never sent and costs nothing. Canceled (cancel_reason: invalid) when its batch is submitted; a payout request stays invalid in your list until you remove it |
cooling | Funded; a new recipient waits until cooling_until |
queued | Funded; waiting for its transfer |
sending | Its transfer is on its way |
sent | On chain: tx_id (and explorer_url, live) |
failed | Given up (fail_reason); its money stays in your wallet |
canceled | Canceled before it was sent: cancel_reason says why, canceled_by who |
claimable | A claim link, funded: waiting for its recipient to claim it |
expired | A claim link never claimed: its money is free in the wallet again |
A payment whose transfer fails on chain three times fails, and so does one the token refuses outright (a recipient its issuer blocked); fail_reason says which, and the rest of the batch goes on.
Checking and pricing#
Every row is checked when it is added, and again whenever the batch is quoted:
- The coin: one of the payout coins.
USDTorUSDCalone is refused with a hint to add the network. - The amount: over 0, with no more decimals than the coin takes (6 for TRX, XRP, and USDT or USDC on Tron and Ethereum; 8 for the others), worth at least $1, and within your limit per payment.
- The address: valid for the coin's network down to its checksum, not the zero address, not your own payout wallet. An address of another network says which (
this address is for Tron, not BNB Smart Chain). - The chain (live mode): each recipient's address is read on chain. A Tron wallet that never held USDT, or a Tron address not activated yet, costs more to pay and is priced so; ETH or BNB to a contract is refused; an XRP address that was never funded, needs a tag or accepts only authorised senders is checked for it.
- Claim links and conversions: a claim link has no address and a valid email (or none); a converted payment's address is checked on the network of the coin it is converted into.
- The sanctions list, your references, and duplicate rows.
Each problem is an issue, in the payment's errors or warnings: an error leaves the payment out (invalid), a warning is worth knowing and the payment still goes. An issue has a code (for your code), the field at fault (asset, amount, address, tag, reference, email or claim_assets), a message and sometimes a hint (both for people).
{ "code": "wrong_network", "field": "address", "message": "this address is for Tron, not BNB Smart Chain", "hint": "pay it in a coin of that network, or check the address" }| code | Kind | Meaning |
|---|---|---|
unsupported_asset | error | No coin, an unknown coin, USDT or USDC without its network, a coin payouts do not pay in, or a claim link offering such a coin (or more than 10) |
invalid_amount | error | The amount is 0, negative or not a number |
too_precise | error | More decimals than the coin takes |
invalid_address | error | Not an address of the coin's network, the zero address, a tag on a coin that takes none, an XRP account that needs a tag given none or accepts only authorised senders, or an address on a claim link. As a warning: an XRP account that asks not to be sent XRP |
wrong_network | error | An address of another network |
own_wallet | error | Your own payout wallet |
duplicate_reference | error | Another payment already has this reference: in this batch, or in any earlier one of the same mode |
sanctioned | error | The address is on the US Treasury's sanctions list (OFAC SDN): it cannot be paid |
contract_recipient | error | ETH or BNB to a contract address, which may not handle a plain transfer (live only) |
below_minimum | error | Worth less than $1; under the coin's smallest output (BTC, LTC, DOGE); under the reserve a never-funded XRP address needs; or under what a conversion takes at least |
invalid_email | error | A claim link's email is not an email address |
conversion_unavailable | error | The payment cannot be converted into its coin (now): pay it in the wallet's coin |
over_limit | error | Over your limit per payment |
fee_exceeds_amount | error | The recipient pays the fees, and they would leave less than $1 |
duplicate_payment | warning | Another row pays the same amount of the same coin to the same address |
new_holder | warning | The first USDT sent to a Tron wallet costs more in network fees: included in its fee (live only) |
activation | warning | A TRX payment to a Tron address not activated yet: the transfer activates it, which costs more; included in its fee (live only) |
check_failed | warning | The address could not be read on chain just now: priced as the costlier case |
new_recipient | warning | You never paid this address: the payment waits after the batch is funded (new recipients) |
Codes may be added: treat an unknown one by its kind (in errors or in warnings) and show its message.
Fees#
| Fee | How much |
|---|---|
| Platform fee | 0.5% of the payment's amount, never less than $0.50. A rate agreed with your account replaces it |
| Network fee | What sending it costs on its network, priced from the network now at its lowest rate: its own transfer, and its share of what the batch's payments in that coin share (the transfer taking their fees to Payitgo, and the network fee top-ups of each transfer of up to 50 payments) |
Both are in the payment's coin, rounded up to the coin's decimals: the platform fee at the coin's dollar price when the batch was priced. A payment's fee is everything charged on it: the platform fee, the network fee and any conversion fee, as one sum. On Bitcoin, Litecoin, Dogecoin and the XRP Ledger the network fee stays in your wallet for the transaction to spend: only the platform fee is sent to Payitgo. A claim link is priced at its costliest address, and its fee taken when claimed. On Tron, a USDT transfer's network fee is mostly its energy, priced at the network's lowest rate: should that rate be out of reach for a moment, the transfer waits and tries again a few minutes later rather than paying more, so the network fee you were quoted is the one you pay.
Who pays the fees is the batch's fee_paid_by; a batch that does not say takes your payout settings' default:
| fee_paid_by | The recipient receives (send_amount) | The wallet gives (debit) |
|---|---|---|
merchant (the default) | The whole amount | amount + fee |
recipient | amount − fee (at least $1 must be left) | amount |
A worked example
A payment of 120 USDT. Its platform fee is 0.60 USDT: 0.5% of $120 is $0.60, over the $0.50 minimum (a payment of $60 would pay the minimum, $0.50). Its network fee depends on the network, at today's prices:
| 120 USDT | On Tron (USDT_TRC20) | On BNB Smart Chain (USDT_BEP20) |
|---|---|---|
| Platform fee | 0.60 | 0.60 |
| Network fee | about 1.60 | about 0.012 |
fee | about 2.20 | about 0.612 |
| You pay the fees: the recipient receives / the wallet gives | 120 / about 122.20 | 120 / about 120.612 |
| The recipient pays them: the recipient receives / the wallet gives | about 117.80 / 120 | about 119.388 / 120 |
- Totals. The batch shows the totals per coin (
totals: amounts, fees, what the wallet gives and its dollar value) andtotal_usd, what the whole batch takes from the wallet.saved_usdadds up what sending each payment with its batch saves in network fees against a transfer of its own. - The fees are sent last. Once a batch's payments in a coin are done with, its fees there go from the wallet to Payitgo in one transfer, for the payments sent. A claim link's fee goes in a transfer of its own once it is paid. Until then they stay in the wallet, set aside. On Bitcoin, Litecoin and Dogecoin there is no fee transfer: each payment's fee goes in its own transaction.
- You only pay for what was sent. A payment canceled pays no fee. One that failed pays none either, but the network fee of its transfer when that was broadcast. A fee transfer worth less than the network fee of sending it is not sent: it stays in your wallet. A fee given back for a payment never sent (a fee credit,
fee_credit) pays your next fees in the same coin. - Withdrawing from the wallet pays the network fee of two transfers, nothing else (withdrawals).
Claim links#
Pay someone whose wallet address you don't know: a payment with "claim": true (or with claim_assets) becomes a claim link. With an email, Payitgo emails the recipient the link; they open it, choose the coin and enter the address of their wallet, confirm with a code sent to that email, and the payment goes there. Without an email, share the link yourself (the payment's claim.url, the hosted claim page) and give the recipient its PIN (claim.pin, 6 digits) another way: a call, a text message, in person. The recipient enters the PIN to claim, so a link that is lost or forwarded pays no one on its own.
A claim link is only ever made when you ask for it: a payment with an email but no address and no claim is refused for its missing address, never turned into a link. A claim link given an address too is refused (invalid_address).
curl -s https://api.payitgo.co/v1/payouts \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"reference": "prize-ana", "asset": "USDT_TRC20", "amount": "250", "name": "Ana Silva", "email": "[email protected]", "claim": true, "claim_assets": ["USDT_BEP20", "USDC_BEP20"], "note": "Cup final, 1st place"}'- Coins: the payment's
asset, and the other coins listed inclaim_assets(up to 10 payout coins), paid at the same dollar value. Another coin is offered only while your wallet covers it when the link is opened. - Pricing: priced at the costliest address it could be claimed to (a Tron wallet that never held USDT, sent on its own), and that worst-case
debitis set aside in your wallet while it waits. When claimed, it is priced again for the coin and address chosen, and its fee taken then: usually less than set aside. - Statuses: once its batch is funded, the payment is
claimableuntil claimed (thenqueued,sending,sent) or until its link ends:expired. The batch staysprocessinguntil every claim link is claimed or expired. - Expiry: a link works for 14 days after its batch is funded (
claim.expires_at). An expired payment's money is free in your wallet again, no fee is taken, its reference is given back, and your team gets a notification and apayout_item.claim_expiredwebhook. - Emails (live mode only): the link when the batch is funded, a reminder 72 hours before it ends, and the code when the recipient asks for it. A claim link is never converted, and its recipient never waits as a new recipient: the code proves who they are.
- The code: 6 digits, valid 10 minutes, 5 tries; at most 10 codes per link, one a minute.
- The PIN (a link without an email): 6 digits, made with the link, never emailed and never shown on the claim page. After 5 wrong PINs the link is locked (
claim.pin_locked): nobody can claim it, and your team gets a "Claim link locked" notification. Make a new PIN from the dashboard. The old one stops working and the link is unlocked. Do that too when a PIN reached the wrong person.
The payment carries claim:
| Field | Meaning |
|---|---|
email | Where the link and the codes are emailed |
assets | The other coins it can be received in |
url | The link (the hosted claim page). Share it when there is no email. Shown only to those who may make payouts (an API key with payouts on, an owner or finance member) and in webhooks. Absent in a quote, and in the dashboard's live updates |
pin | A link without an email: the PIN its recipient enters to claim it. Give it apart from the link. Shown where url is |
pin_locked | true once 5 wrong PINs were entered: make a new PIN to unlock it |
expires_at, claimed_at | When the link ends, once funded; when it was claimed |
funded_asset, funded_amount | What it was funded with, when its recipient chose another coin: the payment's asset and amount are then the coin and amount chosen |
emailed, extended | Emails sent so far, and how many times the link was extended |
From the dashboard, the team can email the link again (live only, at most 5 emails in all, an hour apart), extend it (1 to 30 days, at most 3 times), give a link without an email a new PIN, or cancel it like any payment. When it is claimed, payout_item.claimed is sent with the payment as it now is (coin, address and fee chosen). In test mode nothing is emailed: open the link's url yourself; the emailed code is always 000000, and a link without an email takes its pin, as in live mode.
Conversion#
Pay recipients in coins your wallet doesn't hold: with conversion on, every payment in another coin than your convert-from coin is paid from that coin, converted on its way. Keep one coin in the wallet (USDT on Tron, by default), and pay in BTC, ETH, USDC on Ethereum or any payout coin. Turn it on in your payout settings ("convert": "convert", and convert_from, a payout coin, USDT_TRC20 by default), or for one batch or quote (convert and convert_from in its body). Payments in the convert-from coin itself are paid directly; claim links are never converted; the list of payout requests follows your settings.
A converted payment's own fields are in the wallet's coin: asset is the convert-from coin, and amount, fee (what converting costs included) and debit are in it. The recipient's side is in convert, and address is the recipient's address on convert.to's network:
| Field | Meaning |
|---|---|
convert.to | The coin the recipient receives (what the row asked for), with convert.ticker and convert.network for people |
convert.to_amount | What you asked to pay, in that coin |
convert.estimate | What the recipient should receive, at today's rate |
convert.amount_out | What they received, once paid |
- How it is priced. The payment sends the amount's worth, plus what converting costs and a 0.5% buffer for the rate moving, so the recipient receives about the amount asked, usually a little more; the rate when it is sent decides. With the recipient paying the fees, they receive what is left after all of them. A payment under the conversion's smallest amount is
below_minimum; a pair that cannot be converted,conversion_unavailable. A batch with converted payments holds its prices 15 minutes instead of an hour. - How it is sent. Converted payments go one at a time. Should a conversion fail and its coins come back, they come back to your payout wallet and the payment fails, its
fail_reasonsaying how much came back. - In test mode conversions are priced at an example cost ($1 plus 1% of the amount) and paid on paper.
Schedules#
Make the same batch again and again (payroll, a monthly prize, a weekly commission run) with a schedule, set up in the dashboard: its payments, and when it runs.
| Field | Description |
|---|---|
name | Your name for it; each run's batch is named "{name} · {date}" |
cadence | weekly, biweekly (every other week, counted from its first run) or monthly (the default) |
weekday, day | Weekly and biweekly: 0 (Sunday) to 6 (Saturday). Monthly: 1 to 28, or -1 for the month's last day (default 1) |
at, timezone | The time of day, HH:MM (default 09:00), in an IANA time zone (default UTC): the run keeps its wall-clock time across daylight saving changes |
fee_paid_by | merchant or recipient (default: your payout settings') |
auto_submit | Submit each run's batch (approvals and limits apply as to any batch); off, the batch waits quoted for someone to submit it |
remind_days | 0 to 7: that many days before a run your wallet couldn't cover, your team is told what to top up |
items or csv | Its payments, up to 1000, each as in a payout request (claim links included), or a payments file's text |
The payments are checked when the schedule is saved: a wrong row is refused (400 row 3: this address is for Tron, not BNB Smart Chain). Each run makes a batch (source: "schedule", reference schedule-{id}-{YYYY-MM-DD}, each payment's reference with -{YYYY-MM-DD} added, so a run is never made twice), checks and prices it, and submits it when auto_submit is on. Whoever last set the schedule's payments (edited_by) made the batch: someone else approves it. A run that cannot be made is noted in the schedule's last_error, and your team is notified. Each run sends a payout_schedule.run webhook (the schedule without its items); remind_days before a run the wallet couldn't cover, payout_schedule.funding_needed, {"schedule", "shortfall"}, says what to send where.
Pausing a schedule stops its runs; resuming it starts again from the next of its days (runs missed meanwhile are not made). Deleting it keeps the batches it made. A schedule names who made it and last set its payments (created_by, edited_by), with their emails in members, as on a batch. Owners and finance make, change, pause and delete schedules in the dashboard under Pay people.
Approvals and limits#
Your payout settings decide who approves a batch, how much may leave, and how new recipients and API keys are treated. The owner changes them in Pay people › Settings, with their password and two-factor code.
| Setting | Default | What it does |
|---|---|---|
approvals | 0 | How many team members, other than whoever made or submitted the batch, approve it before it is funded: 0, 1 or 2 |
approver_roles | ["owner"] | Who may approve (and reject, and release a new recipient's payment): owner, finance, or both |
two_factor | false | Approving, withdrawing and releasing need the person's two-factor code: someone without two-factor sign-in cannot |
per_payout_max_usd | "0" (none) | The most one payment may be worth: a row over it is over_limit |
batch_max_usd | "0" (none) | The most a batch may take from the wallet (total_usd): submitting a larger one is refused |
daily_max_usd | "0" (none) | The most funded in a UTC day, live only: a batch that would pass it waits until 00:00 UTC (daily_limit) |
new_recipient_hours | 0 (none) | How long a payment to an address you never paid waits after its batch is funded, up to 168 |
api_auto_submit | false | API batches skip approval. A batch made with an API key skips approval when it is submitted, unless it pays a new recipient (the limits still apply) |
api_require_allowlist | false | Only IP-limited API keys pay out. Only API keys limited to IP addresses may make payouts (allowed IPs) |
auto_send_minutes | 0 (send by hand) | Your payout requests send themselves once the oldest valid one has waited this long, 1 to 1440 minutes (auto-send) |
fee_paid_by | "merchant" | Who pays the fees of a batch that does not say: merchant or recipient |
convert | "same_network" | same_network: each payment is paid in its own coin, from the wallet's balance of it. convert: every payment in another coin than convert_from is paid from convert_from, converted on its way |
convert_from | "USDT_TRC20" | The coin conversions are paid from |
Stricter now, looser in 24 hours. A change that tightens a rule (more approvals, a lower limit, a longer wait, two-factor on, an approver role removed, auto-submit off, the IP rule on, auto-send off or longer) is in force at once. One that loosens a rule waits 24 hours (pending_controls, in force from its effective_at), so whoever might take over the account cannot loosen the rules and pay out at once; meanwhile the stricter rule stays in force. A change made while one waits replaces it, and its 24 hours start again. fee_paid_by, convert and convert_from are no safeguards: they change at once.
The approvals are made in the dashboard, by a person: Approve asks for their password and their two-factor code. An API key never approves. With 2 approvals, make sure two people other than the batch's maker can approve.
New recipients and sanctions screening#
New recipients. With new_recipient_hours set, a payment to an address you never paid before (and that is not one of your own payout addresses) waits that long after its batch is funded: it is cooling, until cooling_until. It warns of it while the batch is quoted (new_recipient). A batch made with an API key and paying a new recipient always waits for its approvals, even with api_auto_submit on. An approver can let one go sooner from the dashboard (Release, with their password and code); canceling it keeps its money in the wallet.
Sanctions screening. Every recipient's address is checked against the US Treasury's sanctions list (OFAC's SDN list, the digital currency addresses in it), downloaded again every day. A listed address is refused (sanctioned), its payment is left out, and the refusal is recorded in your audit log. The check runs whenever a batch is quoted, and again when a batch waiting for funds is priced again.
References and retries#
- A batch's
referenceis unique in its mode. A batch made with a reference used already is that batch, with nothing added. - A payment's
reference(an employee's id, a prize's, a withdrawal request's) is unique in its mode across all your batches. A row whose reference another payment carries is kept, butinvalid(duplicate_reference): itsreferencestays empty and the one it asked for is inrefused_reference. Your system never pays the same withdrawal twice. - A payment never sent gives its reference back. When a payment is canceled or fails (a batch canceled or rejected before funding included), its reference moves to
released_referenceand itsreferenceis emptied, so a new payment can carry it. - A payout request's
referenceworks the same way:POST /v1/payoutsagain with it answers200 OKwith the payment that has it, in your list or sent. - Find a payment by your reference with
GET /v1/payouts?reference=.
CSV files#
In the dashboard, a batch can be made from a CSV file of up to 16 MiB and 10,000 rows, under Pay people. Start from the template offered there.
reference,asset,address,amount,name,email,note
payroll-2026-10-ana,USDT_TRC20,TR7mNkucnhLZoJQLLJ6DR88jpLQufWxUJi,1500,Ana Silva,[email protected],October salary
prize-cup-final-1,USDT_BEP20,0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed,250,Player One,,Cup final 1st placeThe first row names the columns, in any order and any case, with spaces or dashes for underscores. asset, address and amount are required (address may be left out when the file has a claim column; its rows with claim set to yes are claim links):
| Column | Also read from | Value |
|---|---|---|
reference | ref, id, external_id, employee_id, player_id | Your id for the payment |
asset | coin, token, currency | A payout coin; or USDT, USDC or DAI with a network column |
network | chain | TRC20, TRC-20 or Tron; BEP20, BEP-20, BSC or BNB Smart Chain; ERC20, ERC-20 or Ethereum |
address | wallet, wallet_address, recipient_address, destination | The recipient's address |
tag | destination_tag, memo_tag | XRP only: a whole number |
amount | value, sum | The amount in the coin |
name, email, note | recipient, recipient_name, full_name; recipient_email; description, memo, comment | Who it is for, and why |
claim | claim_link | yes, y, true, 1 or x: a claim link without an address |
claim_assets | claim_coins | A claim link's other coins, separated by spaces, | or / |
- Commas, semicolons or tabs separate the columns: whichever the header row uses most. Spreadsheet exports with a byte-order mark are read as well. Empty lines are skipped.
- An amount that is not a number becomes 0, which the check refuses (
invalid_amount), so the row shows up rather than vanishing. - The decimal mark is the last of
.and,in the amount:1,500.50and1.500,50are both 1500.50. A lone,is a decimal comma in a file separated by semicolons or tabs, and a thousands separator in a comma-separated file. Spaces and'are ignored. - A payment's
rowis its place in the batch, from 1, in the file's order (not the file's line number).
A file that cannot be read is refused with the reason (the file is empty or not CSV, the header row has no amount column (…), line 7: … extraneous or missing " in quoted-field, the file has no payment, a batch holds at most 10000 payments). Rows may have fewer or more cells than the header row. A batch's page downloads its results as a CSV file, one row per payment with its fee, send_amount and debit, status, tx_id, issues, claim link and conversion; a cell a spreadsheet would read as a formula starts with '.
The API#
Your server sends payout requests with an API key, like payments, and follows each one to the end. The key decides the mode, so a test key makes test payouts, paid from the test wallet on paper. Payouts are off for every key until the owner turns them on. Reading (payouts, batches, the wallet, events) works with any key, read-only ones included. Taking, sending and removing payout requests, quotes and test top-ups need a key with payouts on (payout keys). The owner turns it on in Developers › API keys with their password, and limits the key to your servers' IP addresses there. A key limited so is refused from any other address, on every route. Every route that takes an id answers 404 not found for one of the other mode.
| Method | Path | Key | Response |
|---|---|---|---|
| POST | /v1/payouts | payouts | A payout request: 201 {"item"}; 200 for a reference used already |
| GET | /v1/payouts/inbox | any | Your list: inbox, coverage, items, total, limit, offset |
| POST | /v1/payouts/send | payouts | ids (optional): 200 {"batch"} |
| DELETE | /v1/payouts/{id} | payouts | 200 {"item"} |
| POST | /v1/payouts/{id}/expire-claim | payouts | Test mode: a claim link ended now (test mode). 200 {"item"} |
| GET | /v1/payouts?status=&updated_since=&cursor=&limit= | any | Every payment of the mode, oldest change first (list payments): {"items", "has_more", "next_cursor"} |
| GET | /v1/events?type=&after=&created_after=&limit= | any account key | The mode's events, oldest first (replay): {"events", "has_more"} |
| POST | /v1/payout-quotes | payouts | fee_paid_by, convert, convert_from, items (1 to 100): 200 {"quote", "items"}, nothing kept |
| GET | /v1/payout-batches/{id} | any | One batch (read a batch): 200 {"batch"} |
| GET | /v1/payouts/{id}, /v1/payouts?reference= | any | A payment, by its id or your reference: 200 {"item"} |
| GET | /v1/payout-wallets | any | 200 {"wallets"} |
| POST | /v1/payout-wallets/{asset}/simulate-top-up | payouts, test key | amount: 200 {"wallets"} (in test mode) |
Batches are made in the dashboard under Pay people, typed, pasted or uploaded as a CSV file, and payout requests come over the API. Approvals, withdrawals, schedules and the payout settings stay with your team in the dashboard too, behind each person's sign-in. A payment by your reference (GET /v1/payouts?reference=) is the one that carries it now or, if none does, the latest that gave it back (canceled, failed or expired, with it as released_reference), so you always learn what became of a request sent with it.
List payments
GET/v1/payouts?status=&updated_since=&cursor=&limit=· any key
Every payment of the key's mode, whatever its batch (requests in your list, removed ones, every batch's), oldest change first: to bring your system back in sync after it was down, or to check it is. status takes statuses, comma-separated (sent,failed,canceled,expired for the ended ones); updated_since an RFC 3339 time; cursor the next_cursor of the page before; limit 1 to 200 (50 by default). Read with updated_since the first time, then with cursor while has_more, and keep the last next_cursor for next time. Changes of the last few seconds are left for the next read, so a cursor never skips one. A bad parameter answers 400 (updated_since must be an RFC 3339 time, such as 2026-10-20T09:00:00Z, limit must be 1 to 200, cursor is not one this API gave).
{
"items": [ { "id": "5c7e9a1b3d5f7a9c1e3b5d7f", "reference": "wd-88231", "status": "sent", "updated_at": "2026-10-20T14:31:12.6Z", "…": "…" } ],
"has_more": true,
"next_cursor": "MjAyNi0xMC0yMFQxNDozMToxMi42WnwyYzVlN2E5YjFkM2Y1YTdjOWUxYjNkNWY"
}Quote payments
POST/v1/payout-quotes· a key with payouts on
What up to 100 payments would cost, checked and priced exactly as in a batch, without keeping anything: use it to show a recipient their fee before they ask for a withdrawal. The body takes fee_paid_by, convert, convert_from and items, each item with the fields of a payout request. quote holds the totals a batch of them would have (livemode, fee_paid_by, convert, convert_from, totals, total_usd, counts), and items the payments as they would be, each with its fee and issues, and no id, merchant_id, batch_id or times.
curl -s https://api.payitgo.co/v1/payout-quotes \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"fee_paid_by": "recipient", "items": [{"asset": "USDT_BEP20", "address": "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed", "amount": "120"}]}'Read a batch
GET/v1/payout-batches/{id}· any key
200 OK with {"batch": batch}, the batch your list became when you sent it, or one your team made in the dashboard. 404 not found for another mode's batch. A batch waiting for a top-up says exactly what to send, and where.
{
"batch": {
"id": "6a1f3c8e2d9b4a7051c3e8f2",
"status": "awaiting_funds",
"waiting": {
"reason": "funds",
"note": "top up the payout wallet: 122.202417 USDT_TRC20 on Tron (TRC-20), 251.26183421 USDT_BEP20 on BNB Smart Chain (BEP-20)",
"since": "2026-10-20T09:16:40.12Z",
"shortfall": [
{ "asset": "USDT_TRC20", "network": "Tron (TRC-20)", "amount": "122.202417", "address": "TMkq7dZ3vN8xR2pB6cH9sJ4fL1wY5tGaQe" },
{ "asset": "USDT_BEP20", "network": "BNB Smart Chain (BEP-20)", "amount": "251.26183421", "address": "0x8F3a6B2c9D1e4F7a0B5c8D2e6F9a1B4c7D0e3F6a" }
]
},
"approvals_needed": 0,
"submitted_at": "2026-10-20T09:16:40.09Z",
"…": "…"
}
}The batch object
| Field | Meaning |
|---|---|
id, merchant_id, livemode | The batch, your account, and false for a test batch |
reference, name | Your id for it, unique in its mode, and your name for it ("" when none) |
source | api, dashboard, csv, requests (made of payout requests) or schedule (a schedule's run) |
inbox, open | Made of payout requests; open: your list of payout requests itself (one per mode), never submitted, never listed among batches |
created_by, by_api_key | The team member who made it, the API key's id, auto-send, or requests for the list; and whether an API key made it |
fee_paid_by, webhook_url, convert, convert_from | Who pays the fees; where its events go instead of your account's URL; its conversion rule |
status, waiting | Its status; while awaiting_funds: reason, note, since, and for funds the shortfall (asset, network, amount, address) |
totals | Its payments that go, per coin: asset, ticker, icon_url, chain, network, items, amount, send_amount, fee, debit, debit_usd, saved_usd |
counts | Its payments by status: total, invalid, ready, cooling, queued, sending, sent, failed, canceled, claimable, expired |
total_usd, quote_expires_at | What it takes from the wallet, in dollars; when its prices stop holding |
approvals_needed, approvals, rejection | Approvals it needs (set when submitted); who approved it and when; {"by", "at", "reason"} once rejected |
submitted_by, submitted_at, funded_at, completed_at, canceled_by, canceled_at | Who submitted it (a member's id or a key's) and the times of each step |
members | The emails of the team members it names (created_by, submitted_by, approvals, rejection.by, canceled_by), by id, as they were when each acted. A member who left stays named; API keys, auto-send and the platform are not in it ({} when no member acted) |
created_at, updated_at |
The payment object
| Field | Meaning |
|---|---|
id, merchant_id, batch_id, livemode | The payment, your account, its batch (your list's id while it is a payout request waiting there; absent for a request removed from the list) |
reference, refused_reference, released_reference | Your id for it; one refused because another payment carries it; one given back once it is canceled or failed (references) |
row, recipient | Its place in the batch, from 1; name, email, note as you gave them |
asset, chain, ticker, icon_url | The coin and its network; what people call it and its icon |
address, tag | The recipient's address, as it is sent to (an EVM address in its checksummed form), and a destination tag |
amount, send_amount, debit | What you asked to pay, what reaches the recipient, and what it takes from the wallet |
fee | Everything charged on it: the platform fee, the network fee and any conversion fee, as one sum, in the coin |
usd_rate, amount_usd | The coin's dollar price when it was priced, and amount in dollars, to the cent |
status, errors, warnings | Its status and issues ([] when none) |
cooling_until | A new recipient's payment waits until then |
tx_id, explorer_url, sent_at | Its transaction once sent (made up in test mode), on the block explorer (live only), and when |
fail_reason | Why it failed |
cancel_reason, cancel_note | Why it was canceled: removed (taken out of your list of payout requests), canceled (that payment alone, by your team or a key), batch_canceled, rejected (with the approver's reason as cancel_note), or invalid (no longer payable when its batch was submitted or funded: errors say why) |
canceled_by, canceled_at, members | Who canceled it (a team member's id, an API key's id, or system: Payitgo itself) and when; the team member's email by id, as on a batch |
webhook_url | Where its events go instead of its batch's webhook_url or your account's URL |
claim, convert | A claim link's state; a converted payment's other side |
fee_credit | The fee given back for a payment never sent, taken off your next batch's fees in its coin |
created_at, updated_at |
Before it is checked (validating) and when it is invalid, its fee and dollar figures are "0".
Webhooks#
Each step of a batch and of each payment raises a webhook, signed like every other with the secret of its mode. A payment made with its own webhook_url (a payout request, or a batch row) sends its events there; otherwise a batch made with webhook_url sends its batch and payment events there; otherwise they go to your account's URL of the mode, where withdrawals and schedules always go. Taking a payout request raises no event (the answer says it all); from then on, its payment raises the events below.
| Event | Sent when | data |
|---|---|---|
payout_batch.quoted | Checked and priced: made, payments added or removed, quoted again | Batch |
payout_batch.pending_approval | Submitted; it waits for approvals | Batch |
payout_batch.approved | Its last approval came: it is funded next, or waits | Batch |
payout_batch.rejected | An approver refused it (rejection.reason) | Batch |
payout_batch.awaiting_funds | It cannot be funded yet: waiting says why. Sent again whenever the reason changes; a batch the wallet covers at once goes straight to processing | Batch |
payout_batch.processing | Funded: its fees and payments are being sent | Batch |
payout_batch.completed | Funded, and every payment is sent, failed, canceled or expired (counts) | Batch |
payout_batch.canceled | Canceled before it was funded: by your team or a key, or by Payitgo (canceled_by: "system": a send of requests that could not be submitted, or nothing left that could be paid) | Batch |
payout_item.processing | A payout request left your list for a batch (sent from the dashboard, the API or auto-send): batch_id is the new batch | Payment |
payout_item.returned | A sent payout request came back to your list: its batch could not be submitted, or it was no longer valid when priced again (status invalid, errors say why). Not final | Payment |
payout_item.sent | A payment is on chain (tx_id) | Payment |
payout_item.failed | A payment was given up (fail_reason); its money stays in the wallet | Payment |
payout_item.canceled | A payment was canceled before it was sent, whatever canceled it: cancel_reason (removed, canceled, batch_canceled, rejected with cancel_note, invalid) and canceled_by say why and who | Payment |
payout_item.claimed | A claim link was claimed: the payment with the coin, address and fee its recipient chose | Payment |
payout_item.claim_expired | A claim link ended unclaimed; its money is free in the wallet again | Payment |
payout_schedule.run | A schedule ran: its batch was made (last_batch_id), or last_error says why not | The schedule, without its items |
payout_schedule.funding_needed | remind_days before a run the wallet couldn't cover | {"schedule", "shortfall"} |
payout_wallet.withdrawn | A withdrawal reached your payout address (tx_id) | Withdrawal |
payout_wallet.withdrawal_failed | A withdrawal could not be sent (fail_reason); its money stays in the wallet | Withdrawal |
A claim link's payment in a payout_item.* event carries its link, claim.url, and for a link without an email its PIN, claim.pin (your server may hand them to the recipient, apart).
Staying in sync#
Every payment you ask for, a payout request or a batch row, ends in exactly one final state, and you hear it once, whoever acted on it: your system, a member of your team in the dashboard (removing it, rejecting or canceling its batch), or Payitgo (a payment no longer payable).
| Final status | Event | What to do in your system |
|---|---|---|
sent | payout_item.sent | Mark it paid (tx_id) |
failed | payout_item.failed | Not paid: its money is in your wallet. Request it again if you still want to pay it |
canceled | payout_item.canceled | Not paid, never will be (cancel_reason). Give your client their money back, or request it again |
expired | payout_item.claim_expired | A claim link nobody claimed |
A payout request also tells you when it leaves your list (payout_item.processing) and when it comes back (payout_item.returned). A batch row is in its batch from the start: its batch's events say how the batch goes.
- At least once, recorded once. A payment's event is recorded with the change itself, so it is never lost, even if Payitgo stops at that moment; it is then sent within minutes. It keeps its
idhowever often it is sent: deduplicate on the event'sid. - In any order. Events can arrive out of order (retries, several at once): act on the payment's
statusand its latestupdated_at, never on the order they arrive in. A final status never changes again. - Replay what you missed.
GET /v1/eventslists every event of the mode, as it was sent, from any point: after an outage, read from the last event you handled. - Check the whole picture.
GET /v1/payoutslists your payments by last change, whatever their batch. - Canceled stays canceled. A canceled payment is never brought back: to pay it after all, send a new request (its reference is free again).
In test mode#
A test key (or the dashboard's test mode) works with your test payout wallet: other addresses than the live ones, with balances on paper. Nothing is ever read from or sent on a chain.
- Top it up with a click:
POST /v1/payout-wallets/{asset}/simulate-top-upwith a test key that has payouts on, or Add test funds in the dashboard's test mode, addsamount(over 0, up to 10,000,000) to its paper balance, and funds any test batch waiting for it. The answer is{"wallets": […]}. - Batches are checked and priced as live ones, with the same fees, but recipients' addresses are not read on chain: no
new_holder,activationorcontract_recipientissues. The daily limit does not apply. - Fees and payments are sent on paper, within seconds: each payment gets a made-up
tx_id(64 hex characters, on no chain, with noexplorer_url), the paper balance goes down, and the webhooks are sent as live, with"livemode": false. - Every network works on paper, Bitcoin, Litecoin, Dogecoin and XRP included. Withdrawals go to a test payout address, on paper too.
- Claim links email no one: open the link's
urlyourself; the code is always000000. Conversions are priced at an example cost ($1 plus 1%) and paid on paper. - Payout requests sent with a test key wait in your test list, apart from the live one, and are sent the same way.
curl -s https://api.payitgo.co/v1/payout-wallets/USDT_TRC20/simulate-top-up \
-H "Authorization: Bearer $PAYITGO_TEST_KEY" \
-H 'Content-Type: application/json' \
-d '{"amount": "1000"}'A live key gets 400 only a test wallet is topped up on paper: use a test key; a coin payouts do not pay in, 400 payouts in SHIB_ERC20 are not available yet; an amount out of range, 400 amount must be over 0 and at most 10000000.
Limits#
| What | Limit |
|---|---|
| Payments in a batch | 10,000 |
| Payout requests waiting in your list | 100,000; up to 10,000 go in each send |
| Checked while the call waits | 100: a larger batch is checked in the background (validating) |
| Payments in a quote | 100 |
| A quote's prices | Hold for an hour (15 minutes with converted payments) |
| The smallest payment | $1 |
| Payments in one transfer | 50; one transfer at a time per wallet and network |
| Speed | One transfer every 15 seconds per network, from one wallet: about 240 payments an hour; on Bitcoin, Litecoin and Dogecoin one transfer pays up to 200 |
| A CSV file | 16 MiB |
allowed_ips | 20 addresses or ranges per key |
| A simulated top-up | 10,000,000 of the coin per call |
| A claim link | Works 14 days after funding; extended up to 3 times (1 to 30 days); up to 5 emails; 10 other coins |
| A schedule | 1000 payments |
Every step is in your audit log, with who did it and the figures before and after (payout_batch.*, payout_request.*, payout_requests.sent, .returned, .removed, payout_item.*, payout_schedule.*, payout_wallet.*, payout_controls.*, api_key.updated).
Currencies#
A coin is named by its token symbol: USDT_TRC20 is USDT on Tron, USDT_BEP20 is USDT on BNB Smart Chain, BTC is Bitcoin. Use the symbol in a payment's token or tokens; case does not matter.
What your customers may pay with is the list below, narrowed to the tokens you accept. GET /v1/tokens returns that list for your key's mode, with each token's network fee and minimum right now.
Live mode
| Token | Network (chain) | Lowest minimum | Final after |
|---|---|---|---|
USDT_TRC20 | Tron (tron) | $1 | 20 blocks (about 1 min) |
TRX | Tron (tron) | $1 | 20 blocks (about 1 min) |
ETH | Ethereum (ethereum) | $5 | 12 blocks (about 3 min) |
USDT_ERC20 | Ethereum (ethereum) | $5 | 12 blocks (about 3 min) |
USDC_ERC20 | Ethereum (ethereum) | $5 | 12 blocks (about 3 min) |
DAI_ERC20 | Ethereum (ethereum) | $5 | 12 blocks (about 3 min) |
SHIB_ERC20 (opt-in) | Ethereum (ethereum) | $5 | 12 blocks (about 3 min) |
PEPE_ERC20 (opt-in) | Ethereum (ethereum) | $5 | 12 blocks (about 3 min) |
BNB | BNB Smart Chain (bsc) | $1 | 12 blocks (about 1 min) |
USDT_BEP20 | BNB Smart Chain (bsc) | $1 | 12 blocks (about 1 min) |
USDC_BEP20 | BNB Smart Chain (bsc) | $1 | 12 blocks (about 1 min) |
ETH_BEP20 | BNB Smart Chain (bsc) | $1 | 12 blocks (about 1 min) |
BTC | Bitcoin (bitcoin) | $5 | 3 blocks (30 to 60 min) |
LTC | Litecoin (litecoin) | $2 | 6 blocks (about 15 min) |
DOGE | Dogecoin (dogecoin) | $1 | 6 blocks (about 6 min) |
XRP | XRP Ledger (xrp) | $1 | 1 ledger (seconds) |
Opt-in coins (the memecoins) are off for your account until you turn them on (accepted tokens).
"Final after" is when a deposit counts as final: the payment moves from detecting to confirmed once its deposits have that many confirmations.
- Prices. Stablecoins (
USDT_*,USDC_*,DAI_ERC20) are priced at exactly $1. Every other token is priced from live market data when the coin is set, and that rate (rate_locked) holds for the payment's 15 minutes. - Minimums. The minimums above are each token's lowest. Unless your customers pay the fees, a payment must also be worth twice the token's network fee, which moves with the network.
minimuminGET /v1/tokensis the minimum right now, and a payment under it is refused with400 minimum payment in … is $… right now (network fees)(in your currency:… is 4.50 EUR right now …). - Choosing. Stablecoins on BNB Smart Chain cost cents to move, and so does
ETH_BEP20, Ether on BNB Smart Chain, for customers who hold their ETH there (many exchanges withdraw it that way).USDT_TRC20is what most customers hold, but every Tron token transfer burns energy, so its network fee is a few dollars. Ethereum's fee varies the most with how busy the network is. The customer also pays their own wallet's fee to send. - XRP payments must carry their
destination_tag.
Names and icons
Wherever the API names a coin for people, it gives its name ("Tether"), ticker ("USDT", the symbol without its network), network ("Tron (TRC-20)") and icon_url. On a payment these are token_name, token_ticker, network and token_icon_url. Show the network next to the coin: the same coin exists on several networks.
icon_url is an SVG image, GET /coins/{symbol}.svg (https://api.payitgo.co/coins/USDT_TRC20.svg): the coin's round logo, and for a token its network's coin as a small badge (USDT on Tron wears Tron's). It is drawn 34 by 34 for a 30-wide coin, the badge overhanging the corner, and may be shown at any size. No key is needed, and it is cached for a day. A coin Payitgo adds later comes with its own icon, so a page that draws coins from these fields needs no change for it.
Test mode
Test mode offers the same coins as live, DOGE included, with the same minimums, network fees, fee notes, network names and confirmations, so your integration moves to live unchanged. No coins move in test mode, and no faucet is needed: a test payment is paid by the outcome you simulate, and Payitgo plays its deposits and confirmations in seconds.
Never send real coins to a test address
m or n), which real wallets refuse. Nothing watches a test address (why).Test mode#
Test mode is a full copy of Payitgo with no coins: the same API, the same webhooks and the same checkout. Build your whole integration with your test key, then go live by swapping in the live key and the live webhook secret. The dashboard shows each key with a Test or Live badge (its livemode): the key's text does not say.
A test payment gets an address, an amount and a deadline like a live one, but nothing watches a blockchain for it. You choose what happens to it instead: simulate an outcome, and Payitgo plays the deposits, status changes and webhooks a few seconds apart, exactly as live coins would. You never need test coins, a faucet or a wallet.
What is separate#
| Test key | Live key | |
|---|---|---|
| Payments | Test payments only; "livemode": false | Live payments only; "livemode": true |
| Order ids | A test order_id never collides with a live one | |
| Coins | None: you simulate what the customer sends | Real coins on mainnet |
| Webhook | The test webhook: its own URL and its own secret | The live webhook: its own URL and secret |
| Money | Your test balance, never paid out; direct settlement to a test payout address completes on paper | Your balance, or your live payout addresses once in use (another or a changed one after 24 hours) |
| Mass payouts | A test payout wallet with balances on paper, topped up with a click; batches sent on paper (below) | Your payout wallet on seven networks, topped up with real coins |
| Dashboard | Switch the dashboard to test mode to see test data | The default |
A test key reading a live payment gets 404, and the other way round.
Simulate a payment#
There are three ways to choose an outcome:
- When you create the payment, add
"simulate". With atoken, the simulation starts at once, and so doesexpired. Otherwise it starts when the customer chooses the coin on the checkout page (or you set it withPOST /v1/payments/{id}/token). - Later, on a payment you already have:
POST /v1/payments/{id}/simulate, where{id}is the payment id or yourorder_id. The answer is the payment, with itssimulationstarted (or, before its coin is chosen,requested: it starts once the coin is chosen). The libraries call itpayments.simulate(id, outcome). - From a payment page:
POST /checkout/{checkout_token}/simulatetakes the same body, with no key, for test payments only. Use it from your own payment page to put “simulate” buttons on a test payment.
curl -s https://api.payitgo.co/v1/payments \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"order_id": "ORD-2001", "amount": "20", "token": "USDT_TRC20", "simulate": "confirmed"}'
curl -s -X POST https://api.payitgo.co/v1/payments/c41e7a9d2b05f3e8a6d17c90/simulate \
-H "Authorization: Bearer $PAYITGO_KEY" \
-H 'Content-Type: application/json' \
-d '{"outcome": "partially_paid"}'The payment shows its simulation, and so does every webhook it sends:
{
"id": "9e3a858c7701308142d545f9",
"order_id": "ORD-2001",
"status": "pending",
"token": "USDT_TRC20",
"deposit_address": "TPk2bpQqWRpXiaUHS9SXnZCDgvwrsuJ71o",
"livemode": false,
"simulation": { "outcome": "confirmed", "state": "running" },
"…": "…"
}state is requested (asked for on create, waiting for the coin), running or done.
Outcomes#
| outcome | What happens | Webhooks, in order |
|---|---|---|
confirmed | The exact amount arrives and confirms | payment.detecting, payment.confirmed |
overpaid | 5% more than due arrives | payment.detecting, payment.confirmed with "overpaid": true |
partially_paid | Half of what is still due arrives. The payment stays open: simulate again to pay the rest, or let it run out | payment.partially_paid |
underpaid | Half arrives, then the deadline passes | payment.partially_paid, payment.underpaid |
expired | Nothing arrives, and the deadline passes now | payment.expired (payment.underpaid if it was partially paid) |
failed | The amount arrives, then its transaction is dropped | payment.detecting, payment.failed, with the deposit's fail_reason (deposits[].fail_reason) |
wrong_asset | The amount arrives in another coin on the same network (TRX for USDT on Tron, USDC for USDT on BSC…) | payment.wrong_asset. With accept other assets on: payment.detecting, payment.wrong_asset, payment.confirmed |
paid_late | Half arrives, the deadline passes, then the rest arrives | payment.partially_paid, payment.underpaid, payment.detecting, payment.late_deposit, payment.confirmed with "paid_late": true |
paid_twice | The exact amount arrives and confirms, then the customer pays the same again | payment.detecting, payment.confirmed, then payment.late_deposit; the payment is overpaid |
Each step comes about 5 seconds after the one before, and its webhook is posted within about 5 seconds of it, so a whole simulation is over in less than half a minute. Two events of the same step (payment.detecting and payment.late_deposit, say) can reach you in either order, as live ones can.
The rules
- Only test payments can be simulated: a live key gets
400 only test payments can be simulated: use a test key. - The payment must be
pendingorpartially_paid, and have its coin (except forexpired). - One simulation runs at a time: another request gets
409. Once it isdone, you can run another, for examplepartially_paidand thenconfirmedto pay the rest. wrong_assetneeds a coin on Tron, Ethereum or BNB Smart Chain: a Bitcoin, Litecoin, Dogecoin or XRP address only receives its own coin. Asked for on create, it needstoken.
| Status | Error | Cause |
|---|---|---|
| 400 | outcome is required | No outcome in the body, or the body is not JSON |
| 400 | simulate must be one of: confirmed, overpaid, … | An unknown outcome |
| 400 | only test payments can be simulated: use a test key | A live payment, or simulate with a live key |
| 400 | choose the payment's coin first | No coin yet, for anything but expired |
| 400 | this payment is confirmed: only a pending or partially paid payment can be simulated | The payment is closed or confirming |
| 400 | a BTC address only receives BTC: wrong_asset needs a coin on Tron, Ethereum or BNB Smart Chain | wrong_asset on a coin that has no other on its network |
| 400 | simulate wrong_asset needs the payment's coin: pass token | wrong_asset on create without token |
| 404 | payment not found | No such payment for your key's mode (or, for a storefront's key, for its store) |
| 409 | a simulation is already running for this payment | Wait for its done |
What a simulated payment looks like#
A simulated deposit is like a live one, with "simulated": true. Its tx_id looks like a transaction hash (64 hex characters) but is on no chain, so it has no explorer_url. Tell a simulated deposit by its simulated, never by its tx_id:
"deposits": [
{ "tx_id": "f916492ece53d1cb5bab9515cfed47d17648649cbd8e52b5a45f6e4da6e6fdf9", "token": "USDT_TRC20", "chain": "tron",
"amount": "20", "value": "20", "counted": true, "status": "confirmed", "simulated": true, "…": "…" }
]Everything after it works as live:
- The payment's confirmations,
crypto_received,amount_received,overpaidandpaid_lateare worked out the same way. - Each deposit is settled when it is final (the parts of a payment paid in parts together, once it closes), into your test balance with the same fees as live (settlement in test mode). With direct settlement and a test payout address, the settlement completes at once and sends
settlement.completed; nothing is sent to the address. - Coins are never converted in test mode: a deposit settles in the coin that arrived, into your test balance when you have no test payout address for it.
- Payment links, customers, analytics and notifications all count test payments in the dashboard's test mode.
Mass payouts in test mode#
Mass payouts work in test mode end to end, with no coins and nothing on chain. Your test payout wallet has its own addresses, other than the live ones, and its balances are on paper:
- Top it up with a click. In the dashboard's test mode, press Add test funds on Pay people, or call
POST /v1/payout-wallets/{asset}/simulate-top-upwith a test key that haspayoutson and{"amount": "1000"}, up to 10,000,000 a call. A test batch waiting for funds is funded at once when it covers it. - Batches are checked and priced as live ones, with the same fees and limits, except that recipients' addresses are not read on chain and the daily limit does not apply.
- Fees and payments are sent on paper, a few seconds apart: each payment becomes
sentwith a made-uptx_id(noexplorer_url), and every webhook is sent as live, with"livemode": false. Withdrawals go to a test payout address, on paper too. - Claim links email no one: open the payment's
claim.urlyourself and confirm with the code000000. Conversions are priced at an example cost ($1 plus 1% of the amount) and paid on paper. - Make a payment fail: give it
"simulate": "failed"(the network refuses it: no fee) or"failed_after_broadcast"(its transaction failed on chain: its network fee is spent), in the API, a CSV'ssimulatecolumn or the dashboard's Test outcome. It endsfailedwithpayout_item.failed, as a live one would. Live payments refuse it. - End a claim link now:
POST /v1/payouts/{id}/expire-claim(or the drawer's Expire now) expires a test link at once:payout_item.claim_expired, its money free again. - Make a withdrawal fail:
"simulate": "failed"on a test withdrawal (the dashboard's Make it fail):payout_wallet.withdrawal_failed, its money staying in the wallet.
More in Mass payouts: in test mode. Never send real coins to a test payout wallet address: nothing reads it.
Never send real coins to a test address#
Scenarios to test#
Create a test payment for each, and check what your server receives.
| Scenario | How | What you should see |
|---|---|---|
| Normal payment | confirmed | payment.detecting, then payment.confirmed |
| Partial, then completed | partially_paid, then confirmed once it is done | payment.partially_paid, then payment.detecting, payment.confirmed |
| Underpaid | underpaid | payment.partially_paid, then payment.underpaid |
| Expired | expired, or create a payment and simulate nothing | payment.expired (15 minutes later without a simulation, an hour if no coin was chosen) |
| Overpaid | overpaid | payment.confirmed with "overpaid": true |
| Late completion | paid_late | payment.underpaid, then payment.late_deposit and payment.detecting, then payment.confirmed with "paid_late": true |
| Paid twice | paid_twice | payment.confirmed, then payment.late_deposit; the payment is overpaid |
| Dropped transaction | failed | payment.detecting, then payment.failed |
| Wrong asset | wrong_asset | payment.wrong_asset; the deposit counts only with accept other assets on |
| XRP | Create with "token": "XRP" and simulate | The payment has its destination_tag; show it as prominently as the address |
| Customer chooses the coin | Create without token, with simulate; choose on the checkout page | token_options, then an address after the choice, then the outcome's webhooks |
| Retry safety | Create the same order_id twice | The second call returns the first payment with 200 |
| Per-payment URL | Create a payment with webhook_url and simulate | Its notifications go to that URL, not the account's |
| A mass payout batch | Top up the test wallet, send a few payout requests (POST /v1/payouts) with a test key, then send the list (POST /v1/payouts/send) | payout_batch.processing, a payout_item.sent per payment and payout_batch.completed |
| A bad request | Request a USDT (BNB Smart Chain) payout to a Tron address | The answer is the payment, invalid with wrong_network, so you can tell your client at once |
| A payout retry | Send the same payout request reference twice | The second call returns the first payment with 200 |
| A claim link | Top up the test wallet, send a payout request with "claim": true, an email and no address, then send the list; open its claim.url and claim it with the code 000000 | The payment claimable, then payout_item.claimed and payout_item.sent |
| Payout requests | Top up the test wallet, POST /v1/payouts a few times with a test key, GET /v1/payouts/inbox, then POST /v1/payouts/send | Each request ready with its fees, the list's coverage, then a batch (source: "requests") submitted and sent, with its webhooks |
| A request the wallet cannot pay | POST /v1/payouts with a test key while the test wallet is empty | 400 with the top-up to simulate; nothing is added to the list |
| A request's round trip | Top up the test wallet, request payouts with a test key, send them | payout_item.processing for each, then payout_item.sent; each event once, with your reference |
| A rejected request | Turn on 1 approval in Pay people › Settings, request and send, then reject the batch in the dashboard | payout_item.canceled for each request, cancel_reason: rejected with the reason as cancel_note |
| Removing a request | DELETE /v1/payouts/{id} on a request in your list | The payment canceled (cancel_reason: removed) with payout_item.canceled; the same call again changes nothing |
| Catching up | GET /v1/events?type=payout_item.* | Every event above, oldest first, as your endpoint received them |
Test your webhook handler too:
| Scenario | How | What you should see |
|---|---|---|
| Signature check | POST /v1/webhook/test, and verify the ping | Your handler answers 200 |
| Tampering | Change one byte of a captured body and send it to your handler | Your handler answers 400 |
| Retries | Answer 500 once | The same notification again a minute later, with X-Webhook-Attempt: 2 |
| Duplicates | Redeliver a delivery from the dashboard | Your handler recognises the event id and does nothing twice |
| Test vs live | Look at livemode | Your production handler ignores "livemode": false |
Going live#
- The account owner goes live in the dashboard, under Developers › Go live. They confirm their email with the link Payitgo sent, add a live payout address, see a test payment through, then press Go live.
- With the live key, read the live webhook secret (
GET /v1/webhook) and set the live URL (PUT /v1/webhook). - Put the live key and the live webhook secret on your production server. Remove any
simulatefrom your payment requests: a live key refuses it. - Check that your handler fulfils only
"livemode": trueevents in production. - Add a live payout address for each coin you accept, under Balance › Payout addresses, so payments reach your wallet as they are. A coin you have none for is converted into one you have, which costs more. Your first live address of a coin is used at once; another, or a changed one, after 24 hours.
- Make one small real payment end to end.
Account and team#
Your team, stores, settings, balances and payouts are managed in the dashboard, signed in as a person. Your servers only ever need an API key and the /v1 routes.
Team and roles#
The owner invites colleagues with the role they need; each signs in with their own email and password. Adding someone, or inviting them, takes an owner who confirmed their email with the link emailed at signup (until then: 403 confirm your email first: …). Every new member is emailed a link to confirm their own email too.
| Role | Can |
|---|---|
owner | Everything: team, settings, live mode, the audit log, rolling the webhook secret, payouts, the referral program; the payout settings, withdrawals from the payout wallet, and letting an API key make payouts |
developer | API keys (but not letting one make payouts), stores, the webhook URL and test, redelivering webhooks |
finance | Payout addresses and payouts, the referral program, mass payout batches (make, submit, cancel; approve when the payout settings let finance approve) |
viewer | Reads payments, the dashboard, balances, the ledger, settlements and webhook deliveries; changes nothing |
Every role can read payments, balances, settlements, payouts, mass payout batches, the payout wallet and webhook deliveries. Each person can do only what their role allows. Selling from several shops? Create a store for each and give each its own API keys. Each store has its own order ids, so two shops on one account can both number their orders from 1.
Your logo#
Put your brand in front of every customer. Your logo leads the hosted checkout and your payment links, beside your business name, so customers know exactly whom they are paying. The owner uploads it in Settings › Account, drags and zooms to frame it, and it is live at once. Selling from several shops? Give each store its own logo, and its payments show it instead. A store without one shows your business logo.
Use a PNG, JPEG, WebP or GIF image at least 64 pixels on each side. We keep the square you choose, scale it to 256 × 256 pixels and compress it, so your checkout stays fast on any connection. Only the image itself is kept, never a photo's location or camera details. Owners upload, change or remove logos in Settings › Account.
Payment settings#
The owner changes them in Settings › Payments. A payment keeps the settings in force when it was created.
| Setting | Default | What it does |
|---|---|---|
underpaid_tolerance_bps | 50 (0.5%) | How far short a payment may fall and still count as paid, 0 to 2000 (20%) (wrong amounts) |
accept_other_assets | false | Accept other coins toward a payment. Whether a deposit in another accepted coin counts toward the payment at its value (wrong asset) |
settlement | direct | direct, custodial or scheduled (where the money goes) |
payout_schedule | daily | Scheduled settlement: instant, daily or weekly (on Mondays) |
fees_paid_by_customer | true (a new account) | Whether the customer pays the service and network fees on top of your price (passing fees on) |
convert_into | cheapest | Direct settlement: what a coin you have no payout address for is converted into: cheapest, order or a coin (which coin); "" sets the default |
hide_below_minimum | false | Direct settlement, fees passed on: false offers a coin converted across networks even for a payment too small for the exchange's minimum (the customer pays up to it, you receive the extra: amount_extra); true offers it only from the price that reaches the minimum (minimums) |
enabled_tokens | every token but the memecoins | The coins you accept, at least one |
Accepted tokens. Only the coins in enabled_tokens are offered to your customers, listed by GET /v1/tokens and allowed in a payment's token or tokens (others get 400 not enabled for your account: …). A deposit in a coin you have not enabled still reaches you, but never counts toward the payment. Until you choose, you accept every token except the memecoins (SHIB_ERC20, PEPE_ERC20), including tokens Payitgo adds later. The memecoins are off until you add them: their price can move several percent within the hour, and with direct settlement you receive what a payment is worth when it settles. Saving exactly the default list keeps accepting tokens Payitgo adds later; a list with a memecoin in it is kept as you saved it. Settings › Payments lists every supported token, accepted or not, with its fee and minimum right now and where its payments go (your wallet or your balance, and for a coin converted on its way to your wallet, the coin it becomes).
Balances and payouts#
- Balances. In custody (and scheduled settlement), what a payment leaves after the fees is credited to your balance, always in USDT on Tron. Test payments credit your test balance, which is never paid out. Your ledger, under Statements, lists every movement, a deposit's fees as one
feesentry. Referral commissions are not part of this balance: they make your referral balance, paid out on its own. - Payout addresses are your wallets: where payouts go and, with direct settlement, where each coin's payments are sent. Add one for each coin you accept: that coin's payments are then sent to you as they arrive, with no conversion, at the lowest fee for your customers; a coin without one is converted into one of your payout coins first, and costs them more (why). Owners and finance add them in Balance › Payout addresses (the password is asked again). A coin's first live address is used at once; another, or a changed one, 24 hours later (
active_at), and payments due to it wait for it meanwhile (how); test addresses at once, and nothing is ever sent to them. Adding or changing a live USDT address on Tron can come back with awarning: the first USDT sent to a Tron wallet costs more in network fees, so send a wallet that has never held USDT a little first. - Payouts are live only. Owners and finance request one in Balance, to a live payout address, $10 or more. The amount is held from your balance at once and the network fee of sending it comes out of it. Payitgo reviews each payout:
requested→approved→sent, orrejected(by Payitgo) orcanceled(by you, while still requested), which return the amount to your balance. Each step Payitgo takes raises apayout.*webhook to your live URL. - USDT on any network. USDT is worth $1 on every network, so a USDT balance is paid out to any of your USDT payout addresses: your custody balance, held in USDT on Tron, to your USDT address on BNB Smart Chain or Ethereum as well. The server picks the balance (the address's own coin when it has enough, else another USDT balance that has, USDT on Tron first), and the payout's
from_tokenandfrom_chainsay which. Sending USDT costs about a cent on BNB Smart Chain and a few dollars on Tron; on Ethereum it varies with how busy the network is. A payout in USDT on BNB Smart Chain or Ethereum is sent by Payitgo itself, usually within minutes of its approval. Before you confirm one, Balance shows the network fee right now, the minimum, what would arrive and the balance it draws on. - Automatic payouts. With direct settlement, what stays in your balance is paid out automatically: Payitgo pays a USDT balance, all of it, to your USDT address on BNB Smart Chain that direct settlement uses (past its
active_at), else to the one on Ethereum, for a network fee of about a cent on BNB Smart Chain. The payout hasrequested_by: "auto". A balance under $10 waits, and without such an address you request payouts as usual. Custody is paid out on request, and scheduled settlement on its schedule.
These payouts pay your balance to you. Paying your own recipients from a payout wallet you top up is mass payouts, below.
Referral program#
Share your referral link from Referrals (owner or finance). A business that opens an account through it is your referral, and each of its live payments earns you 25% of what Payitgo earns on it: its fees, less what sending the payment cost on the network (gas, energy). 30% once you have 5 active referrals (whose payments earned you a commission in the last 30 days), for 5 years from each referral's signup. Conversion fees are not shared, and a payment whose network costs took all its fees earns nothing. Your commissions show what you earned, never your referrals' payment amounts or fees: those are their business. Test payments earn nothing, and nor does referring yourself: an account sharing a live payout address with yours has its referral voided.
- Referral balance. Each commission is credited in USDT on Tron once the payment is settled (its network cost known then), to a referral balance of its own, which your account's balances, ledger and payouts never include. Referrals shows it (available, waiting to be paid, paid out and earned in all) with your code, link, terms and figures.
- Referral payouts. Ask for all of your available referral balance, or part of it, from $50, to one of your live USDT on Tron payout addresses (your default unless you pick another) or to any other Tron address you give with your password. The network fee, fixed when you ask, comes out of it, and Payitgo pays it within 5 business days.
- One open at a time. A payout is
requested, thenprocessingandpaid(with itstx_id). Onerejectedby Payitgo (with a note), orcanceledby you while stillrequested, gives the amount back to your available balance. Owners and finance are notified of each request, payment and rejection.
The program is live only, and run by owners and finance from Referrals, which updates the moment your referral balance or a payout changes.
Errors & rate limits#
Every error, on every route, is JSON with one field, error, and an HTTP status that says what kind of error it is. Branch on the status and log the message: messages are for developers and may be reworded, so do not match on their text or show them to customers.
HTTP/1.1 400 Bad Request
Content-Type: application/json
X-Request-Id: Rz8vKm3pWq6tXc1nLb9sHd4fJg7yAe2M
{"error": "minimum payment in USDT_TRC20 is $6.44 right now (network fees)"}Every response carries an X-Request-Id header: quote it when you contact support.
| Status | Meaning | Typical causes | Retry? |
|---|---|---|---|
| 200 | Done | A read, an update, or POST /v1/payments returning the order's open payment | |
| 201 | Created | A new payment or payout request | |
| 202 | Queued | A webhook test or a redelivery: it is sent within seconds | |
| 400 | The request is invalid | A missing or malformed field, an unsupported token, an amount under the minimum, a webhook URL that is not https | No: fix it |
| 401 | Not authenticated | missing api key, invalid api key (unknown, mistyped or revoked) | No: fix the key |
| 403 | Not allowed | Live key while live mode is off, a suspended account, a read-only key writing, a storefront key changing the webhook, a key without payouts making a mass payout, a key used from an address not in its allowed_ips, a blocked customer | No |
| 404 | No such thing | An unknown id, a payment of the other mode, an order with no open payment, an unknown route | No |
| 409 | Clashes with the current state | Changing the coin of a payment once something arrived, simulating a test payment while its simulation runs, removing a payout request that was sent already, a full list of payout requests | No |
| 413 | Body over 1 MiB | No | |
| 429 | Over the rate limit | See below | Yes, after a short wait |
| 500 | Something failed on Payitgo's side | payment creation failed, could not set the webhook… | Yes, with backoff |
| 503 | Temporarily unavailable | exchange rate unavailable for currency (a price in another currency than the dollar): nothing was created | Yes, shortly |
Rate limits#
Every route is rate limited, per API key or per visitor, so one runaway client never slows anyone else down. The limits sit well above what any integration needs. Go past one and you get 429 rate limit exceeded. Wait a moment and retry, backing off a little more each time (the official libraries do it for you). Webhooks make polling unnecessary for almost every integration.
Retrying safely#
On a 5xx or a network error, retry with exponential backoff (1 s, 2 s, 4 s… up to a minute); the libraries retry twice on their own. These are safe to repeat: POST /v1/payments with the same order_id and key (you get the open payment back), POST /v1/payouts with the same reference (the payment that has it, 200), PUT and DELETE /v1/webhook, and every GET. POST /v1/webhook/test is harmless to repeat, but each call sends one more ping.
- Requests are JSON with
Content-Type: application/json: without that header the body is not read. Unknown fields in requests are ignored. - Amounts are decimal strings in responses (
"49.9"): parse them with a decimal type, not a float. Requests accept a number or a string. - Times are RFC 3339 in UTC, with a varying number of fractional digits.
- Optional fields are left out when empty, and new fields may appear at any time: parse leniently.
- Ids are opaque strings: store and compare them whole, and never read meaning into their shape. An id is 24 lowercase hex characters (
6710c3a1f2b4e5d6a7b8c9d0), whatever it is: a payment, a settlement, an event, an API key. API keys and webhook signing secrets are 64 hex characters; they do not say their mode either (a key'slivemodedoes). - Lists take
limit(1 to 200, default 50) andoffset, and returntotal.
Service status#
How every part of Payitgo is doing is public, on the status page and as JSON with no credentials. Each part is monitored around the clock, from the API and the hosted checkout to payment detection on each network and payouts.
GET/status· No authentication
curl https://api.payitgo.co/status{
"status": "operational",
"updated_at": "2026-10-24T20:31:00Z",
"groups": [
{
"id": "networks",
"name": "Payment networks",
"components": [
{
"id": "bitcoin",
"name": "Bitcoin",
"description": "Payment detection and confirmations",
"status": "operational",
"since": "2026-10-24T08:02:00Z"
}
]
}
],
"events": []
}statusisoperational,degraded(working, more slowly) oroutage, for the whole platform (its worst part) and for each component.eventsare the times a part was not operational over the last 30 days, newest first, withstatus(the worst it got to),started_atandended_at(nullwhile it goes on). Componentallis the whole platform being unreachable.
GET/status/history· No authentication
The last 90 days (UTC), oldest first. For each component, its minutes operational, degraded and in an outage on each day, and uptime, the share of the recorded minutes it was working, as a percentage rounded down. Both answer from memory, so poll them as often as once a minute.
Libraries#
Official libraries wrap the API for Node.js, Python, PHP, Go and Dart. They all create and read payments, simulate test payments, list coins, manage your webhook URL, verify webhook notifications in one call, and call the public checkout API. From version 0.6.0 they also make mass payouts: send payout requests (with claim links and conversion) and the list of them, and read batches, payments and the payout wallet. Field names are the API's own, so everything above applies. Use them on your server: they need your secret key. Two exceptions need none: Dart's PayitgoCheckout, made for Flutter apps, and the React checkout widget. A WooCommerce shop needs no code: use the WooCommerce plugin.
| Language | Install | Import |
|---|---|---|
| Node.js / TypeScript | npm install @payitgo/node | import { Payitgo } from "@payitgo/node" |
| Python | pip install payitgo | import payitgo |
| PHP | composer require payitgo/payitgo-php | use Payitgo\Client; |
| Go | go get github.com/payitgo/go-sdk | import payitgo "github.com/payitgo/go-sdk" |
| Dart / Flutter | dart pub add payitgo | import 'package:payitgo/payitgo.dart'; |
| React (widget) | npm install @payitgo/react | import { PayitgoButton, payitgoCheckout } from "@payitgo/react" |
| Call | Node.js and Dart | Python | PHP | Go |
|---|---|---|---|---|
| Create | payments. | payments. | payments-> | Payments. |
| Read one | payments. | payments. | payments-> | Payments. |
| List | payments. | payments. | payments-> | Payments. |
| Choose the coin | payments. | payments. | payments-> | Payments. |
| Simulate (test keys) | payments. | payments. | payments-> | Payments. |
| Coins on offer | tokens. | tokens. | tokens-> | Tokens. |
| Payout request | payouts. | payouts. | payouts-> | Payouts. |
| Its list, sent | payouts. | payouts. | payouts-> | Payouts. |
| Remove a request, read a payment | payouts. | payouts. | payouts-> | Payouts. |
| List payments | payouts. | payouts. | payouts-> | Payouts. |
| Replay events | events. | events. | events-> | Events. |
| Quote payouts | payouts. | payouts. | payouts-> | Payouts. |
| Read a batch | payoutBatches. | payout_batches. | payoutBatches-> | PayoutBatches. |
| Payout wallet | payoutWallets. | payout_wallets. | payoutWallets-> | PayoutWallets. |
| Webhook URL | webhooks. | webhooks. | webhooks-> | Webhooks. |
| Verify | webhooks. | webhooks. | webhooks-> | Webhooks. |
| Test or live (asks once) | isLive() | is_live() | isLive() | IsLive(ctx) |
| Payer view (no key) | checkout. | checkout. | checkout-> | Checkout. |
| Payer chooses the coin (no key) | checkout. | checkout. | checkout-> | Checkout. |
- Mode. The key decides it; pair each key with the webhook secret of the same mode. The key's text does not say which:
isLive()(is_live()in Python,IsLive(ctx)in Go) asks Payitgo on its first call (GET /v1/webhook'slivemode, allowed for a read-only key) and keeps the answer for the client's life; an error is not kept. A missing or empty key is refused when the client is created, before any request:Errorin Node,ValueErrorin Python,InvalidArgumentExceptionin PHP, an error fromNewClientin Go,ArgumentErrorin Dart. - Base URL. The base URL option is Payitgo's API, default
https://api.payitgo.co: leave it out. It isbaseUrlin Node and Dart (Dart'sPayitgoCheckouttoo),base_urlin Python and PHP,WithBaseURLin Go. Without it, Node, Python, PHP and Go first readPAYITGO_BASE_URLfrom the environment; Dart reads none. - Timeouts. Each attempt may take 30 s by default:
timeoutMsin Node,timeoutin seconds in Python and PHP, aDurationin Dart; in Go, thehttp.Client'sTimeoutand yourctx. Go (WithHTTPClient) and Dart (httpClient) also take your own HTTP client. - Retries. Network errors, timeouts,
429and5xxare retried up to twice (maxRetries,max_retries,WithMaxRetries;0turns it off), after 0.5 s, then 1 s; other statuses are never retried. Every call is safe to repeat: creating a payment again for the sameorder_idreturns its open payment, choosing the coin a payment already has changes nothing (a409means its coin can no longer be changed: read the payment), setting or removing the webhook URL twice changes nothing, and a payout request with areferencereturns the payment that reference already names. - A default webhook URL. Set it on the client (
webhookUrlin Node and Dart,webhook_urlin Python and PHP,payitgo.WithWebhookURL(u)in Go) and every payment the client creates gets that webhook_url; a payment's ownwebhook_urlwins. - Payouts. Reading payout requests, batches, payments and the payout wallet works with any key, read-only ones included; every other payout call needs a key with payouts on, and is otherwise a
403. A test key pays from your test wallet, on paper (top it up withsimulateTopUp,simulate_top_upin Python), and a payment or batch of the other mode is a404. - WooCommerce. A WooCommerce shop needs no code: the Payitgo for WooCommerce plugin adds crypto to its checkout and marks orders paid by itself.
A failed call throws (Go: returns) the library's error, with the API's HTTP status (0 when no answer came, after the retries) and its error message. Branch on the status; log the message. A notification that fails verification throws its own error: answer 400.
| A failed API call | Status, message | A bad signature | |
|---|---|---|---|
| Node.js | PayitgoError | .status, .message | SignatureVerificationError |
| Python | payitgo.PayitgoError | .status, .message | payitgo.SignatureVerificationError |
| PHP | PayitgoException | ->status, ->getMessage() | SignatureVerificationException (both in Payitgo\Exception) |
| Go | *payitgo.Error (errors.As) | .Status, .Message | payitgo.ErrSignature (errors.Is) |
| Dart | PayitgoException | .status, .message | SignatureVerificationException |
Each library verifies a notification in constant time against the raw body and refuses a timestamp more than 5 minutes from your clock. To verify without a client, or with another tolerance:
| Without a client | Another tolerance | |
|---|---|---|
| Node.js | Payitgo.webhooks.constructEvent(body, sig, secret) | 4th argument, in seconds |
| Python | payitgo.Webhook.construct_event(body, sig, secret) | tolerance= |
| PHP | \Payitgo\Webhook::constructEvent($body, $sig, $secret) | 4th argument, in seconds |
| Go | payitgo.ConstructEvent(body, sig, secret) | payitgo.ConstructEventWithTolerance(…, d) |
| Dart | Webhook.constructEvent(body, sig, secret) | tolerance:, a Duration |
Node.js#
The @payitgo/node package: Node 18+, no dependencies, TypeScript types included, CommonJS and ES modules. Methods return promises.
Install
npm install @payitgo/nodeCreate a client
import { Payitgo, PayitgoError } from "@payitgo/node";
const payitgo = new Payitgo(process.env.PAYITGO_KEY!, { // your test key or live key
webhookSecret: process.env.PAYITGO_WEBHOOK_SECRET, // the signing secret of the key's mode
timeoutMs: 15_000, // per attempt (default 30 s)
maxRetries: 2, // network errors, 429 and 5xx (default 2)
});
await payitgo.isLive(); // false for a test key: asks Payitgo once (GET /v1/webhook), then remembersCreate a payment
const payment = await payitgo.payments.create({
order_id: "ORD-1001",
amount: "49.90",
token: "USDT_TRC20", // or leave it out: payment.token_options lists the choices
customer_email: "[email protected]",
success_url: "https://yourdomain.com/thanks",
});
// Later, on your own page: await payitgo.payments.selectToken(payment.id, "USDT_BEP20")Retrieve and list
const one = await payitgo.payments.retrieve("8f3a2c1e9b7d4a6f05e1c2d3"); // or your order_id
const page = await payitgo.payments.list({ status: "confirmed", limit: 100, offset: 0 });
const coins = await payitgo.tokens.list({ amount: "49.90" });Simulate a test payment
// payments.simulate(id: string, outcome: SimulationOutcome): Promise<Payment>
// A test payment that pays itself: payment.detecting, then payment.confirmed, within half a minute
const payment = await payitgo.payments.create({
order_id: "TEST-1", amount: 10, token: "USDT_TRC20", simulate: "confirmed",
});
console.log(payment.livemode, payment.simulation?.state); // false "running"
// Another outcome on a payment you already have (payment id or order_id):
await payitgo.payments.simulate("TEST-2", "underpaid");Verify a webhook
import express from "express";
const app = express();
// Register before any app.use(express.json()), or the body is parsed and will not verify
app.post("/payitgo/ipn", express.raw({ type: "application/json" }), async (req, res) => {
let event;
try {
event = payitgo.webhooks.constructEvent(req.body, req.get("X-Webhook-Signature"));
} catch {
return res.sendStatus(400); // SignatureVerificationError
}
if (event.livemode === (await payitgo.isLive()) && event.type === "payment.confirmed") {
await markOrderPaid(event.data.order_id, event.data.id); // idempotent, deduplicated on event.id
}
res.sendStatus(200);
});Handle errors
try {
await payitgo.payments.create({ order_id: "ORD-1", amount: 1, token: "BTC" });
} catch (err) {
if (err instanceof PayitgoError && err.status === 400) {
console.warn("Payitgo refused:", err.message); // e.g. an amount under the coin's minimum
} else {
throw err; // status 0 = no answer (after the retries), 401, 403, 404, 409, 429, 5xx
}
}Make payouts
// A client asks to withdraw: checked and priced at once, kept in your list of payout requests
const item = await payitgo.payouts.request({
reference: "wd-1042", // your id for it: the same reference again returns this payment
asset: "USDT_TRC20",
address: "TR7mNkucnhLZoJQLLJ6DR88jpLQufWxUJi",
amount: "120",
name: "Ana Silva",
});
if (item.status === "invalid") {
console.log(item.errors.map((e) => `${e.code}: ${e.message}`)); // wrong_network: this address is for …
} else {
console.log(`the client receives ${item.send_amount}, the wallet gives ${item.debit} ${item.ticker}`);
}
// Later: send every valid request as one batch, approved and funded like any batch
const batch = await payitgo.payouts.send();Python#
Published as payitgo, imported as payitgo: Python 3.8+, standard library only. Responses are PayitgoObjects: dicts with the API's own keys that also read as attributes (use .get() for optional ones). The client is synchronous and safe to share across threads; in async code call it from a plain def route or with asyncio.to_thread.
Install
pip install payitgoCreate a client
import os
import payitgo
client = payitgo.Client(
os.environ["PAYITGO_KEY"], # your test key or live key
webhook_secret=os.environ["PAYITGO_WEBHOOK_SECRET"], # the signing secret of the key's mode
timeout=15, # seconds per attempt (default 30)
max_retries=2, # network errors, 429 and 5xx (default 2)
)
client.is_live() # False for a test key: asks Payitgo once (GET /v1/webhook), then remembersCreate a payment
payment = client.payments.create(
order_id="ORD-1001",
amount="49.90",
token="USDT_TRC20", # or leave it out: payment.token_options lists the choices
customer_email="[email protected]",
success_url="https://yourdomain.com/thanks",
)
# Later, on your own page: client.payments.select_token(payment.id, "USDT_BEP20")Retrieve and list
one = client.payments.retrieve("8f3a2c1e9b7d4a6f05e1c2d3") # or your order_id
page = client.payments.list(status="confirmed", limit=100, offset=0)
coins = client.tokens.list(amount="49.90")Simulate a test payment
# client.payments.simulate(payment_id, outcome) -> PayitgoObject
# A test payment that pays itself: payment.detecting, then payment.confirmed, within half a minute
payment = client.payments.create(order_id="TEST-1", amount=10, token="USDT_TRC20", simulate="confirmed")
print(payment.livemode, payment.simulation.state) # False running
# Another outcome on a payment you already have (one of payitgo.SIMULATION_OUTCOMES):
client.payments.simulate("TEST-2", "underpaid")Verify a webhook
from flask import Flask, request
app = Flask(__name__)
@app.post("/payitgo/ipn")
def ipn():
try:
event = client.webhooks.construct_event(
request.get_data(), # the raw bytes, before any JSON parsing
request.headers.get("X-Webhook-Signature"),
)
except payitgo.SignatureVerificationError:
return "", 400
if event.livemode == client.is_live() and event.type == "payment.confirmed":
mark_order_paid(event.data.order_id, event.data.id) # idempotent, deduplicated on event.id
return "", 200Handle errors
try:
client.payments.create(order_id="ORD-1", amount=1, token="BTC")
except payitgo.PayitgoError as e:
if e.status == 400:
log.warning("Payitgo refused: %s", e.message) # e.g. an amount under the coin's minimum
else:
raise # status 0 = no answer (after the retries), 401, 403, 404, 409, 429, 5xxMake payouts
# A client asks to withdraw: checked and priced at once, kept in your list of payout requests
item = client.payouts.request("USDT_BEP20", "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed", "120",
"wd-1042", name="Ben Okafor")
if item.status == "invalid":
reject_withdrawal(item.errors[0].message) # e.g. "this address is for Tron, not BNB Smart Chain"
else:
print("fee", item.fee, "they receive", item.send_amount)
# Later: send every valid request as one batch
batch = client.payouts.send()
if batch.status == "awaiting_funds" and batch.waiting.reason == "funds":
for s in batch.waiting.shortfall:
print(f"top up {s.amount} {s.asset} at {s.address}") # it starts by itself once fundedPHP#
The payitgo/payitgo-php Composer package: PHP 8.1+ with the curl and json extensions, PSR-4 namespace Payitgo\. Responses are arrays with the API's own keys.
Install
composer require payitgo/payitgo-phpCreate a client
<?php
require __DIR__ . '/vendor/autoload.php';
$payitgo = new \Payitgo\Client(getenv('PAYITGO_KEY'), [ // your test key or live key
'webhook_secret' => getenv('PAYITGO_WEBHOOK_SECRET'), // the signing secret of the key's mode
'timeout' => 15, // seconds per attempt (default 30)
'max_retries' => 2, // network errors, 429 and 5xx (default 2)
]);
$payitgo->isLive(); // false for a test key: asks Payitgo once per client (GET /v1/webhook)Create a payment
$payment = $payitgo->payments->create([
'order_id' => 'ORD-1001',
'amount' => '49.90',
'token' => 'USDT_TRC20', // or leave it out: $payment['token_options'] lists the choices
'customer_email' => '[email protected]',
'success_url' => 'https://yourdomain.com/thanks',
]);
// Later, on your own page: $payitgo->payments->selectToken($payment['id'], 'USDT_BEP20');Retrieve and list
$one = $payitgo->payments->retrieve('8f3a2c1e9b7d4a6f05e1c2d3'); // or your order_id
$page = $payitgo->payments->list(['status' => 'confirmed', 'limit' => 100, 'offset' => 0]);
$coins = $payitgo->tokens->list('49.90');Simulate a test payment
// public function simulate(string $id, string $outcome): array
// A test payment that pays itself: payment.detecting, then payment.confirmed, within half a minute
$payment = $payitgo->payments->create([
'order_id' => 'TEST-1', 'amount' => 10, 'token' => 'USDT_TRC20', 'simulate' => 'confirmed',
]);
var_dump($payment['livemode'], $payment['simulation']['state']); // bool(false) string(7) "running"
// Another outcome on a payment you already have (one of \Payitgo\Payments::SIMULATION_OUTCOMES):
$payitgo->payments->simulate('TEST-2', 'underpaid');Verify a webhook
<?php
// ipn.php
use Payitgo\Exception\SignatureVerificationException;
try {
$event = $payitgo->webhooks->constructEvent(
file_get_contents('php://input'), // the raw body (Laravel: $request->getContent(), and exempt the route from CSRF)
$_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? null,
);
} catch (SignatureVerificationException) {
http_response_code(400);
exit;
}
if ($event['livemode'] === $payitgo->isLive() && $event['type'] === 'payment.confirmed') {
markOrderPaid($event['data']['order_id'], $event['data']['id']); // idempotent, deduplicated on $event['id']
}
http_response_code(200);Handle errors
use Payitgo\Exception\PayitgoException;
try {
$payitgo->payments->create(['order_id' => 'ORD-1', 'amount' => 1, 'token' => 'BTC']);
} catch (PayitgoException $e) {
if ($e->status !== 400) {
throw $e; // status 0 = no answer (after the retries), 401, 403, 404, 409, 429, 5xx
}
error_log('Payitgo refused: ' . $e->getMessage()); // e.g. an amount under the coin's minimum
}Make payouts
// A client asks to withdraw: checked and priced at once, kept in your list of payout requests
$item = $payitgo->payouts->request([
'reference' => 'wd-1042', // the withdrawal's id in your system
'asset' => 'USDT_TRC20',
'address' => 'TR7mNkucnhLZoJQLLJ6DR88jpLQufWxUJi',
'amount' => '120',
'name' => 'Ana Silva',
]);
if ($item['status'] === 'invalid') {
foreach ($item['errors'] as $issue) {
echo $issue['code'], ': ', $issue['message'], PHP_EOL; // invalid_address: …
}
}
// Later: send every valid request as one batch
$batch = $payitgo->payouts->send();
if ($batch['status'] === 'awaiting_funds' && ($batch['waiting']['reason'] ?? '') === 'funds') {
foreach ($batch['waiting']['shortfall'] as $s) {
echo "top up {$s['amount']} {$s['asset']} at {$s['address']}", PHP_EOL; // it starts by itself once there
}
}Go#
Go 1.21+, standard library only. Import it with the name payitgo (the path ends in go). Every call takes a context.Context, which bounds the whole call, retries included, and returns an error last: check it before the result. A *Client is safe for concurrent use.
Install
go get github.com/payitgo/go-sdkCreate a client
import payitgo "github.com/payitgo/go-sdk"
client, err := payitgo.NewClient(os.Getenv("PAYITGO_KEY"), // your test key or live key
payitgo.WithWebhookSecret(os.Getenv("PAYITGO_WEBHOOK_SECRET")), // the signing secret of the key's mode
payitgo.WithHTTPClient(&http.Client{Timeout: 15 * time.Second}), // per attempt (default 30 s)
payitgo.WithMaxRetries(2), // network errors, 429 and 5xx (default 2)
)
if err != nil {
log.Fatal(err)
}
live, err := client.IsLive(ctx) // false for a test key: asks Payitgo once (GET /v1/webhook), then remembersCreate a payment
payment, err := client.Payments.Create(ctx, &payitgo.PaymentParams{
OrderID: "ORD-1001",
Amount: "49.90",
Token: "USDT_TRC20", // or leave it out: payment.TokenOptions lists the choices
CustomerEmail: "[email protected]",
SuccessURL: "https://yourdomain.com/thanks",
})
// Later, on your own page: client.Payments.SelectToken(ctx, payment.ID, "USDT_BEP20")Retrieve and list
one, err := client.Payments.Get(ctx, "8f3a2c1e9b7d4a6f05e1c2d3") // or your order_id
page, err := client.Payments.List(ctx, &payitgo.ListParams{Status: payitgo.StatusConfirmed, Limit: 100})
coins, err := client.Tokens.List(ctx, &payitgo.TokenListParams{Amount: "49.90"})Simulate a test payment
// func (s *PaymentsService) Simulate(ctx context.Context, id, outcome string) (*Payment, error)
// A test payment that pays itself: payment.detecting, then payment.confirmed, within half a minute
payment, err := client.Payments.Create(ctx, &payitgo.PaymentParams{
OrderID: "TEST-1", Amount: "10", Token: "USDT_TRC20", Simulate: payitgo.OutcomeConfirmed,
})
if err != nil {
return err
}
fmt.Println(payment.Livemode, payment.Simulation.State) // false running
// Another outcome on a payment you already have (a payitgo.Outcome… constant):
if _, err := client.Payments.Simulate(ctx, "TEST-2", payitgo.OutcomeUnderpaid); err != nil {
return err
}Verify a webhook
func ipn(w http.ResponseWriter, r *http.Request) {
body, err := io.ReadAll(http.MaxBytesReader(w, r.Body, 1<<20)) // the raw bytes
if err != nil {
w.WriteHeader(http.StatusBadRequest)
return
}
event, err := client.Webhooks.ConstructEvent(body, r.Header.Get("X-Webhook-Signature"))
if err != nil {
w.WriteHeader(http.StatusBadRequest) // errors.Is(err, payitgo.ErrSignature)
return
}
live, err := client.IsLive(r.Context()) // asks Payitgo once, then remembers
if err != nil {
w.WriteHeader(http.StatusInternalServerError) // Payitgo retries
return
}
if event.Livemode == live && event.Type == payitgo.EventPaymentConfirmed {
p, err := event.Payment()
if err == nil {
err = markOrderPaid(r.Context(), p.OrderID, p.ID) // idempotent, deduplicated on event.ID
}
if err != nil {
w.WriteHeader(http.StatusInternalServerError) // Payitgo retries
return
}
}
w.WriteHeader(http.StatusOK)
}Handle errors
_, err := client.Payments.Create(ctx, &payitgo.PaymentParams{OrderID: "ORD-1", Amount: "1", Token: "BTC"})
var perr *payitgo.Error
if errors.As(err, &perr) && perr.Status == http.StatusBadRequest {
log.Printf("Payitgo refused: %s", perr.Message) // e.g. an amount under the coin's minimum
} else if err != nil {
return err // Status 0 = no answer (after the retries), 401, 403, 404, 409, 429, 5xx
}Make payouts
// A client asks to withdraw: checked and priced at once, kept in your list of payout requests
item, err := client.Payouts.Request(ctx, &payitgo.PayoutParams{
Reference: "WD-7731", // your id for it: the same reference again returns this payment
Asset: "USDT_TRC20",
Address: "TR7mNkucnhLZoJQLLJ6DR88jpLQufWxUJi",
Amount: "120",
Name: "Ana Silva",
})
if err != nil {
return err
}
if item.Status == payitgo.PayoutItemInvalid {
return fmt.Errorf("refused: %s", item.Errors[0].Message) // kept in the list, never sent
}
// Later: top up what the list needs, then send it as one batch
inbox, err := client.Payouts.Inbox(ctx, nil)
if err != nil {
return err
}
for _, c := range inbox.Coverage {
if c.TopUp != "0" {
log.Printf("send %s %s to %s", c.TopUp, c.Asset, c.Address)
}
}
batch, err := client.Payouts.Send(ctx) // every valid requestDart & Flutter#
The payitgo package for Dart 3 (Flutter 3.10+), on every platform (it does not import dart:io); it depends on http and crypto. Two clients: Payitgo with your secret key, for your server; and PayitgoCheckout, with no key, for Flutter apps.
Install
dart pub add payitgo # Dart
flutter pub add payitgo # FlutterCreate a client
import 'dart:io';
import 'package:payitgo/payitgo.dart';
final payitgo = Payitgo(
Platform.environment['PAYITGO_KEY']!, // your test key or live key
webhookSecret: Platform.environment['PAYITGO_WEBHOOK_SECRET'], // the signing secret of the key's mode
timeout: const Duration(seconds: 15), // per attempt (default 30 s)
maxRetries: 2, // network errors, 429 and 5xx (default 2)
// httpClient: your own package:http client (an IOClient, a MockClient in tests); you close it
);
await payitgo.isLive(); // false for a test key: asks Payitgo once, then remembers; call payitgo.close() when doneCreate a payment
final payment = await payitgo.payments.create(
orderId: 'ORD-1001',
amount: '49.90',
token: 'USDT_TRC20', // or leave it out: payment.tokenOptions lists the choices
customerEmail: '[email protected]',
successUrl: 'https://yourdomain.com/thanks',
);
// Later, on your own page: await payitgo.payments.selectToken(payment.id, 'USDT_BEP20');Retrieve and list
final one = await payitgo.payments.retrieve('8f3a2c1e9b7d4a6f05e1c2d3'); // or your order_id
final page = await payitgo.payments.list(status: 'confirmed', limit: 100, offset: 0);
final coins = await payitgo.tokens.list(amount: '49.90');Simulate a test payment
// Future<Payment> simulate(String id, String outcome)
// A test payment that pays itself: payment.detecting, then payment.confirmed, within half a minute
final payment = await payitgo.payments.create(
orderId: 'TEST-1', amount: '10', token: 'USDT_TRC20', simulate: 'confirmed');
print('${payment.livemode} ${payment.simulation?.state}'); // false running
// Another outcome on a payment you already have (one of Payments.simulationOutcomes):
await payitgo.payments.simulate('TEST-2', 'underpaid');Verify a webhook
import 'package:shelf/shelf.dart';
Future<Response> ipn(Request request) async {
final WebhookEvent event;
try {
event = payitgo.webhooks.constructEvent(
await request.readAsString(), // the raw body, before any JSON parsing
request.headers['x-webhook-signature'],
);
} on SignatureVerificationException {
return Response(400);
}
if (event.livemode == await payitgo.isLive() && event.type == 'payment.confirmed') {
final p = Payment(event.data);
await markOrderPaid(p.orderId, p.id); // idempotent, deduplicated on event.id
}
return Response.ok('');
}Handle errors
try {
await payitgo.payments.create(orderId: 'ORD-1', amount: '1', token: 'BTC');
} on PayitgoException catch (e) {
if (e.status != 400) rethrow; // 0 = no answer (after the retries), 401, 403, 404, 409, 429, 5xx
print('Payitgo refused: ${e.message}'); // e.g. an amount under the coin's minimum
}Make payouts
// A client asks to withdraw: checked and priced at once, kept in your list of payout requests
final item = await payitgo.payouts.request(
reference: 'wd-7731', // required: the same reference again returns this payment
asset: 'USDT_TRC20',
address: 'TR7mNkucnhLZoJQLLJ6DR88jpLQufWxUJi',
amount: '120',
name: 'Ana Silva',
);
if (item.status == 'invalid') {
for (final e in item.errors) print('${e.code}: ${e.message}');
}
// Later: send every valid request as one batch
final batch = await payitgo.payouts.send();
if (batch.status == 'awaiting_funds') {
for (final s in batch.waiting?.shortfall ?? const <PayoutShortfall>[]) {
print('top up ${s.amount} ${s.asset} at ${s.address}'); // it starts by itself
}
}Flutter apps: PayitgoCheckout
Never ship a secret key in an app. Your backend creates the payment and hands the app its checkoutToken; PayitgoCheckout needs no key. It reads the payment and lets the customer choose the coin (selectToken). For updates the moment they happen, follow the payment with the socket (subscribe with the checkout token and an acknowledgement). watch is the fallback for apps that cannot use socket.io: it polls every 5 seconds and emits the payment each time its status changes, including a late payment within 24 hours. For a test payment, checkout.simulate(checkoutToken, outcome) plays an outcome with no key, so the app can show “simulate” buttons under its “Test payment” banner (never for a live payment, which answers 400; requests that come too fast from one visitor answer 429). Your backend still fulfils the order from the webhook.
final checkout = PayitgoCheckout(); // no key: it reads payments from Payitgo's API
// The customer picks a coin from payment.tokenOptions:
final chosen = await checkout.selectToken(checkoutToken, 'USDT_TRC20');
// show chosen.cryptoAmount, chosen.depositAddress, chosen.qrPayload (qr_flutter), chosen.expiresAt
// Test payments only: play an outcome from the app, no key needed
if (!chosen.livemode && chosen.simulation?.state != 'running') {
await checkout.simulate(checkoutToken, 'confirmed');
}
// The fallback when the app cannot use socket.io: polls every 5 seconds
await for (final p in checkout.watch(checkoutToken)) {
if (p.isConfirmed) showPaid();
}
checkout.close(); // when no screen needs it any moreWooCommerce plugin#
Payitgo for WooCommerce adds crypto to a WooCommerce shop's checkout, with no code to write. The customer chooses it, pays on Payitgo's hosted checkout, and comes back to the shop; the order is marked paid once the payment is final.
| Plugin | |
|---|---|
| Download | The zip of the latest release: payitgo-for-woocommerce-X.Y.Z.zip |
| Source | github.com/payitgo/woocommerce |
| Needs | WordPress 6.3+, WooCommerce 8.0+, PHP 7.4+ |
| Checkout | The block checkout and the classic checkout |
| Orders | WooCommerce's order tables (HPOS) or posts |
| Shop currency | Any. The plugin sends the order total as amount with the shop's currency, and the payment reports in it (your currency) |
Install
- Download
payitgo-for-woocommerce-X.Y.Z.zipfrom the latest release and upload it in WordPress (Plugins > Add New > Upload Plugin). Activate it. - Copy a secret key from your dashboard (Developers > API keys), one with full access: the plugin creates payments, and a read-only key cannot. A test key to try it out, a live key for real payments. Several shops on one account: give each the key of its own store (below).
- In WooCommerce > Settings > Payments > Payitgo (crypto), paste the key and enable it.
No webhook to set up
GET /v1/webhook's livemode) and reads your webhook's signing secret with it; an unknown key is reported (“payitgo does not know this secret API key: copy it again from your payitgo dashboard”). When the shop is on https, every payment it creates carries the shop's own notification address as its webhook_url, so each payment tells the shop how it went; otherwise the order-received page reads the payment when the customer comes back. There is nothing to change in your account's webhook settings.Settings
| Setting | Default | |
|---|---|---|
| Title, Description | "Crypto (USDT, BTC, ETH and more)"; "Pay with cryptocurrency on payitgo's secure checkout." | What customers see at checkout |
| Secret API key | None | A test key to try it out, a live key for real payments. Its mode is the plugin's: a test key's payments are simulated |
| Signing secret | Read with the key | Pin one only if you must; otherwise the plugin reads it, and reads it again once if you roll it |
| API address | https://api.payitgo.co | Payitgo's API: leave it as it is |
| Debug log | Off | WooCommerce > Status > Logs, source payitgo. Errors are always logged |
What it sends
When the customer places the order, the plugin creates a payment:
| Field | From the order |
|---|---|
order_id | The order number, as it is: 1234 |
amount, currency | The order total and the shop's currency |
description | The items: 2 x Acme T-shirt, Mug |
customer_email | The billing email |
success_url, cancel_url | The order-received page, and WooCommerce's cancel link |
webhook_url | The shop's notification address, https://<shop>/wc-api/payitgo/, when the shop is on https |
metadata | wc_order_id (how the plugin finds the order), wc_order_number, shop |
The customer is then sent to the payment's checkout_url, where they choose the coin. Paying an order again (after its payment expired) makes a new payment; while one is open, the customer gets that one.
Several shops on one account
Order ids are unique per store. Create a store for each shop (Stores in the dashboard) and give each shop the key of its own store: two shops can then both have an order 1234. Shops that share one key would be given each other's open payment for the same order number: the plugin refuses such a payment, and logs why.
How orders follow the payment
The plugin verifies each notification, ignores one it handled already, one of the other mode, or one for a payment the order did not make, and moves the order by the payment's status:
| Payment | Order |
|---|---|
detecting | On hold: the money arrived, confirmations are pending |
confirmed | Paid (processing, or completed for virtual goods), with the transaction id. On hold instead when the payment was for another amount than the order's total |
partially_paid | A note: the customer can still send the rest |
underpaid | On hold, with what arrived: refund the customer or agree on the rest |
expired, failed | Failed: the customer can pay again from their account |
A deposit in another coin (payment.wrong_asset), or after the payment closed (payment.late_deposit), adds a note. The order-received page also reads the payment, so a shop that notifications cannot reach (not on https, or behind a firewall) learns the outcome when the customer comes back.
Test it
With a test key, the checkout page lets you choose how the payment goes: place an order, choose a coin, and play confirmed: the order goes on hold, then to processing, within seconds. Play expired to see an order fail, then pay it again from the customer's account.
Refunds
Not from WooCommerce yet: send the coins back from your wallet, then mark the order refunded.
React checkout widget (@payitgo/react)#
Shows a payment on your own page, in a modal: the customer chooses the coin, sees the exact amount, network, QR code, address (and XRP destination tag), pays from their wallet, and watches the payment confirm. It needs no key: your server creates the payment and hands the browser its checkout_token; the widget calls the public checkout API and follows the payment live.
The customer can also change the coin before paying: while the payment still has token_options (a coin chosen, nothing arrived), the pay screen has a Change coin button that reopens the list with the chosen coin selected, and “Back” to return. Another coin gets a new address, amount and 15 minutes.
| Package | @payitgo/react |
|---|---|
| Install | npm install @payitgo/react |
| Source | github.com/payitgo/react-sdk |
| Needs | React 18 or 19; it brings qrcode.react and socket.io-client |
| Module | ESM, with TypeScript types. The components are marked 'use client' |
Show a payment
import { PayitgoButton, payitgoCheckout } from "@payitgo/react";
const adapter = payitgoCheckout({
// Ask your own server for the payment and return its checkout_token.
createPayment: async () =>
(await fetch("/orders/42/payitgo", { method: "POST" }).then((r) => r.json())).checkout_token,
});
export function PayButton() {
return (
<PayitgoButton
adapter={adapter}
payment={{ title: "Order #42", amount: { value: 49.9, currency: "USD" } }}
onSuccess={(result) => showThanks(result.paymentId)}
>
Pay with crypto
</PayitgoButton>
);
}createPayment is the widget's only call to your server. Everything else it asks Payitgo directly, at https://api.payitgo.co (the adapter's baseUrl, which you leave out), with no key.
On your server, the route createPayment calls creates the payment with your secret key and answers with its checkout_token:
app.post("/orders/:id/payitgo", async (req, res) => {
const order = await orders.get(req.params.id);
// No token: the customer chooses the coin in the widget.
const payment = await payitgo.payments.create({ order_id: order.id, amount: order.total });
res.json({ checkout_token: payment.checkout_token });
});- Never put a secret key in browser code. The checkout token only shows the payer's view of one payment.
- Each time the widget opens it calls
createPayment()again. While the order has an open payment, creating it again returns that same payment, so a customer who closes and reopens the widget sees the same address and amount. onSuccessruns in the customer's browser and is not proof of payment: fulfil orders from thepayment.confirmedwebhook.- Next.js: render the widget from a client component. The adapter and
onSuccessare functions, which a server component cannot pass down. Nothing renders on the server; the modal opens in the browser.
Without a server: a payment link
A payment link needs no key to pay, so a page without a server of its own can start its payment from the browser:
const adapter = payitgoCheckout({
createPayment: async () => {
const r = await fetch(`https://api.payitgo.co/links/${linkId}/checkout`, { method: "POST" });
const body = await r.json();
if (!r.ok) throw new Error(body.error); // "this payment link can no longer be paid"…
return body.checkout_token;
},
});The adapter
payitgoCheckout(options) connects the widget to Payitgo.
| Option | Required | Description |
|---|---|---|
createPayment | yes | Called when the widget opens (and on "Start again"): asks your server for the payment and returns its checkout_token, as it is |
baseUrl | no | Payitgo's API, where the widget reads the payment: not your server. Default https://api.payitgo.co; leave it out. Trailing slashes are removed |
pollIntervalMs | no | How often to read the payment while the live connection is down. Default 4000 |
fetch | no | For tests, or older runtimes. Default: the global fetch |
Everything it calls (GET /checkout/{token}, POST /checkout/{token}/token, POST /checkout/{token}/simulate and socket.io at /socket.io/, the default namespace) answers any origin, so no proxy is needed. A POST answered 429 is sent again once, a second later. If you put a proxy in front of the gateway anyway, it must forward WebSocket upgrades on its /socket.io/ path: a plain HTTP rewrite cannot carry the WebSocket (the widget then polls instead).
What the adapter throws is a PayitgoError: the API's message (capitalised) and the HTTP status, 0 when the gateway could not be reached. The widget shows them itself, with a way to try again.
Components
PayitgoCheckout is the modal itself, controlled: render it anywhere, it portals to document.body while open. PayitgoButton is a button that opens it: it takes every PayitgoCheckout prop except open, plus children (the label, default "Pay with crypto"), className, style, disabled and onClose.
| Prop | Required | Description |
|---|---|---|
open | yes | PayitgoCheckout only |
onClose | yes | Escape, the close button, a click outside, or “Done” |
payment | yes | Display text: title, amount: { value, currency: "USD" }, and optionally description, period, badge, lineItem, due. Once loaded, the amount shown is the payment's own |
adapter | no | payitgoCheckout({…}). Default: demoAdapter, an offline simulation for previews and design work |
onSuccess | no | Once, when the payment is confirmed: { paymentId, status: "confirmed", token, amount, txId }, amount a decimal string in token |
theme | no | { mode?: "dark" | "light", accent?: string }: dark by default; accent is any CSS colour |
returnLinks | no | Show the payment's success_url and cancel_url as "Back to the shop" links. Default false: on your own page, closing the modal is the way back |
const [open, setOpen] = useState(false);
<button onClick={() => setOpen(true)}>Pay</button>
<PayitgoCheckout
open={open}
onClose={() => setOpen(false)}
adapter={demoAdapter}
payment={{ title: "Pro plan", amount: { value: 49, currency: "USD" } }}
theme={{ accent: "#5b3df5", mode: "dark" }}
onSuccess={(result) => console.log(result.paymentId)}
/>Test payments
A test payment shows a "Test payment" banner and buttons that play what the customer does, through the real processing: deposits, status changes and your webhooks (pay in full, overpay, pay half, underpay, let it expire, drop the transaction, pay in another coin, pay late). Live payments never show them.
Custom adapters
PayitgoAdapter is an interface: start(payment) returns a checkout token; get(checkoutToken) and chooseToken(checkoutToken, token) return the payment as GET /checkout/{token} does. Two optional methods turn on more: subscribe(checkoutToken, { onPayment, onConnection, onNotFound }) follows the payment live (it returns the function that stops), and simulate(checkoutToken, outcome) shows the simulate buttons on test payments. Without subscribe, the widget polls get() every pollIntervalMs.
Content Security Policy
The widget adds one <style> element the first time it opens and styles some elements inline: style-src must allow 'unsafe-inline'. connect-src must allow the gateway, over https: and wss:, and img-src should allow it too: the coin icons are the gateway's (icons). A blocked icon falls back to the one the widget draws itself.
demoAdapter, so you can click through every screen without paying.