订单退款
POST https://{handle}.myshopline.com/admin/openapi/v20260301/order/refund.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handle 是 open001 。订单退款接口
请求头
- Content-Type string required字段值固定为
application/json; charset=utf-8。 - Authorization string required资源的访问令牌。参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入。Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
- notify boolean是否发送消息通知(同现有B端退款消息发送逻辑)Example:
true - order_id string required订单编号Example:
21057520029298437725452511 - processed_at string退款单发起时间Example:
格式:2023-04-12T22:59:52+08:00 refund_line_itemsobject[]
退款商品行信息,可关联多个商品行type string required当以商品进行退款时需要提供商品的发货状态 Unshipped:商品未发货,Returned:商品已退货Example:Unshippedline_item_id long商品行idExample:601location_id string商品库存回退的地点Example:5409714787218633772quantity long试算退款商品数量Example:1restock_type string商品库存处理Example:returnshippingobject
运费金额的退款策略amount string指定退款金额Example:1.23full_refund boolean是否退完剩余运费Example:truetransactionsobject[] required
支付单退款信息amount string退款金额,支付单对应的结算币种金额Example:2.34currency string支付单对应的结算币种,非必填 币种没传,应用会校验该笔支付单结算币种是否为店铺币种,如果不是店铺币种,就会报错,提示必须传结算币种:"the input currency must be the settlement currency of the payment: X" 币种有传,则校验币种是否为该支付单的结算币种,如果不是会报错,提示:"the input currency must be the settlement currency of the payment: X"Example:USDgateway string支付渠道Example:Paypalid string支付单号,230开头Example:23057520029306658561302511kind string支付单类型Example:refundtype boolean退款类型,ture:原路退款Example:true- currency string该退款对应订单的结算币种,非必填 币种没传,应用会校验订单结算币种是否为店铺币种,如果不是店铺币种,就会报错,提示必须传结算币种:"currency must be X" 币种有传,则校验币种是否为该订单的结算币种,如果不是会报错,提示:"currency must be X"Example:
USD - note string退款备注Example:
退款
状态码
- 200
- 401
- 429
更多状态码信息,参考 HTTP 状态码。
响应头
traceId
请求的全局唯一标识符。用于追踪请求在系统中的流转,以便于问题发生时进行定位和调试。
响应体
dataobject
数据返回体total_duties_setobject
退款总关税presentment_moneyobject
买家侧金额信息amount string金额Example:8.88currency_code string币种Example:USDshop_moneyobject
卖家侧金额信息currency_code string币种Example:USDamount string金额Example:8.88transactionsobject[]
退款支付单信息processed_at string退款单更新时间Example:1673404700862status string处理状态, pending, failure, success, and errorExample:pendingamount long退款支付单结算币种对应的退款金额,精度2create_at string创建时间Example:1673404700862currency string支付币种,支付单对应的结算币种Example:USDid string支付单号Example:23057520029306658561302511kind string支付单类型,此处仅为refundExample:refundorder_id string该调整单关联的订单号Example:21057520029298437725452511create_at string退款单创建时间Example:1673404700862id string退款单ID,唯一识别Example:2605755870074105241861note string退款备注Example:备注order_adjustmentsobject[]
调整单信息amount_setobject
按照店铺币种和交易币种计价的调整单金额presentment_moneyobject
市场金额信息amount string市场金额Example:2.34currency_code string市场货币Example:USDshop_moneyobject
店铺金额信息amount string店铺金额Example:2.34currency_code string店铺货币Example:USDkind string调整单类型:refund_discrepancy、shipping_refundExample:refund_discrepancyid string调整单号refund_id string退款单ID,唯一识别amount string调整单金额Example:2.34order_id string该调整单关联的订单号Example:21057520029298437725452511tax_amount string调整单税费金额Example:978tax_amount_setobject
按照店铺币种和交易币种计价的调整单税费金额presentment_moneyobject
市场金额信息amount string市场金额信息Example:2.34currency_code string市场货币Example:USDshop_moneyobject
店铺金额信息amount string店铺金额Example:3.45currency_code string店铺货币Example:USDreason string调整原因:Refund discrepancy、shipping_refundExample:refund_discrepancyorder_id string该退款单关联的订单号Example:21057520029298437725452511refund_line_itemsobject[]
退款相关的商品行信息subtotal string退款商品行总金额,精度2Example:3.45subtotal_setobject
按照店铺币种和交易币种计价的退款商品行总金额presentment_moneyobject
市场金额信息currency_code string市场货币Example:USDamount string市场金额Example:1.23shop_moneyobject
店铺币种金额信息amount string店铺金额Example:2.36currency_code string店铺货币Example:USDtotal_tax string退款商品行税费总金额,精度2Example:4.56total_tax_setobject
按照店铺币种和交易币种计价的退款商品行税费总金额shop_moneyobject
店铺币种金额信息amount string店铺金额Example:6.14currency_code string店铺货币Example:USDpresentment_moneyobject
市场金额信息amount string店铺金额Example:3.24currency_code string店铺货币Example:USDid long商品行idline_item_id long商品快照表的id, 系统生成,与订单号唯一确认一个商品Example:601quantity long退款商品数量Example:1restock_type stringreturn-返还 只有未返还Example:return
API Explorer
调试台
这篇文章对你有帮助吗?