Shipment

友好速搭

开放 API
使用说明 获取授权 全部 API 特殊 API 开放功能

Shipment

Shipment

#Shipment Shipment 为订单的运单,可以通过 API 指定 ShipmentSupplier 物流供应商,设置运单号并设置发货。

Shipment 对象支持 Webhook

Shipment 相关API

GET /shipments获取 Shipment 列表GET /shipments/count获取 Shipment 数量GET /shipments/#{id}获取单个 ShipmentPUT /shipments/#{id}更新 ShipmentPUT /shipments/#{id}/send设置 Shipment 发货

Shipment 属性

    • amount
    •   {  "amount": 0.01 }
      
      Price 类型,Shipment 的运费金额(订单生成时计算)。
    • auto_received_at
    •   { "auto_received_at": "2014-09-01T00:00:01.987+08:00" }
      
      Datetime 类型,Shipment 的自动签收时间(当运单发货前为 null;发货后,会自动设定发货的 2 周后自动签收)。
    • created_at
    •   { "created_at": "2014-09-01T00:00:01.987+08:00" }
      
      Datetime 类型,Shipment 的创建时间。
    • id
    •   { "id": 326 }
      
      Number 类型,Shipment 的唯一整型标识。
    • items
    •   {
          "items": [
                  {
                      "created_at": "2015-04-29T21:18:28.124+08:00",
                      "id": 387,
                      "image": {
                          "alt": "",
                          "created_at": "2014-08-23T22:19:11.207+08:00",
                          "file_name": "1.jpg",
                          "id": 128,
                          "position": 0,
                          "product_id": 143,
                          "src": "http://asset.localtestasset.com/image/53faef5b6387e448ad0000031.jpg1408803551",
                          "updated_at": "2014-08-23T22:19:11.207+08:00",
                          "variant_ids": [
                          ]
                      },
                      "name": "TEST (仅在线支付 - 顺丰)",
                      "options_desc": "颜色:地地道道",
                      "price": 1,
                      "quantity": 1,
                      "updated_at": "2015-04-29T21:18:28.124+08:00",
                      "volume": 0,
                      "weight": 0
                  }
              ]
      }
      
      Array 类型,Shipment 的运单商品列表。
    • order_id
    •   { "order_id": 1 }
      
      Number 类型,Shipment 的所属 Order 的整型标识。
    • serial_number
    •   { "serial_number" : "02" }
      
      String 类型,Shipment 在所属 Order 内的内置编号。
    • ship_no
    •   { "ship_no" : "204997145429" }
      
      String 类型,Shipment 的物流配送单号,用于系统和顾客追踪包裹物流配送状态。
    • ship_type
    •   { "ship_type": "sf-express" }
      
      String 类型,该运单的配送方式,包括:
      • express:普通物流
      • sf-express:顺丰速递
      • ems:EMS
      • surfacemail:平邮
      • self-shipping:商家配送
      • customer-fetch:上门自取
    • shipment_supplier
    • {
        "shipment_supplier": {
                  "code": "ems",
                  "id": 4,
                  "name": "EMS"
              }
      }
      
      Object 类型,Shipment 的ShipmentSupplier 物流供应商。
    • status
    •   { "status": "pending" }
      
      String 类型,Shipment 的状态,包括:
      • pending:等待配送
      • send:配送中
      • recieve:已签收
    • updated_at
    •   { "updated_at": "2015-01-25T22:31:06.155+08:00" }
      
      Datetime 类型,Order 的最近一次修改时间。

GET /shipments

获取 Shipment 列表

    • limit
    • 显示条数(默认10,最大50)
    • page
    • 显示页码(默认1)
    • since_id
    • 筛选id大于since_id的Order
    • fields
    • ,拼接Response显示的字段
    • id
    • 查询指定id
    • ids
    • ,拼接要显示的id范围
    • order_id
    • 查询指定order_id
    • order_ids
    • ,拼接要显示的order_id范围
    • status
    • 缺省筛选包含输入status值的Shipment
    • created_at_min
    • 缺省筛选创建时间在指定日期时间之后的Shipment(格式2014-09-01T01:00:01)
    • created_at_max
    • 缺省筛选创建时间在指定日期时间之前的Shipment(格式2014-09-01T01:00:01)
    • updated_at_min
    • 缺省筛选更新时间在指定日期时间之后的Shipment(格式2014-09-01T01:00:01)
    • updated_at_max
    • 缺省筛选更新时间在指定日期时间之前的Shipment(格式2014-09-01T01:00:01)
    • 获取Shipment列表
    • GET /shipments
    • {
      "shipments": [
          {
              "amount": 16,
              "auto_received_at": "2015-05-29T03:00:00.000+08:00",
              "created_at": "2015-04-29T21:18:28.124+08:00",
              "id": 359,
              "items": [
                  {
                      "created_at": "2015-04-29T21:18:28.124+08:00",
                      "id": 387,
                      "image": {
                          "alt": "",
                          "created_at": "2014-08-23T22:19:11.207+08:00",
                          "file_name": "1.jpg",
                          "id": 128,
                          "position": 0,
                          "product_id": 143,
                          "src": "http://asset.localtestasset.com/image/53faef5b6387e448ad0000031.jpg1408803551",
                          "updated_at": "2014-08-23T22:19:11.207+08:00",
                          "variant_ids": [
                          ]
                      },
                      "name": "TEST (仅在线支付 - 顺丰)",
                      "options_desc": "颜色:地地道道",
                      "price": 1,
                      "quantity": 1,
                      "updated_at": "2015-04-29T21:18:28.124+08:00",
                      "volume": 0,
                      "weight": 0
                  }
              ],
              "order_id": 320,
              "serial_number": "01",
              "ship_no": "",
              "ship_type": "sf-express",
              "shipment_supplier": {
                  "code": "shunfeng",
                  "id": 2,
                  "name": "顺丰速递"
              },
              "status": "pending",
              "updated_at": "2015-04-29T21:18:28.124+08:00"
          },
          {
              "amount": 16,
              "auto_received_at": "2015-05-30T03:00:00.000+08:00",
              "created_at": "2015-04-30T17:25:10.072+08:00",
              "id": 360,
              "items": [
                  {
                      "created_at": "2015-04-30T17:25:10.072+08:00",
                      "id": 388,
                      "image": {
                          "alt": "",
                          "created_at": "2014-08-23T22:19:11.207+08:00",
                          "file_name": "1.jpg",
                          "id": 128,
                          "position": 0,
                          "product_id": 143,
                          "src": "http://asset.localtestasset.com/image/53faef5b6387e448ad0000031.jpg1408803551",
                          "updated_at": "2014-08-23T22:19:11.207+08:00",
                          "variant_ids": [
                          ]
                      },
                      "name": "TEST (仅在线支付 - 顺丰)",
                      "options_desc": "颜色:地地道道",
                      "price": 1,
                      "quantity": 1,
                      "updated_at": "2015-04-30T17:25:10.072+08:00",
                      "volume": 0,
                      "weight": 0
                  }
              ],
              "order_id": 321,
              "serial_number": "01",
              "ship_no": "",
              "ship_type": "sf-express",
              "shipment_supplier": {
                  "code": "shunfeng",
                  "id": 2,
                  "name": "顺丰速递"
              },
              "status": "pending",
              "updated_at": "2015-04-30T17:25:10.072+08:00"
          },
          {
              "amount": 0,
              "auto_received_at": "2015-06-10T03:00:00.000+08:00",
              "created_at": "2015-05-10T20:43:07.241+08:00",
              "id": 362,
              "items": [
                  {
                      "created_at": "2015-05-10T20:43:07.241+08:00",
                      "id": 390,
                      "image": {
                          "alt": "",
                          "created_at": "2014-08-23T22:19:11.207+08:00",
                          "file_name": "1.jpg",
                          "id": 148,
                          "position": 0,
                          "product_id": 147,
                          "src": "http://asset.localtestasset.com/image/53faefbc6387e4491d0000031.jpg1408803551",
                          "updated_at": "2014-08-23T22:19:11.207+08:00",
                          "variant_ids": [
                          ]
                      },
                      "name": "TEST (仅货到付款 - 自提)",
                      "options_desc": "颜色:123",
                      "price": 1,
                      "quantity": 1,
                      "updated_at": "2015-05-10T20:43:07.241+08:00",
                      "volume": 0,
                      "weight": 0
                  }
              ],
              "order_id": 323,
              "serial_number": "01",
              "ship_no": "123",
              "ship_type": "customer-fetch",
              "shipment_supplier": {
                  "code": "ems",
                  "id": 4,
                  "name": "EMS"
              },
              "status": "send",
              "updated_at": "2015-05-12T14:48:09.598+08:00"
          }
      ]
      }
      
    • 获取指定id范围的Shipment列表
    • GET /shipments?ids=360,362
    • {
      "shipments": [
          {
              "amount": 16,
              "auto_received_at": "2015-05-30T03:00:00.000+08:00",
              "created_at": "2015-04-30T17:25:10.072+08:00",
              "id": 360,
              "items": [
                  {
                      "created_at": "2015-04-30T17:25:10.072+08:00",
                      "id": 388,
                      "image": {
                          "alt": "",
                          "created_at": "2014-08-23T22:19:11.207+08:00",
                          "file_name": "1.jpg",
                          "id": 128,
                          "position": 0,
                          "product_id": 143,
                          "src": "http://asset.localtestasset.com/image/53faef5b6387e448ad0000031.jpg1408803551",
                          "updated_at": "2014-08-23T22:19:11.207+08:00",
                          "variant_ids": [
                          ]
                      },
                      "name": "TEST (仅在线支付 - 顺丰)",
                      "options_desc": "颜色:地地道道",
                      "price": 1,
                      "quantity": 1,
                      "updated_at": "2015-04-30T17:25:10.072+08:00",
                      "volume": 0,
                      "weight": 0
                  }
              ],
              "order_id": 321,
              "serial_number": "01",
              "ship_no": "",
              "ship_type": "sf-express",
              "shipment_supplier": {
                  "code": "shunfeng",
                  "id": 2,
                  "name": "顺丰速递"
              },
              "status": "pending",
              "updated_at": "2015-04-30T17:25:10.072+08:00"
          },
          {
              "amount": 0,
              "auto_received_at": "2015-06-10T03:00:00.000+08:00",
              "created_at": "2015-05-10T20:43:07.241+08:00",
              "id": 362,
              "items": [
                  {
                      "created_at": "2015-05-10T20:43:07.241+08:00",
                      "id": 390,
                      "image": {
                          "alt": "",
                          "created_at": "2014-08-23T22:19:11.207+08:00",
                          "file_name": "1.jpg",
                          "id": 148,
                          "position": 0,
                          "product_id": 147,
                          "src": "http://asset.localtestasset.com/image/53faefbc6387e4491d0000031.jpg1408803551",
                          "updated_at": "2014-08-23T22:19:11.207+08:00",
                          "variant_ids": [
                          ]
                      },
                      "name": "TEST (仅货到付款 - 自提)",
                      "options_desc": "颜色:123",
                      "price": 1,
                      "quantity": 1,
                      "updated_at": "2015-05-10T20:43:07.241+08:00",
                      "volume": 0,
                      "weight": 0
                  }
              ],
              "order_id": 323,
              "serial_number": "01",
              "ship_no": "123",
              "ship_type": "customer-fetch",
              "shipment_supplier": {
                  "code": "ems",
                  "id": 4,
                  "name": "EMS"
              },
              "status": "send",
              "updated_at": "2015-05-12T14:48:09.598+08:00"
          }
      ]
      }
      
    • 获取Shipment列表,只显示部分字段
    • GET /shipments?fields=id,amount,order_id
    • {
      "shipments": [
          {
              "id": 359,
              "amount": 16,
              "order_id": 320
          },
          {
              "id": 360,
              "amount": 16,
              "order_id": 321
          },
          {
              "id": 362,
              "amount": 0,
              "order_id": 323
          }
      ]
      }
      
    • 获取指定id之后的Shipment列表
    • GET /shipments?since_id=360
    • {
      "shipments": [
          {
              "amount": 0,
              "auto_received_at": "2015-06-10T03:00:00.000+08:00",
              "created_at": "2015-05-10T20:43:07.241+08:00",
              "id": 362,
              "items": [
                  {
                      "created_at": "2015-05-10T20:43:07.241+08:00",
                      "id": 390,
                      "image": {
                          "alt": "",
                          "created_at": "2014-08-23T22:19:11.207+08:00",
                          "file_name": "1.jpg",
                          "id": 148,
                          "position": 0,
                          "product_id": 147,
                          "src": "http://asset.localtestasset.com/image/53faefbc6387e4491d0000031.jpg1408803551",
                          "updated_at": "2014-08-23T22:19:11.207+08:00",
                          "variant_ids": [
                          ]
                      },
                      "name": "TEST (仅货到付款 - 自提)",
                      "options_desc": "颜色:123",
                      "price": 1,
                      "quantity": 1,
                      "updated_at": "2015-05-10T20:43:07.241+08:00",
                      "volume": 0,
                      "weight": 0
                  }
              ],
              "order_id": 323,
              "serial_number": "01",
              "ship_no": "123",
              "ship_type": "customer-fetch",
              "shipment_supplier": {
                  "code": "ems",
                  "id": 4,
                  "name": "EMS"
              },
              "status": "send",
              "updated_at": "2015-05-12T14:48:09.598+08:00"
          }
      ]
      }
      
    • 获取指定order_id的Shipment列表
    • GET /shipments?order_id=323
    • {
      "shipments": [
          {
              "amount": 0,
              "auto_received_at": "2015-06-10T03:00:00.000+08:00",
              "created_at": "2015-05-10T20:43:07.241+08:00",
              "id": 362,
              "items": [
                  {
                      "created_at": "2015-05-10T20:43:07.241+08:00",
                      "id": 390,
                      "image": {
                          "alt": "",
                          "created_at": "2014-08-23T22:19:11.207+08:00",
                          "file_name": "1.jpg",
                          "id": 148,
                          "position": 0,
                          "product_id": 147,
                          "src": "http://asset.localtestasset.com/image/53faefbc6387e4491d0000031.jpg1408803551",
                          "updated_at": "2014-08-23T22:19:11.207+08:00",
                          "variant_ids": [
                          ]
                      },
                      "name": "TEST (仅货到付款 - 自提)",
                      "options_desc": "颜色:123",
                      "price": 1,
                      "quantity": 1,
                      "updated_at": "2015-05-10T20:43:07.241+08:00",
                      "volume": 0,
                      "weight": 0
                  }
              ],
              "order_id": 323,
              "serial_number": "01",
              "ship_no": "123",
              "ship_type": "customer-fetch",
              "shipment_supplier": {
                  "code": "ems",
                  "id": 4,
                  "name": "EMS"
              },
              "status": "send",
              "updated_at": "2015-05-12T14:48:09.598+08:00"
          }
      ]
      }
      
    • 获取指定status的Shipment列表
    • GET /shipments?status=send
    • {
      "shipments": [
          {
              "amount": 0,
              "auto_received_at": "2015-06-10T03:00:00.000+08:00",
              "created_at": "2015-05-10T20:43:07.241+08:00",
              "id": 362,
              "items": [
                  {
                      "created_at": "2015-05-10T20:43:07.241+08:00",
                      "id": 390,
                      "image": {
                          "alt": "",
                          "created_at": "2014-08-23T22:19:11.207+08:00",
                          "file_name": "1.jpg",
                          "id": 148,
                          "position": 0,
                          "product_id": 147,
                          "src": "http://asset.localtestasset.com/image/53faefbc6387e4491d0000031.jpg1408803551",
                          "updated_at": "2014-08-23T22:19:11.207+08:00",
                          "variant_ids": [
                          ]
                      },
                      "name": "TEST (仅货到付款 - 自提)",
                      "options_desc": "颜色:123",
                      "price": 1,
                      "quantity": 1,
                      "updated_at": "2015-05-10T20:43:07.241+08:00",
                      "volume": 0,
                      "weight": 0
                  }
              ],
              "order_id": 323,
              "serial_number": "01",
              "ship_no": "123",
              "ship_type": "customer-fetch",
              "shipment_supplier": {
                  "code": "ems",
                  "id": 4,
                  "name": "EMS"
              },
              "status": "send",
              "updated_at": "2015-05-12T14:48:09.598+08:00"
          }
      ]
      }
      

GET /shipments/count

获取 Shipment 数量

    • 获取Shipment数量
    • GET /shipments/count
    • {
      "count": 252
      }
      

GET /shipments/#{id}

获取单个 Shipment

    • fields
    • ,拼接Response显示的字段
    • 获取单个Shipment
    • GET /shipments/#{id}
    • {
      "shipment": {
          "amount": 0,
          "auto_received_at": "2015-06-10T03:00:00.000+08:00",
          "created_at": "2015-05-10T20:43:07.241+08:00",
          "id": 362,
          "items": [
              {
                  "created_at": "2015-05-10T20:43:07.241+08:00",
                  "id": 390,
                  "image": {
                      "alt": "",
                      "created_at": "2014-08-23T22:19:11.207+08:00",
                      "file_name": "1.jpg",
                      "id": 148,
                      "position": 0,
                      "product_id": 147,
                      "src": "http://asset.localtestasset.com/image/53faefbc6387e4491d0000031.jpg1408803551",
                      "updated_at": "2014-08-23T22:19:11.207+08:00",
                      "variant_ids": [
                      ]
                  },
                  "name": "TEST (仅货到付款 - 自提)",
                  "options_desc": "颜色:123",
                  "price": 1,
                  "quantity": 1,
                  "updated_at": "2015-05-10T20:43:07.241+08:00",
                  "volume": 0,
                  "weight": 0
              }
          ],
          "order_id": 323,
          "serial_number": "01",
          "ship_no": "123",
          "ship_type": "customer-fetch",
          "shipment_supplier": {
              "code": "ems",
              "id": 4,
              "name": "EMS"
          },
          "status": "send",
          "updated_at": "2015-05-12T14:48:09.598+08:00"
      }
      }
      

PUT /shipments/#{id}

更新 Shipment

    • custom_supplier_name
    • 当Shipment 的 ShipmentSupplier 物流供应商为其他物流时,可以通过此参数设置自定义的物流名称(注意:自定义物流系统将无法追中包裹物流配送状态)
    • ship_no
    • Shipment 的物流配送单号,用于系统和顾客追踪包裹物流配送状态
    • 更新 Shipment 的物流供应商
    • PUT /shipments/362
      {
          "shipment": {
              "shipment_supplier_id": 4
          }
      }
      
    • {
      "shipment": {
          "amount": 0,
          "auto_received_at": "2015-06-10T03:00:00.000+08:00",
          "created_at": "2015-05-10T20:43:07.241+08:00",
          "id": 362,
          "items": [
              {
                  "created_at": "2015-05-10T20:43:07.241+08:00",
                  "id": 390,
                  "image": {
                      "alt": "",
                      "created_at": "2014-08-23T22:19:11.207+08:00",
                      "file_name": "1.jpg",
                      "id": 148,
                      "position": 0,
                      "product_id": 147,
                      "src": "http://asset.localtestasset.com/image/53faefbc6387e4491d0000031.jpg1408803551",
                      "updated_at": "2014-08-23T22:19:11.207+08:00",
                      "variant_ids": [
                      ]
                  },
                  "name": "TEST (仅货到付款 - 自提)",
                  "options_desc": "颜色:123",
                  "price": 1,
                  "quantity": 1,
                  "updated_at": "2015-05-10T20:43:07.241+08:00",
                  "volume": 0,
                  "weight": 0
              }
          ],
          "order_id": 323,
          "serial_number": "01",
          "ship_no": "123",
          "ship_type": "customer-fetch",
          "shipment_supplier": {
              "code": "ems",
              "id": 4,
              "name": "EMS"
          },
          "status": "send",
          "updated_at": "2015-05-12T14:48:09.598+08:00"
      }
      }
      
    • 更新 Shipment 的物流配送单号
    • PUT /shipments/362
      {
          "shipment": {
              "ship_no": "204997145429"
          }
      }
      
    • {
      "shipment": {
          "amount": 0,
          "auto_received_at": "2015-06-10T03:00:00.000+08:00",
          "created_at": "2015-05-10T20:43:07.241+08:00",
          "id": 362,
          "items": [
              {
                  "created_at": "2015-05-10T20:43:07.241+08:00",
                  "id": 390,
                  "image": {
                      "alt": "",
                      "created_at": "2014-08-23T22:19:11.207+08:00",
                      "file_name": "1.jpg",
                      "id": 148,
                      "position": 0,
                      "product_id": 147,
                      "src": "http://asset.localtestasset.com/image/53faefbc6387e4491d0000031.jpg1408803551",
                      "updated_at": "2014-08-23T22:19:11.207+08:00",
                      "variant_ids": [
                      ]
                  },
                  "name": "TEST (仅货到付款 - 自提)",
                  "options_desc": "颜色:123",
                  "price": 1,
                  "quantity": 1,
                  "updated_at": "2015-05-10T20:43:07.241+08:00",
                  "volume": 0,
                  "weight": 0
              }
          ],
          "order_id": 323,
          "serial_number": "01",
          "ship_no": "204997145429",
          "ship_type": "customer-fetch",
          "shipment_supplier": {
              "code": "ems",
              "id": 4,
              "name": "EMS"
          },
          "status": "send",
          "updated_at": "2015-05-12T14:48:09.598+08:00"
      }
      }
      

PUT /shipments/#{id}/send

设置 Shipment 发货

    • 设置 Shipment 发货
    • PUT /shipments/362/send
    • {
      "shipment": {
          "amount": 0,
          "auto_received_at": "2015-06-10T03:00:00.000+08:00",
          "created_at": "2015-05-10T20:43:07.241+08:00",
          "id": 362,
          "items": [
              {
                  "created_at": "2015-05-10T20:43:07.241+08:00",
                  "id": 390,
                  "image": {
                      "alt": "",
                      "created_at": "2014-08-23T22:19:11.207+08:00",
                      "file_name": "1.jpg",
                      "id": 148,
                      "position": 0,
                      "product_id": 147,
                      "src": "http://asset.localtestasset.com/image/53faefbc6387e4491d0000031.jpg1408803551",
                      "updated_at": "2014-08-23T22:19:11.207+08:00",
                      "variant_ids": [
                      ]
                  },
                  "name": "TEST (仅货到付款 - 自提)",
                  "options_desc": "颜色:123",
                  "price": 1,
                  "quantity": 1,
                  "updated_at": "2015-05-10T20:43:07.241+08:00",
                  "volume": 0,
                  "weight": 0
              }
          ],
          "order_id": 323,
          "serial_number": "01",
          "ship_no": "123",
          "ship_type": "customer-fetch",
          "shipment_supplier": {
              "code": "ems",
              "id": 4,
              "name": "EMS"
          },
          "status": "send",
          "updated_at": "2015-05-12T14:48:09.598+08:00"
      }
      }
      
    • 当 Shipment 的状态不允许发货时,会返回错误提示
    • PUT /shipments/360
    • {
      "code": 422,
      "errors": [
          "运单状态不支持配送"
      ]
      }
      
友好速搭,让商业更简单
0元开始
联系客服
电话咨询
服务热线
0755-83051027
获取报价
QQ咨询
微信咨询
微信二维码
在线咨询

在线获取方案和报价,专人快速响应

所选城市 *

您的称呼 *

联系电话 *

网站类型 *

请选择
展示官网 电商网站 微信商城 小程序 其他类型

您希望我们为您提供哪些服务?(可多选)

B2C商城 跨境解决方案 B2B2C平台电商 网站备案 自营电商培训
获取报价

提交成功

你好, XXX女士/先生 ,你的需求已提交成功,后续会有专门的客户经理与你电话联系。谢谢!