订单退款
POST https://{handle}.myshopline.com/admin/openapi/v20261201/order/refund.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handle 是 open001 。订单退款接口
请求头
- Content-Type string required字段值固定为
application/json; charset=utf-8。 - Authorization string required资源的访问令牌。参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入。例子:
Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA
请求体
refund_line_itemsobject[]
退款商品行信息,可关联多个商品行restock_type string商品库存处理例子:returntype string required当以商品进行退款时需要提供商品的发货状态 Unshipped:商品未发货,Returned:商品已退货例子:Unshippedline_item_id long商品行id例子:601location_id string商品库存回退的地点例子:5409714787218633772quantity long试算退款商品数量例子:1shippingobject
运费金额的退款策略amount string指定退款金额例子:1.23full_refund boolean是否退完剩余运费例子:truetransactionsobject[] required
支付单退款信息amount string退款金额,支付单对应的结算币种金额例子: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"例子:USDgateway string支付渠道例子:Paypalid string支付单号,230开头例子:23057520029306658561302511kind string支付单类型例子:refundtype boolean退款类型,ture:原路退款例子:true- currency string该退款对应订单的结算币种,非必填 币种没传,应用会校验订单结算币种是否为店铺币种,如果不是店铺币种,就会报错,提示必须传结算币种:"currency must be X" 币种有传,则校验币种是否为该订单的结算币种,如果不是会报错,提示:"currency must be X"例子:
USD - note string退款备注例子:
退款 - notify boolean是否发送消息通知(同现有B端退款消息发送逻辑)例子:
true - order_id string required订单编号例子:
21057520029298437725452511 - processed_at string退款单发起时间例子:
格式:2023-04-12T22:59:52+08:00
状态码
- 200
- 401
- 429
更多状态码信息,参考 HTTP 状态码。
响应头
traceId
请求的全局唯一标识符。用于追踪请求在系统中的流转,以便于问题发生时进行定位和调试。
响应体
dataobject
数据返回体order_adjustmentsobject[]
调整单信息order_id string该调整单关联的订单号例子:21057520029298437725452511tax_amount string调整单税费金额例子:978tax_amount_setobject
按照店铺币种和交易币种计价的调整单税费金额presentment_moneyobject
市场金额信息amount string市场金额信息例子:2.34currency_code string市场货币例子:USDshop_moneyobject
店铺金额信息amount string店铺金额例子:3.45currency_code string店铺货币例子:USDkind string调整单类型:refund_discrepancy、shipping_refund例子:refund_discrepancyrefund_id string退款单ID,唯一识别amount string调整单金额例子:2.34reason string调整原因:Refund discrepancy、shipping_refund例子:refund_discrepancyamount_setobject
按照店铺币种和交易币种计价的调整单金额shop_moneyobject
店铺金额信息amount string店铺金额例子:2.34currency_code string店铺货币例子:USDpresentment_moneyobject
市场金额信息amount string市场金额例子:2.34currency_code string市场货币例子:USDid string调整单号order_id string该退款单关联的订单号例子:21057520029298437725452511refund_line_itemsobject[]
退款相关的商品行信息subtotal string退款商品行总金额,精度2例子:3.45subtotal_setobject
按照店铺币种和交易币种计价的退款商品行总金额presentment_moneyobject
市场金额信息currency_code string市场货币例子:USDamount string市场金额例子:1.23shop_moneyobject
店铺币种金额信息amount string店铺金额例子:2.36currency_code string店铺货币例子:USDtotal_tax string退款商品行税费总金额,精度2例子:4.56total_tax_setobject
按照店铺币种和交易币种计价的退款商品行税费总金额shop_moneyobject