Merchant API

API documentation

Everything you can do in the dashboard's projects, from your own server: create payments, deposit wallets, trackers and payouts, and read what happened to them. Every request comes as a ready function in cURL, JavaScript, TypeScript, Python, PHP and Go.

Overview

Your account is organised in projects. A project belongs to one service (Deposit Wallets, One-Time Payments, Wallet Tracker or Payouts) and has its own API key. The key decides what a request works on: it can only use the endpoints of its project's service and only sees that project's data.

The API answers on https://api.lirchain.com. Requests and answers are JSON.

Request
GET /merchant/ping
x-api-key: YOUR_API_KEY

Every endpoint below shows its request as code you can copy and run: a cURL command, and a function with a call to it in JavaScript, TypeScript, Python, PHP and Go. Pick a language in any sample and all of them switch to it. Put your API key in place of YOUR_API_KEY.

AI coding agents

The API is built to be easy to integrate with a coding agent such as Claude Code, Cursor, GitHub Copilot or ChatGPT. The whole reference is one markdown file an agent can read in a single request, so it writes the integration from the real endpoints and fields instead of guessing them.

Paste this into your agent and change the goal to what you are building:

Prompt for your coding agent
Read https://lirchain.com/llms-full.txt and integrate LirChain into this project.

Goal: [give every user their own USDT deposit address and credit their balance when a deposit arrives].

Keep the API key in an environment variable named LIRCHAIN_API_KEY, never in the frontend.
Add a webhook endpoint for the events and make it safe to receive the same event twice.

Authentication

Send the project's API key in the x-api-key header of every request.

To get a key, open the project in the dashboard and press Refresh API key. The key is shown once: we only keep a hash of it. Refreshing it again makes the previous key stop working.

Keep the key on your server. Anyone who has it can act as that project. For the same reason the API sends no CORS headers: it is meant to be called from a server, not from code running in a browser.

Networks and assets

Deposit wallets, one-time payments and payouts work on Ethereum, BNB Chain and Polygon. The wallet tracker also reads Tron, Solana and Bitcoin. On the first three, payments and deposit wallets accept these assets. Send asset as the symbol, or as the contract address for a token, in any letter case. USDT and USDC are dollars one to one. A network's own coin (ETH, BNB, POL) can be sent to a deposit wallet only: it is exchanged into dollars when it arrives. One-time payments and payouts are in USDT and USDC only.

An asset is always a token on one network. In answers, asset is the symbol and contract is the token's contract address on that network (all zeros for the network's own coin), next to network.

NetworknetworkAssetContractServices
EthereumethereumUSDT0xdac17f958d2ee523a2206206994597c13d831ec7All
EthereumethereumUSDC0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48All
EthereumethereumETHthe network's own coinAll
BNB ChainbscUSDT0x55d398326f99059ff775485246999027b3197955All
BNB ChainbscUSDC0x8ac76a51cc950d9822d68b83fe1ad97b32cd580dAll
BNB ChainbscBNBthe network's own coinAll
PolygonpolygonUSDT0xc2132d05d31c914a87c6611c10748aeb04b58e8fAll
PolygonpolygonUSDC0x3c499c542cef5e3811e1192ce70d8cc03d5c3359All
PolygonpolygonPOLthe network's own coinAll
BitcoinbitcoinBTCthe network's own coinWallet tracker only
SolanasolanaUSDTEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYBWallet tracker only
SolanasolanaUSDCEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1vWallet tracker only
SolanasolanaSOLthe network's own coinWallet tracker only
TrontronUSDTTR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6tWallet tracker only
TrontronUSDCTEkxiTehnzSmSe2XqrBj4w32RUN966rdz8Wallet tracker only
TrontronTRXthe network's own coinWallet tracker only

A transfer is counted once it is 12 blocks deep, so deposits and paid payments appear shortly after the transaction, not instantly.

Requests and lists

POST requests take a JSON body with the content-type: application/json header. GET and DELETE requests take their values in the query.

Lists come in pages of 50. Ask for a page with ?page= (the first page when it is left out). Every list has the same shape:

{
  "items": [ ... ],
  "page": 1,
  "total_pages": 3
}

Ids are UUIDs. Times ending in _ms are milliseconds since 1970. Addresses are lowercase.

When you create a payment, a deposit wallet or a tracker you can send an external_id: your own id for it, such as your user id or order id. We do not use it. It comes back wherever the payment, wallet or tracker does, and in the webhooks about it, so you can match them to your own records. It is null when you did not send one.

Errors

A request that fails answers with a status code and a JSON body with one field, message.

{
  "message": "plan limit reached"
}
400
The request is not valid: a field is missing, an id is not an id, or the network and asset are not supported.
401
The API key header is missing.
402
Your balance is too low for the payout and its fee.
403
The key is unknown, belongs to a project of another service, or the plan does not allow it (no active plan, or a limit is reached).
404
The path does not exist, or the project has nothing with that id.
429
Too many requests. The retry-after header says how many seconds to wait.
500
Something went wrong on our side.
503
Wallets cannot be created right now. Try again later.

Rate limits

Every project can make 300 read requests (GET) and 60 write requests (POST, DELETE) per minute. The x-ratelimit-remaining header of every answer says how many are left in the current minute.

Past the limit the answer is 429, with a retry-after header saying how many seconds to wait. Requests with an unknown key are limited much more strictly, per IP address.

These limits are about how fast you call the API. How many wallets, payments and trackers you can have is set by your plan.

Fees and balance

You have one balance, in dollars. Everything your customers pay is added to it once the transfer is confirmed: every deposit to a deposit wallet and every transfer to a one-time payment. USDT and USDC count one to one. The plan, the fees, payouts and withdrawals are taken from it. You withdraw from the dashboard, as USDT or USDC on the network you choose.

Every operation costs a percentage of its amount, set by your plan: 1% on Free, 0.5% on Starter, 0.375% on Business, 0.25% on Enterprise. A fee is never less than $0.10. An operation is a deposit to a deposit wallet, a transfer to a one-time payment, a payout or a withdrawal. The fee field of a deposit, a payment or a payout shows what was charged for it.

For money coming in, the amount is added to your balance and the fee is taken from it. For a payout or a withdrawal, the fee is taken on top of the amount, and both come back only if it cannot be sent.

A deposit in a network's own coin (ETH, BNB or POL) is exchanged into USDT on that network's main exchange before it is added to your balance, usually within a few minutes, longer on Ethereum while gas is expensive. Nothing is added before the exchange is confirmed. The exchange keeps about 0.3%. What it paid out is what the deposit is worth (pay_amount), and our fee is taken from that. We add nothing else on top.

A deposit worth less than $1 does not count: it is not added to your balance and not charged a fee. A one-time payment and a payout must be for at least $1.

Wallet tracker events have no fee, and creating wallets, payments and trackers is free. A plan reports a number of tracker events per 30 days. When they are used, tracking pauses until the next period or a bigger plan.

Webhooks

Set a webhook URL in the project's settings in the dashboard and we send a POST request with a JSON body to it when something happens in the project. The URL must start with https://.

deposit-wallet
A deposit to one of the project's deposit wallets was added to your balance.
one-time-payment
A one-time payment of the project became paid.
wallet-tracker
A tracked wallet of the project sent or received a transfer.
payout
A payout of the project was completed (it is safely confirmed on the chain) or failed (nothing was sent and it was refunded).
test
You pressed Send test in the project's settings in the dashboard.
Deposit to a deposit wallet
{
  "type": "deposit-wallet",
  "deposit": {
    "id": "41b0d4fe-8b49-4623-bd8f-6f04586b06c9",
    "wallet_id": "3f4911a7-2c26-4f9c-a97c-80b25b6feb8c",
    "external_id": "customer-7731",
    "project_id": "3d6b1130-da92-4ddf-bad2-93f898993c39",
    "network": "ethereum",
    "asset": "USDT",
    "contract": "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "amount": "250.5",
    "pay_amount": "250.5",
    "fee": "1.2525",
    "receive_amount": "249.2475",
    "created_ms": 1791503990112
  }
}
One-time payment paid
{
  "type": "one-time-payment",
  "payment": {
    "id": "ccf1c790-9d3d-4cda-98a9-5cd590a102df",
    "external_id": "order-1042",
    "project_id": "3d6b1130-da92-4ddf-bad2-93f898993c39",
    "network": "polygon",
    "address": "0x20d5b8802fc43b24cdbc9cdaa59dd6690626ad2c",
    "asset": "USDT",
    "contract": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
    "amount": 49.5,
    "pay_amount": 49.5,
    "receive_amount": "49.2525",
    "received": "49.5",
    "status": "paid",
    "fee": "0.2475",
    "created_ms": 1791503932667,
    "expire_ms": 1791507532667
  }
}
Transfer of a tracked wallet
{
  "type": "wallet-tracker",
  "event": {
    "id": "95e04e32-5c98-4f68-8c62-f487bda0ed5c",
    "tracker_id": "67153a22-af19-4352-ab8e-041006c76c7b",
    "external_id": "treasury",
    "project_id": "ea54aa6c-21d7-46a4-b1fe-c0703f74a2af",
    "address": "0x52ae0f1c8d4b7a90e3b6c2d15f8a47e09b3c91f3",
    "created_ms": 1791504120904
  },
  "transfer": {
    "network": "ethereum",
    "block_number": 26151012,
    "tx_hash": "0x4e3a…9f21",
    "log_index": "28",
    "from_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "to_address": "0x52ae0f1c8d4b7a90e3b6c2d15f8a47e09b3c91f3",
    "asset": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "amount": "102870865",
    "symbol": "USDC",
    "amount_units": "102.870865"
  }
}
Payout completed or failed
{
  "type": "payout",
  "payout": {
    "id": "8a1f4c2e-6d3b-4f70-9c15-2e7b0a94d6c3",
    "external_id": "user-5521",
    "network": "polygon",
    "asset": "USDT",
    "contract": "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
    "address": "0x52ae0f1c8d4b7a90e3b6c2d15f8a47e09b3c91f3",
    "amount": "25.50",
    "fee": "0.1275",
    "receive_amount": "25.50",
    "pay_amount": "25.6275",
    "status": "completed",
    "tx_hash": "0x9b2c…4e17",
    "created_ms": 1791506100412,
    "processed_ms": 1791506131870
  }
}
Test from the dashboard
{
  "type": "test",
  "test": {
    "project_id": "3d6b1130-da92-4ddf-bad2-93f898993c39",
    "service": "deposit_wallets",
    "message": "This is a test notification from LirChain.",
    "created_ms": 1791506200000
  }
}

Answer with a 2xx status within 10 seconds. Anything else counts as a failure and the same event is sent again after a minute, up to 20 times. Every try of one event carries the same x-webhook-id header, so you can ignore one you already handled.

In a deposit webhook external_id is the one of the wallet, in a tracker webhook the one of the tracker, and in a payout webhook the one of the payout. In a tracker webhook event.address is the tracked address: it received the transfer when it equals to_address and sent it when it equals from_address.

To see what your server receives, press Send test next to the webhook URL in the project's settings. It sends a test event right away, signed like every other, and shows how your server answered.

Webhook signatures

Every webhook is signed, so you can be sure it came from us and was not changed on the way. Each project has its own signing secret, which starts with whsec_. Find it in the project's settings in the dashboard, next to the webhook URL, and keep it on your server like the API key.

x-webhook-id
The id of the event. The same for every try of one event, so you can ignore one you already handled.
x-webhook-timestamp
When this try was sent, in seconds since 1970.
x-webhook-signature
v1= and the signature of this try, as hex.

To check a webhook:

  1. Join the id, the timestamp and the raw body with dots: <x-webhook-id>.<x-webhook-timestamp>.<body>. Use the body exactly as it arrived, before any JSON parsing.
  2. Compute its HMAC-SHA256 with your signing secret as the key, write it as hex and put v1= in front.
  3. Compare it with x-webhook-signature using a constant-time comparison. Refuse the webhook when they differ.
  4. Refuse it too when the timestamp is more than 5 minutes away from your clock. Every try is signed anew, so a real webhook is never older than that.
import crypto from "node:crypto";

// rawBody: the request body exactly as it arrived, as a string. headers: the request headers.
function verifyWebhook(rawBody, headers, secret) {
    const id = headers["x-webhook-id"] ?? "";
    const timestamp = headers["x-webhook-timestamp"] ?? "";
    const signature = headers["x-webhook-signature"] ?? "";

    // Refuse old webhooks, so one that was captured cannot be replayed later
    if (!/^\d+$/.test(timestamp) || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) {
        return false;
    }

    const expected = "v1=" + crypto.createHmac("sha256", secret).update(`${id}.${timestamp}.${rawBody}`).digest("hex");

    return signature.length === expected.length && crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}

// With Express, read the body raw on this route, not as JSON:
// app.post("/webhooks/lirchain", express.raw({ type: "application/json" }), (req, res) => {
//     if (!verifyWebhook(req.body.toString("utf8"), req.headers, process.env.LIRCHAIN_WEBHOOK_SECRET)) {
//         return res.sendStatus(401);
//     }
//     const event = JSON.parse(req.body);
//     res.sendStatus(200);
// });

New secret in the project's settings replaces the secret at once: webhooks signed with the old one stop matching, including the retries of events that were already waiting.

Telegram notifications

Any project can also post its events to Telegram, through a bot of your own, in a chat with you, a group or a channel. It works alongside the webhook or on its own, and needs no code.

  1. Create a bot with @BotFather in Telegram and copy the token it gives you.
  2. Send your bot any message, or add it to the group or channel where the messages should go. In a channel it has to be an admin.
  3. Paste the token in the project's settings and press Connect. The chat you just used is found by itself. You can also enter a chat id yourself.
  4. Press Send test to see a message arrive.
A message for a tracked wallet
⬇️ Received 102.870865 USDC on Ethereum
Wallet: treasury (0x52ae…91f3)
From: 0xdac1…1ec7
https://etherscan.io/tx/0x4e3a…9f21
Project: Treasury monitor

The bot posts the same events as the webhook: deposits, paid one-time payments, transfers of tracked wallets, and completed or failed payouts. A message that Telegram refuses is tried again like a webhook. Telegram lets a bot post about 20 messages a minute in a group, so a very busy project can see its messages arrive with a delay.

The token is only used to send your project's messages and is never shown again after you save it. Disconnect bot removes it.

Hosted pages

Every one-time payment and every deposit wallet has a ready-made page you can send your customer to, so you do not have to build the payment screen yourself. The link is made from the id you get back when you create the payment or the wallet.

Links
https://lirchain.com/pay/<payment id>
https://lirchain.com/deposit/<wallet id>
  • The payment page shows the amount, the address with its QR code, the network and the time left. It updates by itself and shows when the payment is received or has expired.
  • The deposit page shows the address of the wallet with its QR code and the latest deposits to it.
  • The pages need no login: whoever has the link can open it. They show nothing about your account, and an id cannot be guessed, but treat a link as something meant for that one customer.
  • The pages are for showing only. Use webhooks to learn about a payment in your own system.
Any project

General

Works with the API key of any project.

Check an API key

GET/merchant/ping

Answers when the key is valid and tells you which project and service it belongs to.

curl "https://api.lirchain.com/merchant/ping" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200
{
  "status": "ok",
  "project_id": "3d6b1130-da92-4ddf-bad2-93f898993c39",
  "service": "one_time_payments"
}

Get your plan's limits

GET/merchant/allowance

How much of every limit of your plan is used and how much it allows.

curl "https://api.lirchain.com/merchant/allowance" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200
{
  "projects": { "used": 4, "limit": 4 },
  "deposit_wallets": { "used": 12, "limit": 1000 },
  "one_time_payments": { "used": 310, "limit": 1000 },
  "wallet_trackers": { "used": 3, "limit": 1000 },
  "tracker_events": { "used": 542, "limit": 1000 }
}
  • The limits belong to your account and are shared by all its projects, so every key gives the same answer.
  • projects, deposit_wallets and wallet_trackers count what exists now. The others count what happened since your plan's current period started.
  • Without an active plan the answer is 403.
Projects of the service one_time_payments

One-Time Payments

A payment request for one purchase, paid in USDT or USDC. Every payment gets its own address. It is pending until one transfer brings at least the amount to that address, then it is paid. Smaller transfers are not added up: they are added to your balance, but they do not pay the payment.

Create a payment

POST/merchant/one-time-payment/create

Creates a pending payment and the address your customer pays to.

Body (JSON)
networkstring
ethereum, bsc or polygon.
assetstring
What it is paid in: USDT or USDC, by its symbol or its contract address.
amountnumberoptional
What the customer pays, in dollars, at least 1. You receive it minus the fee. Give this or receive_amount.
receive_amountnumberoptional
What you want to receive after the fee, in dollars. The customer pays that plus the fee, rounded up to a cent. Give this or amount.
external_idstringoptional
Your own id for the payment, e.g. your order id, up to 255 characters. We store it and give it back, also in webhooks.
curl https://api.lirchain.com/merchant/one-time-payment/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "network": "polygon",
    "asset": "USDT",
    "amount": 49.5,
    "external_id": "order-1042"
  }'
Response · 201
{
  "id": "ccf1c790-9d3d-4cda-98a9-5cd590a102df",
  "external_id": "order-1042",
  "network": "polygon",
  "address": "0x20d5b8802fc43b24cdbc9cdaa59dd6690626ad2c",
  "asset": "USDT",
  "amount": 49.5,
  "pay_amount": 49.5,
  "receive_amount": "49.2525",
  "status": "pending",
  "fee": "0",
  "created_ms": 1791503932667,
  "expire_ms": 1791507532667
}
  • Counts towards the payments of your billing period. When the limit is reached the answer is 403.
  • Creating a payment is free. The fee is charged when it is paid.
  • expire_ms is one hour after created_ms: the time you should give your customer to pay.
  • amount is the price in dollars, and also how many of the stablecoin the customer has to send in one transfer. pay_amount is the same number: what is to be paid.
  • receive_amount is what you receive on your balance for the payment: what is paid minus the fee. While the payment is pending it is worked out with the fee of your plan as it is now. Once it is paid it is what you did receive.

Get a payment

GET/merchant/one-time-payment/otp

One payment of the project, with its current status.

Query
iduuid
The id of the payment.
curl "https://api.lirchain.com/merchant/one-time-payment/otp?id=ccf1c790-9d3d-4cda-98a9-5cd590a102df" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200
{
  "id": "ccf1c790-9d3d-4cda-98a9-5cd590a102df",
  "external_id": "order-1042",
  "network": "polygon",
  "address": "0x20d5b8802fc43b24cdbc9cdaa59dd6690626ad2c",
  "asset": "USDT",
  "amount": 49.5,
  "pay_amount": 49.5,
  "receive_amount": "49.2525",
  "status": "paid",
  "fee": "0.2475",
  "created_ms": 1791503932667,
  "expire_ms": 1791507532667
}
  • status is pending or paid.
  • fee is what we charged for the transfer that paid the payment: the percentage of your plan. It is 0 until the payment is paid.

List payments

GET/merchant/one-time-payment/page

The payments of the project, newest first.

Query
pagenumberoptional
The page to return, starting at 1. 50 items per page.
curl "https://api.lirchain.com/merchant/one-time-payment/page?page=1" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200
{
  "items": [
    {
      "id": "ccf1c790-9d3d-4cda-98a9-5cd590a102df",
      "external_id": "order-1042",
      "network": "polygon",
      "address": "0x20d5b8802fc43b24cdbc9cdaa59dd6690626ad2c",
      "asset": "USDT",
      "amount": 49.5,
      "pay_amount": 49.5,
      "receive_amount": "49.2525",
      "status": "paid",
      "fee": "0.2475",
      "created_ms": 1791503932667,
      "expire_ms": 1791507532667
    }
  ],
  "page": 1,
  "total_pages": 1
}
Projects of the service deposit_wallets

Deposit Wallets

A permanent address for one customer. Every transfer of the wallet's asset to it becomes a deposit of the project.

Create a wallet

POST/merchant/deposit-wallet/create

Creates a wallet with a new address. It accepts one asset on one network.

Body (JSON)
networkstring
ethereum, bsc or polygon.
assetstring
What it is paid in: a token by its symbol (USDT, USDC) or contract address, or the network's own coin by its symbol (ETH, BNB, POL).
external_idstringoptional
Your own id for the wallet, e.g. the id of the customer it belongs to, up to 255 characters. We store it and give it back, also in webhooks.
curl https://api.lirchain.com/merchant/deposit-wallet/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "network": "polygon",
    "asset": "USDC",
    "external_id": "customer-7731"
  }'
Response · 201
{
  "id": "3f4911a7-2c26-4f9c-a97c-80b25b6feb8c",
  "project_id": "3d6b1130-da92-4ddf-bad2-93f898993c39",
  "merchant_id": "7c551c17-1a48-4e2b-b3ac-7ad389a753c6",
  "network": "polygon",
  "address": "0x748aaf6d861698dc3c4ee2fca3c27ba13edc7891",
  "asset": "USDC",
  "external_id": "customer-7731"
}
  • Counts towards the wallets of your plan. When the limit is reached the answer is 403.

Delete a wallet

DELETE/merchant/deposit-wallet/delete

Deletes the wallet and frees its place in your plan. Deposits sent to its address afterwards are not recorded.

Query
wallet_iduuid
The id of the wallet.
curl -X DELETE "https://api.lirchain.com/merchant/deposit-wallet/delete?wallet_id=3f4911a7-2c26-4f9c-a97c-80b25b6feb8c" \
  -H "x-api-key: YOUR_API_KEY"
Response · 204
(no body)

List wallets

GET/merchant/deposit-wallet/wallets

The wallets of the project.

Query
pagenumberoptional
The page to return, starting at 1. 50 items per page.
curl "https://api.lirchain.com/merchant/deposit-wallet/wallets?page=1" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200
{
  "items": [
    {
      "id": "3f4911a7-2c26-4f9c-a97c-80b25b6feb8c",
      "project_id": "3d6b1130-da92-4ddf-bad2-93f898993c39",
      "merchant_id": "7c551c17-1a48-4e2b-b3ac-7ad389a753c6",
      "network": "polygon",
      "address": "0x748aaf6d861698dc3c4ee2fca3c27ba13edc7891",
      "asset": "USDC",
      "external_id": "customer-7731"
    }
  ],
  "page": 1,
  "total_pages": 1
}

List deposits

GET/merchant/deposit-wallet/deposits

The deposits of the project, newest first.

Query
pagenumberoptional
The page to return, starting at 1. 50 items per page.
wallet_iduuidoptional
Only the deposits of this wallet.
curl "https://api.lirchain.com/merchant/deposit-wallet/deposits?page=1&wallet_id=3f4911a7-2c26-4f9c-a97c-80b25b6feb8c" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200
{
  "items": [
    {
      "id": "41b0d4fe-8b49-4623-bd8f-6f04586b06c9",
      "wallet_id": "3f4911a7-2c26-4f9c-a97c-80b25b6feb8c",
      "project_id": "3d6b1130-da92-4ddf-bad2-93f898993c39",
      "merchant_id": "7c551c17-1a48-4e2b-b3ac-7ad389a753c6",
      "transfer_id": "41b0d4fe-8b49-4623-bd8f-6f04586b06c9",
      "amount": "250.5",
      "pay_amount": "250.5",
      "fee": "1.2525",
      "receive_amount": "249.2475",
      "created_ms": 1791503990112,
      "processed_ms": 1791503991340
    }
  ],
  "page": 1,
  "total_pages": 1
}
  • amount is in whole units of the wallet's asset, as text so no precision is lost.
  • transfer_id is our id of the transfer on the chain this deposit is. It is the same as id: one transfer is only ever one deposit.
  • amount is what arrived, in the wallet's asset. pay_amount is what was paid in dollars: the same number for USDT and USDC, and for a network's own coin what it was exchanged for. fee is our fee, and receive_amount is what you receive on your balance: pay_amount without the fee. All three are 0 while processed_ms is null: the deposit was seen but is not on your balance yet, which for a coin takes until its exchange is confirmed.
Projects of the service wallet_tracker

Wallet Tracker

Follows any address, on more networks than the other services: Ethereum, BNB Chain, Polygon, Tron, Solana and Bitcoin. Every transfer of USDT, USDC or the network's own coin to or from it becomes an event of the project.

Create a tracker

POST/merchant/wallet-tracker/create

Starts tracking an address on one network.

Body (JSON)
networkstring
ethereum, bsc, polygon, tron, solana or bitcoin.
addressstring
The address to track, written the way that network writes addresses: 0x and 40 hex characters, T… on Tron, a base58 address on Solana, 1…, 3… or bc1… on Bitcoin.
external_idstringoptional
Your own id for the tracker, up to 255 characters. We store it and give it back, also in webhooks.
curl https://api.lirchain.com/merchant/wallet-tracker/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "network": "ethereum",
    "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "external_id": "treasury"
  }'
Response · 201
{
  "id": "67153a22-af19-4352-ab8e-041006c76c7b",
  "project_id": "ea54aa6c-21d7-46a4-b1fe-c0703f74a2af",
  "merchant_id": "7c551c17-1a48-4e2b-b3ac-7ad389a753c6",
  "network": "ethereum",
  "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "external_id": "treasury"
}
  • Counts towards the trackers of your plan. When the limit is reached the answer is 403.
  • An address that is not a valid one for the network is refused with 400. Ethereum, BNB Chain and Polygon addresses are stored and returned in lowercase. The others are kept exactly as written: their capitals matter.
  • A tracker reports what happens from the moment it is added, not what happened before.

Delete a tracker

DELETE/merchant/wallet-tracker/delete

Stops tracking the address and frees its place in your plan.

Query
iduuid
The id of the tracker.
curl -X DELETE "https://api.lirchain.com/merchant/wallet-tracker/delete?id=67153a22-af19-4352-ab8e-041006c76c7b" \
  -H "x-api-key: YOUR_API_KEY"
Response · 204
(no body)

List trackers

GET/merchant/wallet-tracker/trackers

The trackers of the project.

Query
pagenumberoptional
The page to return, starting at 1. 50 items per page.
curl "https://api.lirchain.com/merchant/wallet-tracker/trackers?page=1" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200
{
  "items": [
    {
      "id": "67153a22-af19-4352-ab8e-041006c76c7b",
      "project_id": "ea54aa6c-21d7-46a4-b1fe-c0703f74a2af",
      "merchant_id": "7c551c17-1a48-4e2b-b3ac-7ad389a753c6",
      "network": "ethereum",
      "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "external_id": "treasury"
    }
  ],
  "page": 1,
  "total_pages": 1
}

List events

GET/merchant/wallet-tracker/events

The events of the project with their transfers, newest first.

Query
pagenumberoptional
The page to return, starting at 1. 50 items per page.
wallet_tracker_iduuidoptional
Only the events of this tracker.
curl "https://api.lirchain.com/merchant/wallet-tracker/events?page=1&wallet_tracker_id=67153a22-af19-4352-ab8e-041006c76c7b" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200
{
  "items": [
    {
      "id": "95e04e32-5c98-4f68-8c62-f487bda0ed5c",
      "tracker_id": "67153a22-af19-4352-ab8e-041006c76c7b",
      "created_ms": 1791504120904,
      "transfer": {
        "network": "ethereum",
        "block_number": 26151012,
        "tx_hash": "0x4e3a…9f21",
        "log_index": "28",
        "from_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "to_address": "0x52ae0f1c8d4b7a90e3b6c2d15f8a47e09b3c91f3",
        "asset": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "amount": "102870865",
        "symbol": "USDC",
        "amount_units": "102.870865"
      }
    }
  ],
  "page": 1,
  "total_pages": 1
}
  • asset and amount are the chain's own values: the token's contract address and the amount in its smallest unit. The network's own coin has the address 0x0000000000000000000000000000000000000000 and no log_index.
  • symbol and amount_units are the same transfer in readable form.
  • The tracked address is the sender when it equals from_address and the receiver when it equals to_address.
  • On Bitcoin and Solana one transaction can have many senders and receivers, so an event is what the transaction changed for your address: the amount it received minus what it spent, or the other way round. The other side is an empty string. On Solana the network fee your address paid is not counted.
  • asset is written the way the network writes it: a T… contract on Tron, the token's mint on Solana. On Solana log_index holds the mint for a token event.
  • A transfer that failed on its chain is never reported.
  • Solana addresses are read about every 20 seconds, and only the usual token account of an address is watched for USDT and USDC.
Projects of the service payouts

Payouts

Money from your balance to an address you choose, for example to pay one of your users. The amount and the fee are taken from your balance the moment the payout is created, and a payout cannot be cancelled: once it is created it is sent.

Create a payout

POST/merchant/payout/create

Takes the amount and the fee from your balance and creates the payout to the address. This cannot be undone.

Body (JSON)
networkstring
ethereum, bsc or polygon.
assetstring
The token: its symbol (USDT, USDC) or its contract address.
addressstring
Where the money goes: 0x followed by 40 hex characters.
amountnumber or string
The amount in dollars, at least 1, with at most two decimals.
external_idstringoptional
Your own id for the payout, e.g. the id of the user you are paying, up to 255 characters. We store it and give it back.
curl https://api.lirchain.com/merchant/payout/create \
  -H "x-api-key: YOUR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "network": "polygon",
    "asset": "USDT",
    "address": "0x52aE0F1c8D4b7A90e3B6c2D15f8A47e09B3C91F3",
    "amount": "25.50",
    "external_id": "user-5521"
  }'
Response · 201
{
  "id": "8a1f4c2e-6d3b-4f70-9c15-2e7b0a94d6c3",
  "external_id": "user-5521",
  "network": "polygon",
  "asset": "USDT",
  "address": "0x52ae0f1c8d4b7a90e3b6c2d15f8a47e09b3c91f3",
  "amount": "25.50",
  "fee": "0.1275",
  "receive_amount": "25.50",
  "pay_amount": "25.6275",
  "status": "pending",
  "tx_hash": null,
  "created_ms": 1791506100412,
  "processed_ms": null
}
  • The fee is the percentage of your plan, taken from your balance on top of the amount. receive_amount is what the receiver gets (the amount), pay_amount is what leaves your balance for it (the amount and the fee).
  • Your balance must cover the amount and the fee, otherwise the answer is 402 and nothing is taken.
  • status is pending, processing, completed or failed. tx_hash is set once the payout is completed. A failed payout was not sent, and its amount and fee are back on your balance.
  • A payout is sent within a few seconds of being created (processing) and becomes completed once the network has safely confirmed it, 12 blocks later. When it is completed or failed, a payout webhook is sent and the project's Telegram bot posts it, if they are set up. You can also read the payout to see its status.

Get a payout

GET/merchant/payout/payout

One payout of the project, with its current status.

Query
iduuid
The id of the payout.
curl "https://api.lirchain.com/merchant/payout/payout?id=8a1f4c2e-6d3b-4f70-9c15-2e7b0a94d6c3" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200
{
  "id": "8a1f4c2e-6d3b-4f70-9c15-2e7b0a94d6c3",
  "external_id": "user-5521",
  "network": "polygon",
  "asset": "USDT",
  "address": "0x52ae0f1c8d4b7a90e3b6c2d15f8a47e09b3c91f3",
  "amount": "25.50",
  "fee": "0.1275",
  "receive_amount": "25.50",
  "pay_amount": "25.6275",
  "status": "pending",
  "tx_hash": null,
  "created_ms": 1791506100412,
  "processed_ms": null
}

List payouts

GET/merchant/payout/page

The payouts of the project, newest first.

Query
pagenumberoptional
The page to return, starting at 1. 50 items per page.
curl "https://api.lirchain.com/merchant/payout/page?page=1" \
  -H "x-api-key: YOUR_API_KEY"
Response · 200
{
  "items": [
    {
      "id": "8a1f4c2e-6d3b-4f70-9c15-2e7b0a94d6c3",
      "external_id": "user-5521",
      "network": "polygon",
      "asset": "USDT",
      "address": "0x52ae0f1c8d4b7a90e3b6c2d15f8a47e09b3c91f3",
      "amount": "25.50",
      "fee": "0.1275",
      "receive_amount": "25.50",
      "pay_amount": "25.6275",
      "status": "pending",
      "tx_hash": null,
      "created_ms": 1791506100412,
      "processed_ms": null
    }
  ],
  "page": 1,
  "total_pages": 1
}