{"service":"aipay-api","version":"1.0.0","docs":"https://aipay.im/docs/merchant-order-service.md","auth":"Authorization: Bearer aipay_sk_…","endpoints":{"health":"GET /v1/health","createMerchant":"POST /v1/merchants","claimMerchant":"POST /v1/merchants/claim (redeem a platform invitation: the merchant creates its own key and receiving address)","merchantSelf":"GET|PATCH|DELETE /v1/merchants/me","rotateKey":"POST /v1/merchants/me/keys/rotate","platformGrants":"GET|POST /v1/merchants/me/platforms","revokePlatformGrant":"DELETE /v1/merchants/me/platforms/:id","platformOrders":"GET /v1/platform/orders (platform key, read-only, granted merchants only)","platformMerchants":"GET /v1/platform/merchants?includeRevoked=&after=&limit= (the merchants that granted this platform)","platformInvites":"GET|POST /v1/platform/merchants/invites (mint a one-time claim token; list by status)","platformInviteRevoke":"DELETE /v1/platform/merchants/invites/:id (only an unclaimed invite)","platformKeysRotate":"POST /v1/platform/keys/rotate (the platform rotates its own key; the previous key stops immediately)","platformUsage":"GET /v1/platform/usage (this platform's read budget for the current window and its grant counts)","platformStats":"GET /v1/platform/stats?from=&to=&merchantId= (daily counts by status + per-asset base-unit totals; UTC; 92-day window; spends the export budget)","platformOrder":"GET /v1/platform/orders/:reference","platformOrderChanges":"GET /v1/platform/orders/changes","platformWebhook":"GET|POST|DELETE /v1/platform/webhook (signed order events for granted merchants; POST returns the secret once)","platformDeliveries":"GET /v1/platform/deliveries?status=&reference=&limit=&before=","platformReplay":"POST /v1/platform/deliveries/:id/replay","platformReplayFailed":"POST /v1/platform/deliveries/replay-failed (re-queue dead letters oldest first, max 25 per call; optional body field limit)","platformExportCsv":"GET /v1/platform/orders/export.csv?status=&merchantId=&from=&to=&confirmedFrom=&confirmedTo=&limit=&cursor=","automation":"GET|PATCH|DELETE /v1/merchants/me/automation (the merchant's own automation policy; empty = nothing is confirmed automatically)","createOrder":"POST /v1/orders","listOrders":"GET /v1/orders?status=&from=&to=&confirmedFrom=&confirmedTo=&limit=&cursor=","merchantStats":"GET /v1/orders/stats?from=&to= (UTC reconciliation by asset and evidence)","exportOrdersCsv":"GET /v1/orders/export.csv?status=&from=&to=&confirmedFrom=&confirmedTo=&limit=&pageCursor=","receipt":"GET /v1/orders/:reference","status":"GET /v1/orders/:reference/status","confirm":"POST /v1/orders/:reference/confirm (guarded hash report; merchants can send reviewed:true for late or non-exact transfers that have no attribution conflict)","evidence":"GET /v1/orders/:reference/evidence (order + timeline + notification attempts, for finance/audit)","cancel":"POST /v1/orders/:reference/cancel","channels":"GET|POST /v1/channels","channel":"PATCH|DELETE /v1/channels/:channelId","verifyChannel":"POST /v1/channels/:channelId/verify","channelSecret":"POST|DELETE /v1/channels/:channelId/secret","confirmOffchain":"POST /v1/orders/:reference/offchain-confirm","confirmOffchainWebhook":"POST /v1/offchain/confirmations","statements":"GET|POST /v1/offchain/statements?channelId=","adoptStatement":"POST /v1/offchain/statements/:id/adopt","ignoreStatement":"POST /v1/offchain/statements/:id/ignore"},"platformAccess":{"authorization":"merchant_opt_in","auth":"Authorization: Bearer aipay_pk_…","readOnly":true,"collectable":false,"custody":"none","requiresMsg":false},"offchain":{"mode":"orchestration","custody":"none","credentials":"never stored","confirmation":"merchant receipt (merchant_manual, merchant_webhook signed with the channel secret, an adopted statement row, or statement_auto when the merchant's automation policy covers it)","channels":["alipay","wechat","unionpay","stripe","other"]},"notifications":{"webhook":{"signature":"HMAC-SHA256 over \"<X-AIPAY-Timestamp>.<raw body>\", hex, prefixed \"sha256=\"","headers":["X-AIPAY-Signature","X-AIPAY-Timestamp","X-AIPAY-Event","X-AIPAY-Delivery","X-AIPAY-Attempt"],"events":["order.confirmed","order.expired","order.cancelled"],"retryScheduleSeconds":[60,300,1800,7200,21600],"maxAttempts":6,"duplicateProtection":"one delivery row per (reference,event,channel,target), claimed before send; a replay keeps the same delivery id","replayWindow":"reject timestamps older than 5 minutes on your side; a replay is an explicit new attempt, never automatic","resendApi":"POST /v1/orders/:reference/notifications/:deliveryId/replay (merchant key) — resend one delivery now; 409 delivery_in_flight when the sweep holds it, 409 channel_not_configured when the channel has no credential","deliveryLog":"order.notifications[] in GET /v1/orders/:reference (merchant view, each row carries its deliveryId)"}},"polling":{"status":"GET /v1/orders/:reference/status (no key)","order":"GET /v1/orders/:reference","list":"GET /v1/orders?from=&to=&confirmedFrom=&confirmedTo=&cursor=","recommendedSeconds":30,"note":"The server sweeps every 60s, so faster polling only burns quota. Daily order quota: 500.","limits":{"status":{"limit":120,"windowSeconds":60},"receipt":{"limit":120,"windowSeconds":60},"list":{"limit":60,"windowSeconds":60},"export":{"limit":10,"windowSeconds":60},"statements":{"limit":30,"windowSeconds":60},"confirm":{"limit":120,"windowSeconds":60},"replay":{"limit":10,"windowSeconds":60},"rpc":{"limit":120,"windowSeconds":60},"statusCaller":{"limit":600,"windowSeconds":60},"receiptCaller":{"limit":600,"windowSeconds":60},"confirmCaller":{"limit":360,"windowSeconds":60},"otherReads":{"limit":120,"windowSeconds":60}},"payerLimits":{"status":{"perOrderPerMinute":120,"perCallerCeilingPerMinute":600,"ceilingSampledEvery":4},"receipt":{"perOrderPerMinute":120,"perCallerCeilingPerMinute":600,"ceilingSampledEvery":4},"confirm":{"perOrderPerMinute":120,"perCallerCeilingPerMinute":360,"ceilingSampledEvery":4}},"override":"operator-only POST|GET|DELETE /v1/internal/read-limits (apiKey + multiplier, max 20x)"},"rpcProxy":{"url":"POST /v1/rpc/:chainKey (EVM chains only)","methods":["eth_blockNumber","eth_chainId","eth_getLogs","eth_getTransactionReceipt","eth_getTransactionByHash"],"constraints":{"batch":false,"maxLogRangeBlocks":5000,"perIpPerMinute":120},"note":"A last-resort relay for public nodes that reject browser origins or rate-limit per IP. It cannot sign or broadcast; nothing it returns is a confirmation."},"budget":{"usage":"GET /v1/health.usage (today + month-to-date D1 write drivers vs the free-tier allowances, with an ok|watch|upgrade verdict)","measured":["orders","order_events","deliveries","sweep scans (each writes orders.checks)"],"notMeasured":["Worker requests (Cloudflare dashboard only)","D1 reads","RPC calls (health.sweeper.rpc)"],"upgradeAtPercent":70,"note":"the rollup is written by the cron once a minute with a watermark; it is not a per-request counter"},"payerAttestation":{"endpoint":"POST /v1/orders/:reference/confirm {txHash} (no Authorization header)","meaning":"the server re-reads the transaction and only settles exact, attributable transfers on open orders; 409 payment_attribution_review holds settlement","response":"payer-safe subset + verification.attestedBy:\"payer\" (no shop settings, order ids or notification targets)","discovery":"EVM only: the checkout page runs eth_getLogs itself, reports a candidate once, and drops /status polling to one heartbeat per minute","budget":"same 120/min confirm bucket per order, with a 360/min ceiling per address when no key is sent (429 + Retry-After; details.scope says which one tripped)"},"watcher":{"optIn":"PATCH /v1/merchants/me {\"watcher\": true}","effect":"our cron stops scanning this merchant's pending orders; the SDK discovers the payment with its own RPC quota and calls POST /v1/orders/:reference/confirm","serverStillVerifies":true,"confirmBudgetPerMinute":120},"signupQuota":{"perIpPerDay":50,"dedupe":"same shopName + recipientAddress answers 409 merchant_exists and consumes no quota","note":"one merchant per shop is expected; a platform onboarding many shops from one egress IP is within the limit"},"reChecks":{"scope":"confirmed EVM orders, once, 30 minutes to 6 hours after confirmation","onMismatch":"order_events.confirmation_regressed + orders.last_error; the status stays confirmed and no webhook is sent","notCovered":["solana","tron"]},"fees":{"aipayCommission":0,"model":"zero commission today; a per-merchant rate can be configured but is not charged","collectable":false,"note":"Zero commission: no fee is configured for this merchant, and nothing is charged.","maxConfiguredBps":500,"collectsVia":["contract split (MSGChain payment contract, disabled)","invoice/statement settled outside the transfer"]},"billing":{"status":"free","plans":[],"note":"Free usage stage. Paid subscriptions (1 / 3 / 6 / 12 months) are planned but not on sale; the start date is not decided."},"retentionDays":90,"chains":[{"key":"ethereum","chainId":1,"name":"Ethereum","symbol":"ETH","confirmations":12,"sweep":"transfer-logs"},{"key":"bsc","chainId":56,"name":"BNB Chain","symbol":"BNB","confirmations":15,"sweep":"transfer-logs"},{"key":"polygon","chainId":137,"name":"Polygon","symbol":"POL","confirmations":30,"sweep":"transfer-logs"},{"key":"arbitrum","chainId":42161,"name":"Arbitrum One","symbol":"ETH","confirmations":1,"sweep":"transfer-logs"},{"key":"optimism","chainId":10,"name":"Optimism","symbol":"ETH","confirmations":1,"sweep":"transfer-logs"},{"key":"avalanche","chainId":43114,"name":"Avalanche C-Chain","symbol":"AVAX","confirmations":1,"sweep":"transfer-logs"},{"key":"base","chainId":8453,"name":"Base","symbol":"ETH","confirmations":1,"sweep":"transfer-logs"},{"key":"xlayer","chainId":196,"name":"X Layer","symbol":"OKB","confirmations":10,"sweep":"transfer-logs"},{"key":"solana","chainId":"solana-mainnet","name":"Solana","symbol":"SOL","confirmations":1,"sweep":"signature-scan"},{"key":"tron","chainId":"tron-mainnet","name":"Tron","symbol":"TRX","confirmations":19,"sweep":"transfer-logs"}]}