请求格式application/json
amountrequired number | 指定法币中的支付金额 |
currencyrequired string | 接受的法币(见法币列表) |
order_idstring | 您系统中的订单 ID |
networkstring | 您可以指定必须接收支付的网络,也可以留空以接受任意可用网络的支付 |
webhook_linkurl | 支付状态回传的 URL 默认值: merchant settings |
success_linkurl | 支付成功后客户跳转的 URL 默认值: merchant settings |
error_linkurl | 支付失败后客户跳转的 URL 默认值: merchant settings |
part_paymentboolean | 您可以允许或禁止单笔支付中的部分付款 默认值: true or merchant settings |
ignore_client_amountboolean | 如果设置为 True,客户支付的任意金额都会成功完成发票 默认值: false or merchant settings |
payment_accuracynumber | 指定 1 到 100 的百分比。例如 $100 支付设置为 5 时,客户支付 $95 即视为成功并完成 默认值: 0 or merchant settings |
feenumber | 1 到 100 的值,将按百分比为支付增加手续费 默认值: 0 |
discountnumber | 1 到 100 的值,将按指定百分比为支付应用折扣 默认值: 0 |
additional_infostring | 任意信息 |
auto_convertboolean | 收到付款后自动兑换 默认值: false |
响应格式data object
iduuid | 发票 ID |
info.currencystring | null | 发票的法币代码 |
info.tokenstring | null | 支付代币 |
info.networkstring | null | 支付网络 |
info.addressstring | null | 用于支付的钱包地址 |
amount.starting_pricenumber | 发票的初始法币金额 |
amount.discount_percentnumber | 折扣百分比 |
amount.merchant_fee_percentnumber | 商户手续费百分比 |
amount.service_fee_percentnumber | null | 平台服务费百分比 |
amount.totalnumber | 折扣和手续费后的最终金额 |
url.webhookurl | null | 商户 Webhook URL |
url.successurl | null | 支付成功后的跳转 URL |
url.errorurl | null | 支付失败后的跳转 URL |
url.paymenturl | 支付页面链接 |
options.part_paymentboolean | 是否允许部分付款 |
options.ignore_client_amountboolean | 是否忽略客户的精确金额 |
options.payment_accuracynumber | 允许的付款误差 |
additional.order_idstring | null | 外部订单 ID |
additional.infostring | null | 订单附加信息 |
statusstring | 发票当前状态 |
expired_atstring (ISO 8601, UTC) | 发票过期日期 |
created_atstring (ISO 8601, UTC) | 发票创建日期 |
请求示例
curl --request POST 'https://api.fps.pro/invoices/create' \
--header 'Content-Type: application/json' \
--header 'X-Client-Id: YOUR_CLIENT_ID' \
--header 'X-Timestamp: 1720000000' \
--header 'X-Signature: YOUR_HMAC_SHA256_SIGNATURE' \
--data '{
"amount": 150.75,
"currency": "usd",
"order_id": "ORD-1001",
"network": "tron",
"webhook_link": "https://merchant.example.com/webhooks/fps",
"success_link": "https://merchant.example.com/payments/success",
"error_link": "https://merchant.example.com/payments/error",
"part_payment": true,
"ignore_client_amount": false,
"payment_accuracy": 0,
"fee": 1.5,
"discount": 3,
"additional_info": "Premium subscription",
"auto_convert": false
}'成功响应
{
"status": 201,
"message": "invoice created",
"data": {
"id": "0a718b02-138d-495a-9661-39ca52139c07",
"info": {
"currency": "USD",
"token": null,
"network": null,
"address": null
},
"amount": {
"starting_price": 1000,
"discount_percent": 0,
"merchant_fee_percent": 10,
"service_fee_percent": 1,
"total": 1100
},
"url": {
"webhook": "https://merchant.example/webhook",
"success": "https://merchant.example/success",
"error": "https://merchant.example/error",
"payment": "https://frontend.example/0a718b02-138d-495a-9661-39ca52139c07"
},
"options": {
"part_payment": true,
"ignore_client_amount": false,
"payment_accuracy": 0
},
"additional": {
"order_id": "1",
"info": ""
},
"status": "init",
"expired_at": "2026-01-05 14:30:43",
"created_at": "2026-01-05T13:30:43.000Z"
}
}错误
详细的授权错误列表位于 授权 - 错误
{
"status": 422,
"message": "Validation Error",
"errors": [
{
"field": "currency",
"message": "currency is required"
}
]
}{
"status": 500,
"message": "Internal Server Error"
}