跳转到主要内容
POST
/
api
/
v1
/
refunds
/
create
{
  "refund_id": "<string>",
  "payment_id": "<string>",
  "order_id": "<string>",
  "amount": 123,
  "currency": "USDT",
  "status": "pending",
  "reason": "requested_by_customer",
  "description": "<string>",
  "created_at": 123,
  "metadata": {},
  "invoice_id": "<string>",
  "subscription_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.stablepayfi.ai/llms.txt

Use this file to discover all available pages before exploring further.

授权

Authorization
string
header
必填

Bearer API Key,例如 Bearer sk_live_xxx

X-StablePay-Timestamp
string
header
必填

Unix 时间戳(秒)。必须与服务端时间相差不超过 5 分钟。

X-StablePay-Nonce
string
header
必填

防重放随机字符串,长度 16-64 个字符,建议每次请求使用新的 UUID。

X-StablePay-Signature
string
header
必填

使用商户 API Secret 对 {timestamp}.{nonce}.{requestBody} 计算 HMAC-SHA256,结果为小写 hex。GET 请求的 requestBody 为空字符串。

请求头

X-StablePay-Timestamp
string
必填

Unix 时间戳(秒)。必须与服务端时间相差不超过 5 分钟。

X-StablePay-Nonce
string
必填

防重放随机字符串,长度 16-64 个字符,建议每次请求使用新的 UUID。

Required string length: 16 - 64
X-StablePay-Signature
string
必填

使用商户 API Secret 对 {timestamp}.{nonce}.{requestBody} 计算 HMAC-SHA256,结果为小写 hex。GET 请求的 requestBody 为空字符串。

请求体

application/json

chargepayment_id 必须且只能传一个;不要同时传两个字段。

chargepayment_id 必须二选一且不能同时传。普通支付退款使用 charge;订阅退款使用 payment_id

charge
string
必填

普通支付退款使用。传要退款的普通支付 ID。

refund_id
string
必填

商户自定义唯一退款单号,作为幂等键。

amount
integer<int64>
必填

退款金额,使用币种最小单位,必须大于 0。

必填范围: x >= 1
currency
enum<string>
必填

退款币种,当前请求结构限制为 USDTUSDC

可用选项:
USDT,
USDC
payment_id
string

订阅退款使用。传订阅账单产生的支付 ID。

reason
enum<string>

退款原因。

可用选项:
requested_by_customer,
duplicate,
fraudulent,
expired_uncaptured
description
string

退款说明。

refund_to_address
string

可选链上退款目标地址。

refund_to_address_id
integer<int64>

可选链上退款目标地址 ID;仅大于 0 时生效。

metadata
object

商户自定义元数据。

响应

退款创建成功。

创建退款成功后返回的退款对象。

refund_id
string

商户提供的退款单号。

payment_id
string

订阅退款场景返回的支付标识。

order_id
string

商户订单 ID,普通支付退款场景返回。

amount
integer<int64>

退款金额,使用币种最小单位。

currency
enum<string>

退款币种。

可用选项:
USDT,
USDC
status
enum<string>

退款状态。新建退款当前通常返回 processing

可用选项:
pending,
processing,
completed,
failed,
canceled
reason
enum<string>

退款原因。

可用选项:
requested_by_customer,
duplicate,
fraudulent,
expired_uncaptured
description
string

退款说明。

created_at
integer<int64>

退款创建时间,Unix 秒。

metadata
object

商户自定义元数据。

invoice_id
string

订阅退款时返回的发票 ID。

subscription_id
string

订阅退款时返回的订阅 ID。

Last modified on April 30, 2026