需要 write_orders 权限点。
更多权限点使用信息,请参考:
POST https://{handle}.myshopline.com/admin/openapi/v20250601/orders/:order_id/refunds/calculate.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
订单退款试算接口
路径参数
  • 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
    试算退款商品行id
    Example: "12343423111"
  • quantity long
    试算退款商品数量
    Example: 1
  • type string required
    当以商品进行退款时, 价格试算需要提供商品的发货状态 Unshipped:商品未发货;Returned:商品已退货
  • shippingobject
    运费
  • amount string
    要退的运费金额,double类型字符串,精度2
    Example: "10.00"
  • full_refund boolean
    是否退完剩余运费
    Example: true
响应
更多状态码信息请参考 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 string
    suggested_refund
    Example: suggested_refund
  • maximum_refundable string
    当前支付单当可退最大金额
    Example: "41.89"
  • order_id string
    订单编号
    Example: "21056836827909126061559008"
  • parent_id string
    支付单号
    Example: "26056836827909126061559008"
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601

ParamOptions

path required
header required

Body

required
{
  "currency": "USD",
  "refund_line_items": [
    {
      "line_item_id": "\"12343423111\"",
      "quantity": 1,
      "type": ""
    }
  ],
  "shipping": {
    "amount": "\"10.00\"",
    "full_refund": true
  }
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601/orders/order_id/refunds/calculate.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json' \
--data '
{
"currency": "USD",
"refund_line_items": [
{
"line_item_id": "\"12343423111\"",
"quantity": 1,
"type": ""
}
],
"shipping": {
"amount": "\"10.00\"",
"full_refund": true
}
}
'
这篇文章对你有帮助吗?

Error loading component.

Error loading component.