订单退款试算
POST https://{handle}.myshopline.com/admin/openapi/v20250601/orders/:order_id/refunds/calculate.json
handle
:店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com
的店铺,其 handle
是 open001
。订单退款试算接口
路径参数
- order_id string required订单id
请求头
- Content-Type required字段值固定为
application/json; charset=utf-8
- Authorization string required资源的访问令牌。请参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
- currency string结算币种,非必填 币种没传,应用会校验订单结算币种是否为店铺币种,如果不是店铺币种,就会报错,提示必须传结算币种:"currency must be X" 币种有传,则校验币种是否为该订单的结算币种,如果不是会报错,提示:"currency must be X"Example:
USD
refund_line_itemsobject[]
试算商品line_item_id string试算退款商品行idExample:"12343423111"
quantity long试算退款商品数量Example:1
type string required当以商品进行退款时, 价格试算需要提供商品的发货状态 Unshipped:商品未发货;Returned:商品已退货shippingobject
运费amount string要退的运费金额,double类型字符串,精度2Example:"10.00"
full_refund boolean是否退完剩余运费Example:true
响应
- 200
- 401
- 429
更多状态码信息请参考 HTTP 状态码
响应头
traceId
traceId
响应体
refundobject
试算结果currency string币种,该退款对应的结算币种Example:"CNY"
refund_line_itemsobject[]
当有商品行应退金额试算请求时返回discount_total_amount string商品行总折扣金额Example:"199.00"
line_item_id string商品行(入参商品行)Example:"33121216544"
price string商品售价Example:"199.00"
quantity integer数量(实际可退数量)Example:1
subtotal string商品行应退金额Example:"195.67"
total_tax string商品行应退税金额Example:"195.67"
type string要计算的商品所属, Unshipped:商品未发货,Shipped:商品已发货, Returned:商品已退货shippingobject
当有运费试算请求时返回amount string订单运费Example:"5.00"
maximum_refundable string最大可退运费Example:"10.00"
tax string订单运费税Example:"1.00"
total_duties_setobject
退款总关税presentment_moneyobject
买家侧金额信息amount string金额Example:8.88
currency_code string币种Example:USD
shop_moneyobject
卖家侧金额信息amount string金额Example:8.88
currency_code string币种Example:USD
transactonsobject[]
当试算金额大于0时,原路返回系统按照规则自动回填支付单及金额amount string金额,该支付单结算币种的对应金额Example:"41.89"
currency string币种,该支付单对应的结算币种Example:"CNY"
gateway string支付渠道Example:bogus
kind stringsuggested_refundExample:suggested_refund
maximum_refundable string当前支付单当可退最大金额Example:"41.89"
order_id string订单编号Example:"21056836827909126061559008"
parent_id string支付单号Example:"26056836827909126061559008"
API Explorer
调试台
这篇文章对你有帮助吗?
Error loading component.