API Reference
API Reference

业务对象

交易单(Trade)业务对象字段说明

属性名类型描述
trade_idstring交易单ID
access_nostring接入方编号
merchant_idstring商户ID
amountstring支付金额,截取两位小数
currencystring币种
customer_idstring平台顾客 ID
callback_urlstringwebhook 通知回调地址
metadatamap[string]string一组可附加到对象上的键值对,允许您以结构化格式存储附加信息。
last_payment_errorLastPaymentError最后一次支付错误信息,如果该字段有值,则表示支付失败。
next_actionNextAction下一步操作
order_idstring接入方订单号
last_trans_idstring订单流水ID。
paid_atstring支付成功时间
payment_modestring支付业务模式:
  • subscription:首次订阅支付,需要收集顾客支付信息,传入 payment_method_data 字段,支付成功时会返回 payment_token 用于后续订阅续费
  • recurring_payment:订阅续订支付,需要传入 payment_token 完成支付,无需收集用户支付信息
payment_tokenstring订阅支付时,返回的支付凭证,用于后续订阅续费
payment_methodstring支付方式
payment_channelstring支付渠道
return_urlstring在类似 3DS 跳转支付场景时,支付渠道受理成功后重定向的页面
trade_statusstring支付单状态:
  • requires_payment_method:初始状态
  • payment_failed:支付失败
  • processing:支付处理中
  • succeeded:支付成功
  • closed:已关闭
txn_timestring交易发起时间,客户端发起接口的时间
created_atstring创建时间
refund_statusstring退款状态:
  • no_refund:无退款
  • partially_refunded:部分退款
  • refunded:退款完成
total_refunded_amountstring退款金额,截取两位小数
session_idstringSession 唯一标识
session_urlstringSession 的访问地址
refer_infoReferInfo顾客的来源信息
order_typestring在不同采购或计费场景下生成的订单类型:
  • onetime_payment: 一次性付款请求创建的交易订单
  • subscription: 发起订阅付款请求创建的交易订单
  • recurring_payment: Subotiz订阅续订服务创建的交易订单
  • token_payment: 商家使用现有订阅合同令牌向客户扣款时创建的交易订单
line_itemsLineItem[]客户购买的商品明细
discountsDiscounts应用于交易的折扣,包括此交易的所有折扣信息
closed_atstring交易关闭时间
closed_reasonstring关闭原因
  • timeout: 交易支付超时
  • renewal_failed: 订阅续订扣费失败(含重试)
first_source_channelstring交易关联的结账会话首次创建来源渠道
last_source_channelstring交易关联的结账会话最后访问的来源渠道
billing_addressBillingAddress顾客的账单地址信息

ReferInfo

属性名类型描述
country_codestring客户下单时的国家 (ISO 2格式)
ipstring客户下单时的 IP
devicestring客户设备的类型
  • pc:指个人电脑设备类型,包括台式机和笔记本电脑。
  • mobile:指移动端设备类型,包括智能手机和平板电脑。
user_agentstring客户端的 user agent

NextAction

属性名类型描述
typestring客户端下一步需要操作的类型:
  • redirect:重定向
redirectNextActionRedirect重定向信息
clientNextActionClient客户端操作信息

NextActionRedirect

属性名类型描述
urlstring重定向 URL

NextActionClient

属性名类型描述
confirm_urlstring确认支付 URL
apple_pay_sessionstringApplePay 创建使用的数据

LastPaymentError

属性名类型描述
codestring系统返回交易返回码
messagestring系统返回交易返回说明

LineItem

属性名类型描述
product_idstring所购买商品的商品 ID
price_idstring与所购买商品关联的定价方案 ID
pricestring应用任何折扣之前的价格
quantityint购买的商品数量

Discounts

属性名类型描述
current_periodCurrentPeriodDiscount[]当前时期的折扣详情

CurrentPeriodDiscount

属性名类型描述
discount_idstring折扣的唯一标识符
discount_amountstring折扣金额
discount_codestring使用的折扣代码

BillingAddress

属性名类型描述
namestring收件人全名
address_line1string地址行1,主要街道地址
address_line2string地址行2,附加地址信息
country_codestring国家代码,ISO2格式(如:US、GB、CN)
province_codestring省/州代码(如:CA代表加利福尼亚州)
citystring城市名称
areastring区域/区/县名称
postal_codestring邮政编码
phonestring不含国家代码的电话号码
phone_area_codestring电话国家代码(如:+1、+44、+86)
emailstring用于账单通知和联系的电子邮件地址
These developer docs retire on 2026-08-30. Visit the new docs: NEW DOCS本开发者文档将于 2026-08-30下线,请访问新版文档: 新文档