需要 write_shipping 权限点。
更多权限点使用信息,请参考:
POST https://{handle}.myshopline.com/admin/openapi/v20250601/logistics/shipping_zones.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
批量设置物流运费方案,本次操作作为最新的物流运费方案,之前的运费方案将会被完全覆盖掉
请求头
  • Content-Type required
    字段值固定为application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。请参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
  • shipping_zonesobject
    设置区域方案对象
  • delivery_plansobject[] required
    多个区域方案数组对象
  • area_name string required
    区域方案名称
    Example: 中国运费
  • areasobject[] required
    区域对象
  • area_codes array
    非国家区域地址编码(如省码、市码)
    Example: 12001
  • country_code string required
    国家编码
    Example: CN
  • shipping_plansobject[] required
    运费信息对象
  • charge_mode integer required
    收费模式(1-按重量,3-按件计费,4-固定运费)必须在合适的范围内[1,4]
    Example: 1
  • conditional_interval integer required
    条件区间(1-无,2-按商品件数,3-按订单重量,4-按订单价格) 必须在合适的范围内[1, 4] eg. 1
    Example: 3
  • custom_amount string
    自定义运费金额(精度2的double类型字符串,当chargeMode=3时,为固定运费金额)
    Example: "90.88"
  • delivery_name string required
    运费方案名称,运费名称会展示给到用户查看
    Example: 中国运费-01
  • first_amount string
    起始金额(精度2的double类型字符串) eg. "1.08"
    Example: "3.80"
  • first_measure string
    起始量(精度2的double类型字符串,当chargeMode=2时,必须为整数)eg:"1.08"
    Example: 3
  • incr_amount string
    续量金额(精度2的double类型字符串) eg. "1.08"
    Example: "1.88"
  • incr_measure string
    续量(精度2的double类型字符串) eg. "2.01"
    Example: "1.00"
  • intervalsobject[]
    区间范围对象(当conditionalInterval等于2、3、4时,必须传值)
  • custom_amount string
    自定义运费金额(精度2的double类型字符串,当chargeMode=3时,为固定运费金额)
    Example: "90.88"
  • end_interval string
    结束区间(精度2的double类型字符串)
    Example: "3"
  • first_amount string
    起始金额(精度2的double类型字符串) eg. "1.08"
    Example: "3.80"
  • first_measure string
    起始金额(精度2的double类型字符串) eg. "1.08"
    Example: 3
  • incr_amount string
    续量金额(精度2的double类型字符串) eg. "1.08"
    Example: "1.88"
  • incr_measure string
    续量(精度2的double类型字符串) eg. "2.01"
    Example: "1.00"
  • measure_unit string
    计量单位(kg-千克,g-克,lb-磅,oz-盎司,当chargeMode=1时,必填) eg. kg
    Example: "kg"
  • start_interval string
    开始区间(精度2的double类型字符串)
    Example: "0"
  • measure_unit string
    计量单位(kg-千克,g-克,lb-磅,oz-盎司,当chargeMode=1时,必填) eg. kg
    Example: "kg"
  • group_type integer
    运费配置类型(1:通用分组,2:自定义分组,不传则默认为1通用分组)
    Example: 1
  • product_group_infoobject
    商品组信息
  • product_group_name string
    商品分组名称,groupType为2 自定义分组时必填;groupType为1 通用分组时为默认值:通用分组
    Example: "自定义运费01"
  • product_group_seq string
    商品分组序列号,更新时必填,新增时为空
    Example: "PG5938934496267609846"
  • product_ids array
    商品序列号列表,groupType为2 自定义分组时必填(商品spu序列号)
    Example: ["18053690657964710749100412","18055123775710848634010412"]
响应
更多状态码信息请参考 HTTP 状态码

响应头
  • traceId
    traceId
响应体
  • shipping_zoneobject
    运费方案设置返回对象
  • ext_map map
    扩展信息
    Example: [object Object]
  • group_seq string
    分组唯一序列号
  • is_success boolean
    是否成功(true:成功,false:失败)
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601

ParamOptions

header required

Body

required
{
  "shipping_zones": {
    "delivery_plans": [
      {
        "area_name": "中国运费",
        "areas": [
          {
            "area_codes": [
              "12001"
            ],
            "country_code": "CN"
          }
        ],
        "shipping_plans": [
          {
            "charge_mode": 1,
            "conditional_interval": 3,
            "custom_amount": "\"90.88\"",
            "delivery_name": "中国运费-01",
            "first_amount": " \"3.80\"",
            "first_measure": "3",
            "incr_amount": "\"1.88\"",
            "incr_measure": "\"1.00\"",
            "intervals": [
              {
                "custom_amount": "\"90.88\"",
                "end_interval": "\"3\"",
                "first_amount": " \"3.80\"",
                "first_measure": "3",
                "incr_amount": "\"1.88\"",
                "incr_measure": "\"1.00\"",
                "measure_unit": "\"kg\"",
                "start_interval": "\"0\""
              }
            ],
            "measure_unit": "\"kg\""
          }
        ]
      }
    ],
    "group_type": 1,
    "product_group_info": {
      "product_group_name": "\"自定义运费01\"",
      "product_group_seq": "\"PG5938934496267609846\"",
      "product_ids": [
        "[\"18053690657964710749100412\",\"18055123775710848634010412\"]"
      ]
    }
  }
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601/logistics/shipping_zones.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json' \
--data '
{
"shipping_zones": {
"delivery_plans": [
{
"area_name": "中国运费",
"areas": [
{
"area_codes": [
"12001"
],
"country_code": "CN"
}
],
"shipping_plans": [
{
"charge_mode": 1,
"conditional_interval": 3,
"custom_amount": "\"90.88\"",
"delivery_name": "中国运费-01",
"first_amount": " \"3.80\"",
"first_measure": "3",
"incr_amount": "\"1.88\"",
"incr_measure": "\"1.00\"",
"intervals": [
{
"custom_amount": "\"90.88\"",
"end_interval": "\"3\"",
"first_amount": " \"3.80\"",
"first_measure": "3",
"incr_amount": "\"1.88\"",
"incr_measure": "\"1.00\"",
"measure_unit": "\"kg\"",
"start_interval": "\"0\""
}
],
"measure_unit": "\"kg\""
}
]
}
],
"group_type": 1,
"product_group_info": {
"product_group_name": "\"自定义运费01\"",
"product_group_seq": "\"PG5938934496267609846\"",
"product_ids": [
"[\"18053690657964710749100412\",\"18055123775710848634010412\"]"
]
}
}
}
'
这篇文章对你有帮助吗?

Error loading component.

Error loading component.