Sign in
支付与提现/Payment API

支付 API

使用 2328.io 支付 API 创建并管理加密货币支付会话。

支付 API 让您可以创建支付会话、将客户引导至托管支付页面,并跟踪支付状态。

创建支付

创建一个支付会话并返回供客户付款的 URL。

请求参数

字段类型必需描述取值
amountdecimal该币种下的支付金额,例如 100.00
currencystring法币(USD、EUR、RUB……)或加密货币(USDT、TRX、BTC……)
order_idstring您的订单 ID,例如 ORDER-12345(最多 128 个字符)
to_currencystring预选的加密货币
networkstring否*网络代码(当 to_currency 已设置或 currency 为加密货币时必填)
url_returnstring支付完成后的跳转 URL,例如 https://your-site.com/return
url_successstringurl_return 的替代项
url_callbackstringwebhook 通知 URL,例如 https://your-site.com/webhook
invite_codestring推荐人代码
fee_splitdecimal由付款人承担的商户手续费比例(0–100,单位 %)。0 = 商户全额承担,100 = 付款人全额承担。覆盖项目级设置。示例:30(付款人承担 30%)。
price_markupdecimal在账单金额上的加价或折扣(−99 到 100,单位 %)。覆盖项目级设置。示例:5(+5%)或 -10(10% 折扣)。
descriptionstring可选的账单描述(最多 200 个字符),将展示在付款页面。示例:Premium plan — Order #12345
ttl_secondsint账单有效期(秒),范围 300(5 分钟)到 86400(24 小时)。超过此时间后账单将过期,无法再支付。默认值:3600(1 小时)。示例:3600

响应说明

JSON
{
  "state": 0,
  "result": {
    "uuid": "abc123-def456-...",
    "order_id": "ORDER-12345",
    "amount": "100.00",
    "currency": "USD",
    "amount_usd": "100.00",
    "exchange_rate": null,
    "url": "https://2328.io/pay/abc123-def456-...",
    "tg_deeplink": "https://t.me/my2328bot?start=pay_abc123-def456-...",
    "expires_at": "2026-01-11T21:00:00Z",
    "created_at": "2026-01-11T20:00:00Z",
    "payer_currency": "USDT",
    "payer_amount": "100.50",
    "network": "TRX-TRC20",
    "address": "TXYZabc123...",
    "payment_status": "check",
    "txid": null,
    "payment_amount": null,
    "qr": "data:image/png;base64,iVBORw0..."
  }
}
  • 将客户重定向至 result.url 完成支付。
  • tg_deeplink —— 通过 Telegram MiniApp 付款的 Telegram 机器人深度链接。
  • qr —— 收款地址的 Base64 编码二维码(data URI)。仅当地址已分配时存在(networkto_currency 同时设置,或 currency 为加密货币);否则为 null
  • txidpayment_amount —— 客户付款前为 null,链上交易被检测到后填充。可监听 payment_status: paid webhook 来获知。
  • exchange_rate —— 当兑换尚不适用时为 null(例如还未确定付款币种)。一旦付款币种锁定即填充。
Credentials
RequestPOST/v1/payment
curl -X POST https://api.2328.io/api/v1/payment \
  -H "Content-Type: application/json" \
  -H "User-Agent: MyShop/1.0 (+https://myshop.example)" \
  -H "project: YOUR_PROJECT_UUID" \
  -H "sign: YOUR_HMAC_SIGNATURE"
Response
Click Try it to see the response here.

支付信息

通过 uuidorder_id 获取当前支付状态。

请求参数

字段类型必需描述取值
uuidstring是*支付 UUID(创建时来自 result.uuid
order_idstring是*您的订单 ID

uuidorder_id 至少需要提供其一。

RequestPOST/v1/payment/info
curl -X POST https://api.2328.io/api/v1/payment/info \
  -H "Content-Type: application/json" \
  -H "User-Agent: MyShop/1.0 (+https://myshop.example)" \
  -H "project: YOUR_PROJECT_UUID" \
  -H "sign: YOUR_HMAC_SIGNATURE"
Response
Click Try it to see the response here.

支付列表

获取所有支付的列表,支持筛选与分页。

请求参数

字段类型必需描述取值
statusstring按支付状态过滤(详见 References
date_fromdate起始日期(YYYY-MM-DD),例如 2026-01-01
date_todate结束日期(YYYY-MM-DD),例如 2026-01-31
pageint页码,默认 1
per_pageint每页条数,默认 15,最大 5000
RequestPOST/v1/payment/list
curl -X POST https://api.2328.io/api/v1/payment/list \
  -H "Content-Type: application/json" \
  -H "User-Agent: MyShop/1.0 (+https://myshop.example)" \
  -H "project: YOUR_PROJECT_UUID" \
  -H "sign: YOUR_HMAC_SIGNATURE"
Response
Click Try it to see the response here.