Use AIPAY as a payment gateway
Take an on-chain payment to your own address, or orchestrate an off-chain channel you already use. AIPAY gives you a hosted checkout, an order that confirms itself, and a signed webhook. It never holds the money and never asks for a key.
Three ways in
Payer
Opens the checkout link, sees the amount, chain, asset and recipient pre-filled, and signs in their own wallet. No account, no key sent to AIPAY.
Merchant (web UI)
Sets a shop name and receiving address, then uses POS, payment links, products and orders. Cloud orders and off-chain channels are optional and live in Settings.
Platform / backend
Calls the HTTP API with a merchant key: create orders, read receipts, receive signed webhooks. Everything on this page works with curl alone.
First call
No SDK, no dashboard, no approval step. The merchant key is returned once by the first call and only its hash is stored; rotate it later with POST /v1/merchants/me/keys/rotate.
BASE=https://api.aipay.im
# 1. create the merchant -> apiKey is shown once
curl -s -X POST "$BASE/v1/merchants" -H 'Content-Type: application/json' \
-d '{"shopName":"My Shop","recipientAddress":"0xYourAddress","chainKey":"bsc"}'
# 2. create an order -> checkoutUrl + reference
curl -s -X POST "$BASE/v1/orders" \
-H "Authorization: Bearer $AIPAY_API_KEY" -H 'Content-Type: application/json' \
-d '{"amount":"12.50","asset":"USDT","merchantOrderId":"INV-1042"}'
# 3. share checkoutUrl as a link or QR; poll the payer-safe status
curl -s "$BASE/v1/orders/ap_…/status"
# 4. off-chain instead of on-chain: register a channel, verify, enable,
# then create the order with {"amount":"88.00","channelId":"ch_…"}
curl -s -X POST "$BASE/v1/channels" \
-H "Authorization: Bearer $AIPAY_API_KEY" -H 'Content-Type: application/json' \
-d '{"channel":"alipay","label":"Store","settleCurrency":"CNY","payUrlTemplate":"https://pay.example.com/checkout?order={reference}"}'202 from /confirm is not success: the payment was seen but is not deep enough yet. Keep polling /status, or wait for order.confirmed on your webhook.
Make confirmation faster: run the watcher SDK
AIPAY reads the chain once a minute per pending order. If you would rather have seconds, a Node SDK can watch your own receiving address with your own RPC and report the transaction it finds.
# install (verify first: /downloads/sdk-latest.json lists the sha256) curl -fsSL https://aipay.im/downloads/aipay-watch-<version>.tgz -o sdk.tgz && tar -xzf sdk.tgz # report with your own RPC; the server still verifies every hash node package/bin/aipay-watch.mjs --api-key "$AIPAY_API_KEY" \ --rpc bsc=https://bsc-dataseed.binance.org --state .aipay-watch-state.json # try it without reporting anything (no API key needed) node package/bin/aipay-watch.mjs --read-only --rpc bsc=https://bsc-dataseed.binance.org
- It only ever sends a transaction hash. The server re-reads the receipt, recipient, amount and depth before an order becomes confirmed.
- EVM (ERC-20), Solana and Tron (TRC20 + native TRX). Native-coin EVM orders still need a transaction hash.
- Tarball + sha256, no npm package. watcher: true tells AIPAY to stop sweeping your pending orders — only set it while the SDK is running.
What AIPAY does
- Hosts the checkout link and QR, and confirms the order when the payment is deep enough on chain.
- Sends a signed webhook (HMAC-SHA256 over the raw body) when an order is confirmed or expires.
- Renders your off-chain payment link with the order reference and tracks that order to your receipt.
- Keeps 90 days of order history and lets you rotate the API key without losing it.
What it does not do
- Hold, move or custody funds: payments go straight to the merchant's address.
- Act as a licensed payment institution, refund, reverse or chase an off-chain payment.
- Accept a provider credential for Alipay, WeChat Pay, UnionPay or Stripe — the money never reaches AIPAY.
- Treat an off-chain confirmation as chain evidence, or claim a merchant delivered anything.
- Offer a sandbox or testnet: api.aipay.im is mainnet only, so rehearsal means running the Worker yourself (the source is public).
- Refund, reverse, charge back or arbitrate anything. It cannot: it never holds the money, so refunds happen from the merchant's own wallet.
- Guarantee finality after confirmation — there is no post-confirmation reorg re-check, so choose a chain whose depth you trust.
Read next
- Integration guide: the three shapes, step by step
- API reference: every endpoint, error code and verification rule
- Supported chains and per-chain rules
- Merchant guide: the same capability from the shop UI
- Watcher SDK: sdk-watch.md
- Live endpoint list: GET api.aipay.im/v1
- llms.txt: the whole surface in one file
- agent.json: machine-readable capability surface
An AI agent can drive the same HTTP API with a merchant key. The MCP server and CLI are a payer-side surface; merchant channel tools are not in it, and agent.json says so.
Paid subscriptions are planned but not on sale and have no start date: /v1 reports billing status "free" with no plans. Nothing here charges a fee or requires a card.