Wait for a BTC Mainnet Payment Event
SUBTC supports long polling to wait for a payment to arrive.
The wallet_wait_event endpoint blocks until the expected payment is detected or the timeout expires.
Command:
curl -sS -X POST "https://api.subtc.net/v1/btc?mode=wallet_wait_event" \
-H "X-SUBTC-KEY: $KEY" \
-H "Content-Type: application/json" \
-d "{\"wallet_id\":\"$WID\",\"address\":\"$ADDR\",\"expected_sat\":20000,\"timeout_sec\":300}"Example response:
{
"ok": true,
"request_id": "f782b72d092c43a2",
"result": {
"address": "bc1q59ct7xwn0qa7kl722vdedaa2ajzkmmu78gm9jl",
"coin": "btc",
"net": "main",
"expected_sat": 20000,
"received_sat": 30000,
"status": "confirmed",
"wallet_id": "w_87d2a561cdd665948c1d756106f7b2179327927c3b8c"
}
}What happened:
The API waited until the wallet address received at least **20,000 SAT**.
The detected payment was:
received_sat = 30,000 SAT
status = confirmed
This makes wallet_wait_event useful for synchronous payment flows where the server waits for confirmation before continuing.
API Base:
https://subtc.net/api