开放 API
使用说明
获取授权
全部 API
- Shop
- Metafields
- Customer
- CustomerAddress
- Account
- Product
- ProductVariant
- ProductImage
- Theme
- Asset
- Country
- Province
- City
- District
- ScriptTag
- Order
- Shipment
- ShipmentSupplier
- Payment
- PaymentMethod
- Redirect
- Page
- Webhook
- Blog
- BlogAuthor
- CustomerLevel
- StoreFile
- Promotion
- Coupon
- Post
- AfterSale
Payment
Payment
Payment 是 Order 的支付记录,同个 Order 中仅允许有一条记录有效(payment.is_available = true
)。
Payment 对象支持 Webhook。
Payment 相关API
Payment 相关属性
- amount
Price 类型,Payment 的支付金额。{ "amount": 0.01 }
- bank_code
String 类型,Payment 的网银支付编码,当且仅当{ "bank_code" : "" }
payment_method.pay_type
为网银支付时不为空。
- created_at
Datetime 类型,Payment 的创建时间。{ "created_at": "2014-09-01T00:00:01.987+08:00" }
- exipired_at
Datetime 类型,Payment 的支付过期时间。当且仅当{ "exipired_at": "2014-09-01T00:00:01.987+08:00" }
payment_method.payment_method_type
为online
时存在,为 Payment 创建时会设定为创建时间的两天后支付过期。
- gateway_payment_no
String 类型,Payment 的第三方支付网关支付编号,当且仅当{ "gateway_payment_no" : "" }
payment_method.payment_method_type
为online
且status
为paid
时存在,用于与第三方支付网关对账。
- id
Number 类型,Payment 的唯一整型标识。{ "id": 326 }
- is_available
Bool 类型,标识 Payment 是否为有效支付。{ "is_available" : true }
- payment_method
Object 类型, Payment 的支付方式,可参考PaymentMethod。{ "payment_method": { "gateway": "alipay", "id": 22, "name": "支付宝(担保交易) - 自主配置", "pay_type": "alipay_partner", "payment_method_type": "online" } }
- status
String 类型,Payment 的支付状态,包括:{ status": "pending" }
- pending:等待支付
- paid:支付完成
- expired:支付超时
- pay_by_other
Boolean 类型,Payment 的代付状态,包括:{ pay_by_other": true }
- true:订单由别人代付
- false:订单由自己支付
- updated_at
Datetime 类型,Payment 的最近一次修改时间。{ "updated_at": "2014-09-01T00:00:01.987+08:00" }
GET /orders/#{id}/payments
获取 Order 所有 Payment
- fields
- 以
,
拼接Response显示的字段
- 获取 Order 所有 Payment
- GET /orders/325/payments
{ "payments": [ { "amount": 11, "bank_code": "", "created_at": "2015-05-12T16:47:20.179+08:00", "exipired_at": "2015-05-14T03:00:00.000+08:00", "gateway_payment_no": null, "id": 317, "is_available": false, "mode": "online", "payment_method": { "gateway": "alipay", "id": 22, "name": "支付宝(担保交易) - 自主配置", "pay_type": "alipay_partner", "payment_method_type": "online" }, "status": "pending", "updated_at": "2015-05-12T16:48:06.468+08:00" }, { "amount": 10, "bank_code": "", "created_at": "2015-05-12T16:48:06.468+08:00", "exipired_at": "2015-05-14T16:48:06.468+08:00", "gateway_payment_no": null, "id": 318, "is_available": true, "mode": "online", "payment_method": { "gateway": "alipay", "id": 22, "name": "支付宝(担保交易) - 自主配置", "pay_type": "alipay_partner", "payment_method_type": "online" }, "status": "pending", "updated_at": "2015-05-12T16:48:06.468+08:00" } ] }
GET /orders/#{id}/payments/count
获取 Order 所有 Payment 的数量
- 获取 Order 所有 Payment 的数量
- GET /orders/12032/payments/count
{ "count": 2 }
GET /orders/#{id}/payments/#{id}
获取 Order 的单个 Payment
- fields
- 以
,
拼接Response显示的字段
- 获取 Order 的单个 Payment
- GET /orders/325/payments/318
{ "payment": { "amount": 10, "bank_code": "", "created_at": "2015-05-12T16:48:06.468+08:00", "exipired_at": "2015-05-14T16:48:06.468+08:00", "gateway_payment_no": null, "id": 318, "is_available": true, "mode": "online", "payment_method": { "gateway": "alipay", "id": 22, "name": "支付宝(担保交易) - 自主配置", "pay_type": "alipay_partner", "payment_method_type": "online" }, "status": "pending", "updated_at": "2015-05-12T16:48:06.468+08:00" } }