Skip to content
web240 edited this page Jul 16, 2016 · 1 revision

政采云开放api文档

开放网关信息说明

开放平台用户可以通过发送http请求来调用服务, 例如 发送请求:

http://zcy.dithub.com/api/gateway?appKey=ec2926bb&pampasCall=order.query&start=201512241430&end=201601010000&status=0&pageNo=2&pageSize=10&sign=049064e2b11f4715bc0b8fd0b304883d 

其中, /api/gateway 是开放平台统一网关地址, appKey是分配给调用者的唯一标识, pampasCall=order.query表示要调用key为"order.query"的开放api, sign是表示签名参数签名, 防止被篡改, 其余的为该开放api的调用参数

  • 签名算法如下:

    所有调用参数(包括pampasCall, 但不包括sign本身), 按照字母序升序排列, 然后调用者再附加上给分配给自己的appSecret, 再做md5签名

    比如调用参数为

 /api/gateway?appKey= ec2926bb&pampasCall=order.query&start=201512241430&end=201601010000&status=0&pageNo=2&pageSize=10

则首先参数名按照字母序升序排列, 得到

appKey=ec2926bb&end=201601010000&pageNo=2&pageSize=10&pampasCall=order.query&start=201512241430&status=0 

再假设分配给客户的 appSecret为fccb6776 , 则将其附加到参数末尾, 得到

appKey=ec2926bb&end=201601010000&pageNo=2&pageSize=10&pampasCall=order.query&start=201512241430&status=0fccb6776 

再计算这段字符串的md5, 得到校验码为049064e2b11f4715bc0b8fd0b304883d, 所以最后的请求为:

  /api/gateway?appKey=ec2926bb&pampasCall=order.query&start=201512241430&end=201601010000&status=0&pageNo=2&pageSize=10&sign=049064e2b11f4715bc0b8fd0b304883d 
  • 返回值说明:

    返回信息统一以json形式提供.

    对于错误信息, 形式为:

    ```
    {
      "success": false,
      "error":"查询发货单失败"
    }
    ```
    

    对于成功信息, 形式为:

     {
        "success": true
        "result":  .....
     }
    

    也就是说, 可以通过success字段的值来判断本次调用是否成功, 如果成功, 返回结果可以通过result字段获取, 如果失败, 失败原因可以通过error信息获取

类目相关

查询后台类目

  • 请求 url 地址 (0 代表虚拟根节点, >0 代表从此节点开始的类目树)

    GET  category.back.tree
    
  • 请求参数示例

    root=0&depth=3
    
  • 请求参数说明

    参数名 说明 必填 类型 长度 备注
    depth 类目树深度 整型 16 默认深度最高到4
    root 以指定编号的节点为根 整形 16
  • 返回结果集

    • 正确结果示例, HTTP STATUS=200

      {
          "success":true,
           "result": {
            "node": {"id": 0, "pid": -1, "name": "虚拟根节点", "level": -1, "hasChildren": 1, "status": 1, "hasSpu": 0},
            "children": [
              {
                "node": {"id": 1, "pid": 0, "name": "类目1", "level": 0, "hasChildren": 1, "status": 1, "hasSpu": 0},
                "children": [
                  {
                    "node": {"id": 2, "pid": 1, "name": "类目2", "level": 1, "hasChildren": 1, "status": 1, "hasSpu": 0},
                    "children": [
                      {
                        "node": {"id": 3, "pid": 2, "name": "类目3", "level": 2, "hasChildren": 0, "status": 1, "hasSpu": 1},
                        "children": []
                      }
                    ]
                  },
                  {
                    "node": {"id": 4, "pid": 1, "name": "类目4", "level": 1, "hasChildren": 0, "status": 1, "hasSpu": 0},
                    "children": []
                  }
                ]
              }
            ]
          }
      }
  • 正确结果说明

    参数名 说明 类型 备注
    node.id 类目 Id 整型
    node.pid 上级类目 Id 整型
    node.name 类目名 字符串
    node.level 类目层级 整型
    node.hasChildren 是否有子类目 布尔
    node.hasSpu 是否下挂 SPU 布尔
    children 子类目列表 递归结构
  • 错误结果示例, HTTP STATUS=500

    {"success": false,
     "error": "后台类目查询失败"
     }
    

商品相关

创建商品(不通过spu)

  • 请求服务名

     POST item.nospu.create
    
  • 请求参数示例

     data = {
         "item": {
             "categoryId": "140", 
             "name": "示例商品", 
             "mainImage": "http://showcase.b0.upaiyun.com/users/2/2-1发商品-默认.jpg",
             "itemCode": "your item unique id here",
             "brandName": "nike"
         }, 
         "itemDetail": {
           images: [
             "http://showcase.b0.upaiyun.com/users/2/2-1发商品-默认.jpg",
             "http://showcase.b0.upaiyun.com/users/2/2-2发商品-默认.jpg"
             ],
           "detail": "foobar",
           "packing": {"单机":"1 件", "耳机":"1个"},
           "service": "这是一个三包服务"
           
         }, 
         "skuAttributes": [
             {
                 "attrKey": "颜色", 
                 "attrVal": "红色"
             }, 
             {
                 "attrKey": "尺寸", 
                 "attrVal": ""
             }, 
             {
                 "attrKey": "尺寸", 
                 "attrVal": ""
             }
         ],
          "otherAttributes": [
             {
                 "attrKey": "产地", 
                 "attrVal": "丝绒", 
             }, 
             {
                 "attrKey": "产地", 
                 "attrVal": "杭州",
             }, 
             {
                 "attrVal": "水纹", 
                 "attrKey": "次要"
             }, 
             {
                 "attrKey": "产地", 
                 "attrVal": "扁的", 
             }, 
             {
                 "attrKey": "产地", 
                 "attrVal": "方形", 
             }, 
             {
                 "attrKey": "人群", 
                 "attrVal": "青少年", 
             }
         ], 
         "skus": [
             {
                 "price": 2000, 
                 "originPrice": 3000, 
                 "quantity": "19", 
                 "skuCode": "code-1", 
                 "attrs":[
                   "颜色":"红色",
                   "尺寸":"" 
                 ]
             }, 
             {
                 "price": 3000, 
                 "originPrice": 5000, 
                 "quantity": "30", 
                 "skuCode": "code-2", 
                 "attrs":[
                   "颜色":"绿色",
                   "尺寸":"" 
                 ]
    
             }
         ], 
         "shipFee": {
         "deliverFeeTemplateId": 22,
         "deliverFeeTemplateName": "江浙沪包邮模板"
        } 
     }
  • 请求参数说明

    参数名 说明 必填 类型 长度 备注
    categoryId 后台类目 Id 整型 32
    name 商品名称 字符串 128
    itemCode 商品外部唯一标识 字符串 32
    mainImage 商品主图 字符串 128
    brandName 品牌名称 字符串 32
    images 辅图 字符串 128 最多允许四张
    detail 商品详情描述 字符串 2048 详情富文本
    packing 包装清单 字符串 512 json存储的键值对
    service 售后服务 字符串 256
    skuAttributes 销售属性键值对的列表 字符串 255
    otherAttributes 非销售属性键值对列表 字符串 2048
    attrKey 属性键 字符串 32
    attrVal 属性值 字符串 64
    skus sku列表 字符串 2048
    price sku价格 整型 32 以分为单位
    originPrice sku原价 整型 32 以分为单位
    quantity sku数量 整型 32
    skuCode 外部sku编码 字符串 32
    attrs 销售属性 字符串 512 有几个销售属性填几个, 至少1个, 最多4个 shipFee
    deliverFeeTemplateId 运费模板id 整型 32
    deliverFeeTemplateName 运费模板名称 字符串 127
  • 返回结果集

    • 正确结果示例, HTTP STATUS=200

      {"success": true,
       "result": 123
       }
      

      返回新创建的商品id

    • 错误结果示例, HTTP STATUS=500

      {"success": false,
      "error":"创建商品失败"
      }
      

修改商品信息(通过id)

  • 请求服务名

     POST item.update.byid
    
  • 请求参数示例

     data = {
         "item": {
             "id": "123", 
             "name": "示例商品2", 
             "mainImage": "http://showcase.b0.upaiyun.com/users/2/2-1发商品-更新.jpg",
             "brandName": "nike"
         }, 
         "itemDetail": {
           images: [ 
           "http://showcase.b0.upaiyun.com/users/2/2-1发商品-默认.jpg",
           "http://showcase.b0.upaiyun.com/users/2/2-2发商品-默认.jpg"}
           ],
           "detail":"foobar",
           "packing": {"单机":"1 件", "耳机":"1个"},
           "service": "这是一个三包服务"
     },
         "skus": [
             {
                 "id": "11",
                 "price": 2000, 
                 "originPrice": 3000, 
                 "quantity": "19" 
             }, 
             {
                 "id": "12",
                 "price": 3000, 
                 "originPrice": 5000, 
                 "quantity": "30"
             }
         ]
    }
     
+ 请求参数说明

   参数名 |  说明 | 必填 | 类型 | 长度 | 备注
   -------|-------|------|------|------|-----
   id | 商品id | 是 | 整型 | 32 |
   name | 商品名称 | 是 | 字符串 | 128 |
   mainImage|商品主图|是|字符串|128|
   brandName | 品牌名称 | 否 | 字符串 | 32 |
   images |辅图 |否|字符串 |128|最多允许四张
   detail|商品详情描述|是|字符串|2048|详情富文本
   packing|包装清单|否|字符串|512|json存储的键值对
   service|售后服务|否|字符串|256|
   skus | sku列表 | 是 | 字符串 | 2048 |
   id | sku id | 是 | 整型 | 32 |
   price|sku价格|是|整型|32|以分为单位
   originPrice|sku原价|否|整型|32|以分为单位
   quantity|sku数量|是| 整型 |32|
   
+ 返回结果集

   - 正确结果示例, HTTP `STATUS=200`
   
     ```
     {"success": true,
     "result": true
     }
     ```
     代表更新成功
   
   - 错误结果示例, HTTP `STATUS=500`
   
     ```
     {"success": false,
     "error":更新商品失败
     }
     ```	
     
### 修改商品信息(通过外部标识)
  注意sku属性维度不能增加, 属性值可以增加, 但是skuCode必须保证不变, 政采云根据skuCode是否已存在来判断是否有值增加

+ 请求服务名

   ```
   POST item.update.by.code
   ```
+ 请求参数示例
   
   ```json
   data = {
       "item": {
           "itemCode": "your unique code here", 
           "name": "示例商品2", 
           "mainImage": "http://showcase.b0.upaiyun.com/users/2/2-1发商品-更新.jpg",
           "brandName": "nike"
       }, 
       "itemDetail": {
           images: [
            "http://showcase.b0.upaiyun.com/users/2/2-1发商品-默认.jpg",
            "http://showcase.b0.upaiyun.com/users/2/2-2发商品-默认.jpg"
           ],
         "detail":"foobar",
         "packing": {"单机":"1 件", "耳机":"1个"},
         "service": "这是一个三包服务"
       }, 
       "skus": [
           {
               "skuCode": "foo",
               "price": 2000, 
               "originPrice": 3000, 
               "quantity": "19", 
               "attrs": [...]
           }, 
           {
               "skuCode": "bar",
               "price": 3000, 
               "originPrice": 5000, 
               "quantity": "30",
               "attrs": [...]
           }
       ] 
     	}
   
   ```
+ 请求参数说明

   参数名 |  说明 | 必填 | 类型 | 长度 | 备注
   -------|-------|------|------|------|-----
   itemCode | 商品外部标识 | 是 | 字符串 | 32 |
   name | 商品名称 | 否 | 字符串 | 128 |
   mainImage|商品主图|否|字符串|128|
   brandName | 品牌名称 | 否 | 字符串 | 32 |
   images |辅图 |否|字符串 |128|最多允许四张
   detail|商品详情描述|否|字符串|2048|详情富文本
   packing|包装清单|否|字符串|512|json存储的键值对
   service|售后服务|否|字符串|256|	
   skus | sku列表 | 否 | 字符串 | 2048 |
   skuCode | sku 外部标识 | 否 | 字符串 | 32 |如果有sku信息, 那么这个字段必须传
   price|sku价格|是|整型|32|以分为单位
   originPrice|sku原价|否|整型|32|以分为单位
   quantity|sku数量|是| 整型 |32|
   
+ 返回结果集

   - 正确结果示例, HTTP `STATUS=200`
   
     ```
     {"success":true,
      "result": true
     }
     ```
     代表更新成功
   
   - 错误结果示例, HTTP `STATUS=500`
   
     ```
     更新商品失败
     ```
     
### 更新商品状态(通过id)

+ 请求服务名

POST item.update.byid

+ 请求参数示例

id=123&status=1

+ 请求参数说明

  参数名 |  说明 | 必填 | 类型 | 长度 | 备注
  -------|-------|------|------|------|-----
  id | 商品id | 是 | 整型 | 32 |
  status | 状态 | 是 | 整形 | 32 |1: 上架, -1:下架, -2:冻结
  
+ 返回结果集

  - 正确结果示例, HTTP `STATUS=200`
  
    ```
    {"success": true,
    "result": true
    }
    ```
    代表更新成功
  
  - 错误结果示例, HTTP `STATUS=500`
  
    ```
    {
    "success": true
    "error":"更新状态失败"
    }
    ```
    
### 更新商品状态(通过外部标志)

+ 请求服务名

POST item.status.update.bycode

+ 请求参数示例

itemCode=foobar&status=1

+ 请求参数说明

  参数名 |  说明 | 必填 | 类型 | 长度 | 备注
  -------|-------|------|------|------|-----
  itemCode | 商品外部标识 | 是 | 字符串 | 32 |
  status | 状态 | 是 | 整形 | 32 |1: 上架, -1:下架, -2:冻结
  
+ 返回结果集

  - 正确结果示例, HTTP `STATUS=200`
  
    ```
    {"success": true,
    "result": true"
    }
    ```
    代表更新成功
  
  - 错误结果示例, HTTP `STATUS=500`
  
    ```
    {
      "success": false
      "error":"更新状态失败"
     }
    ```
    
### 更新SKU信息(通过id)

+ 请求服务名

POST sku.update.byid

+ 请求参数示例

data={"id":12345,"originPrice":130000,"price":12000,"stockQuantity":12}

+ 请求参数说明

  参数名 |  说明 | 必填 | 类型 | 长度 | 备注
  -------|-------|------|------|------|-----
  id | 商品id | 是 | 整型 | 32 |
  originPrice | sku原价 | 否 | 整形 | 32 |以分为单位
  price | sku实价 | 否 | 整形 | 32 |以分为单位
  stockQuantity | sku库存 | 否 | 整形 | 32 |
  
+ 返回结果集

  - 正确结果示例, HTTP `STATUS=200`
  
    ```
    {
    "success": true,
    "result": true
    }
    ```
    代表更新成功
  
  - 错误结果示例, HTTP `STATUS=500`
  
    ```
    {
      "success": false
      "error":"更新sku失败"
     }
    ```
### 更新SKU信息(通过外部标识)

+ 请求服务名

POST sku.update.bycode

+ 请求参数示例

data={"skuCode":"xxxx","originPrice":130000,"price":12000,"stockQuantity":12}

+ 请求参数说明

  参数名 |  说明 | 必填 | 类型 | 长度 | 备注
  -------|-------|------|------|------|-----
  skuCode | sku 外部标识 | 是 | 字符串 | 32 |
  originPrice | sku原价 | 否 | 整形 | 32 |以分为单位
  price | sku实价 | 否 | 整形 | 32 |以分为单位
  stockQuantity | sku库存 | 否 | 整形 | 32 |
  
+ 返回结果集

  - 正确结果示例, HTTP `STATUS=200`
  
    ```
    {
    "success": true,
    "result": true
    }
    ```
    代表更新成功
  
  - 错误结果示例, HTTP `STATUS=500`
  
    ```
    {
      "success": false
      "error":"更新sku失败"
     }
    ```

## 订单相关
### 订单查询

+ 请求服务名

GET order.query

+ 请求参数示例

start=201512241430&end=201601010000&status=0&pageNo=2&pageSize=10

+ 请求参数说明

  参数名 |  说明 | 必填 | 类型 | 长度 | 备注
  -------|-------|------|------|------|-----
  start | 订单创建开始时间 | 是 | 字符串 | 12 |YYYYMMDDHHMM
  end | 订单创建结束时间 | 否 | 字符串 | 12 |YYYYMMDDHHMM, 如果不传, 默认查到当前时间
  status|订单状态|是|整型|1|0->等待处理,1->已接收,待发货,2->部分发货,3->全部发货,4->确认收货,5->待安装,6->已安装,待验收,7->交易完成
  pageNo | 起始页码 | 否 | 整形 | 32 |从1开始, 默认为1
  pageSize | 每页返回条数 | 否 | 整形 | 32 |默认为5, 最大为10


+ 返回结果集

  - 正确结果示例, HTTP `STATUS=200`
  
  ```json
  {"success": true,
  "result":
  {
  "total": 12345,
  "data": [
      {
          "order": {
              "id": 1,
              "purchaserOrderId": 1,
              "purchaserId": 1,
              "purchaserName": "abc",
              "purchaserOrganizationName": "white house",
              "purchaserMobile": "18888888888",
              "purchaserZoneCode": "hangzhou",
              "supplierId": 1,
              "supplierName": "tmall",
              "shopId": 1,
              "shopName": "tmall",
              "originFee": 30000,
              "discount": 10000,
              "fee": 20000,
              "status": 1,
              "hasAcceptance": false,
              "createdAt": 1450853537151,
              "updatedAt": 1450853537151
          },
          "orderItems": [
              {
                  "id": 1,
                  "orderId": 1,
                  "purchaserId": 1,
                  "supplierId": 1,
                  "itemId": 1,
                  "itemName": "item0",
                  "itemCode": "itemCode0",
                  "skuId": 1,
                  "skuCode": "skuCode0",
                  "skuOriginPrice": 30000,
                  "skuPrice": 30000,
                  "quantity": 2,
                  "originFee": 60000,
                  "fee": 60000,
                  "needInstalled": true,
                  "hasInstallation": false,
                  "deliverSkuQuantity": 1,
                  "createdAt": 1450853537159,
                  "updatedAt": 1450853537159
              },
              {
                  "id": 2,
                  "orderId": 1,
                  "purchaserId": 1,
                  "supplierId": 1,
                  "itemId": 2,
                  "itemName": "item1",
                  "itemCode": "itemCode1",
                  "skuId": 2,
                  "skuCode": "skuCode1",
                  "skuOriginPrice": 30000,
                  "skuPrice": 30000,
                  "quantity": 2,
                  "originFee": 60000,
                  "fee": 60000,
                  "needInstalled": true,
                  "hasInstallation": false,
                  "deliverSkuQuantity": 1,
                  "createdAt": 1450853537159,
                  "updatedAt": 1450853537159
              }
          ],
          "deliveryItems": [
              {   
                  "deliveryItemId": 123,
                  "orderAddress": {
                      "id": 1,
                      "orderId": 1,
                      "receiver": "奥巴马",
                      "mobile": "18888888888",
                      "provinceId": 310000,
                      "province": "浙江省",
                      "cityId": 310001,
                      "city": "杭州市",
                      "regionId": 310002,
                      "region": "西湖区",
                      "streetId": 310003,
                      "street": "彩虹快速路",
                      "detail": "云栖小镇",
                      "zip": 310000
                  },
                  "skus": [
                      {
                          "id": 1,
                          "itemId": 1,
                          "itemName": "item0",
                          "itemCode": "itemCode0",
                          "skuId": 1,
                          "skuCode": "skuCode1",
                          "skuPrice": 30000,
                          "quantity": 2,
                          "fee": 60000,
                          "createdAt": 1450853537161,
                          "updatedAt": 1450853537161
                      },
                      {
                          "id": 2,
                          "itemId": 2,
                          "itemName": "item1",
                          "itemCode": "itemCode1",
                          "skuId": 2,
                          "skuCode": "skuCode2",
                          "skuPrice": 30000,
                          "quantity": 2,
                          "fee": 60000,
                          "createdAt": 1450853537161,
                          "updatedAt": 1450853537161
                      }
                  ]
              }
          ],
          "invoiceItems": [
              {   
                  "invoiceInfo":{
                     "//todo: add"
                  },
                  "invoiceAdress": {
                      "id": 1,
                      "orderId": 1,
                      "receiver": "奥巴马",
                      "mobile": "18888888888",
                      "provinceId": 310000,
                      "province": "浙江省",
                      "cityId": 310001,
                      "city": "杭州市",
                      "regionId": 310002,
                      "region": "西湖区",
                      "streetId": 310003,
                      "street": "彩虹快速路",
                      "detail": "云栖小镇",
                      "zip": "310000"
                  },
                  "skus": [
                      {
                          "id": 1,
                          "orderInvoiceId": 1,
                          "itemId": 1,
                          "itemName": "item0",
                          "itemCode": "itemCode0",
                          "skuId": 1,
                          "skuCode": "skuCode1",
                          "skuPrice": 30000,
                          "quantity": 2,
                          "attribute": "abc",
                          "fee": 60000,
                          "createdAt": 1450853537162,
                          "updatedAt": 1450853537162
                      },
                      {
                          "id": 2,
                          "orderInvoiceId": 2,
                          "itemId": 2,
                          "itemName": "item1",
                          "itemCode": "itemCode1",
                          "skuId": 2,
                          "skuCode": "skuCode2",
                          "skuPrice": 30000,
                          "quantity": 2,
                          "attribute": "abc",
                          "fee": 60000,
                          "createdAt": 1450853537162,
                          "updatedAt": 1450853537162
                      }
                  ]
              }
          ]
      }
  ]
}
}
- 返回结果说明

返回的是符合条件的订单列表, 每条订单分为四个部分

1. order, 这是主订单, 一个采购单对应多个主订单

   参数名 |  说明 | 必填 | 类型 | 长度 | 备注
-------|-------|------|------|------|-----
id | 订单id | 是 | 整型 | 32 |
purchaserOrderId | 采购单id | 是 | 整形 | 32 |
purchaserId | 采购商id | 是 | 整形 | 32 |
purchaserOrganizationName | 采购机构名称 | 是 | 字符串 | 127 |
purchaserMobile|采购商电话|是|字符串|20|
purchaserZoneCode|采购商所属行政区划编码|字符串|20|
supplierId|供应商id|是|整型|32|
shopId|店铺id|是|整型|32|
shopName|店铺名称|是|字符串|127|
originFee|订单原价|否|整型|32|以分为单位
discount|折扣|否|整型|以分为单位
fee|订单实际价格|是|整型|以分为单位
hasAcceptance|是否已验收|是|布尔|5|
createdAt|订单创建时间|是|日期|以毫秒数表示的日期
updatedAt|订单修改时间|是|日期|以毫秒数表示的日期	

2. orderItems, 这是商品清单, 也是子订单, 一个主订单对应多个子订单

 参数名 |  说明 | 必填 | 类型 | 长度 | 备注
-------|-------|------|------|------|-----
id| 子订单id| 是|整型|32|
orderId| 对应的主订单id|是|整型|32|
purchaserId|采购商id|是|整型|32|
supplierId|供应商id|是|整型|32|
itemName|商品名称|是|字符串|128|
itemCode|商品外部编码|否|字符串|32|
skuCode|sku编码,唯一标识|是|字符串|32|
skuOriginPrice|sku单价(原价)|是|整型|32|以分为单位
skuPrice|sku单价|是|整型|32|以分为单位
quantity|sku数量|是|整型|32|
originFee|原价|否|整型|32|以分为单位
fee|实际价格|是|整型|32|以分为单位
needInstalled|是否需要安装|是|布尔|5|
hasInstallation|是否已安装完毕|是|布尔|5|
deliverSkuQuantity|已发货数量|否|整型|32|
createdAt|子订单创建时间|是|日期|以毫秒数表示的日期
updatedAt|子订单修改时间|是|日期|以毫秒数表示的日期
	

3. deliveryItems 发货需求清单, 一个主订单对应多个发货需求清单

 参数名 |  说明 | 必填 | 类型 | 长度 | 备注
-------|-------|------|------|------|-----
deliveryItemId | 发货清单id| 是|整型|32|
orderDeliveryId |发货信息id|是|整型|32|
itemName|商品名称|是|字符串|128|
itemCode|商品外部编码|是|字符串|32|
skuCode|sku编码,唯一标识|是|字符串|32|
skuPrice|sku单价|是|整型|32|以分为单位
quantity|sku数量|是|整型|32|
fee|实际价格|是|整型|32|以分为单位
createdAt|发货清单单创建时间|是|日期|以毫秒数表示的日期
updatedAt|发货清单修改时间|是|日期|以毫秒数表示的日期

 其中deliveryAddress包含字段:

	 参数名 |  说明 | 必填 | 类型 | 长度 | 备注
	-------|-------|------|------|------|-----
	id| 发货信息单id| 是|整型|32|
	orderId|主订单id| 是|整型 32|
	receiver|收货人|是|字符串|32|
	mobile|收货人|是|字符串|20|
	provinceId|省id|整型|32|
	province|省名|字符串|32|
	cityId|市id|整型|32|
	city|市名|字符串|32|
	regionId|区id|整型|32|
	region|区名|字符串|32|
	streetId|街道id|整型|32|
	street|街道|字符串|32|
	detail|详细地址|字符串|128|
	zip|邮编|否|字符串|10|

4. invoiceItems 开票清单, 一个主订单对应多个开票清单
 
   参数名 |  说明 | 必填 | 类型 | 长度 | 备注
	-------|-------|------|------|------|-----
	id| 开票清单id| 是|整型|32|
	itemName|商品名称|是|字符串|128|
	itemCode|商品外部编码|是|字符串|32|
	skuCode|sku编码,唯一标识|是|字符串|32|
	skuPrice|sku单价|是|整型|32|以分为单位
	quantity|sku数量|是|整型|32|
	fee|实际价格|是|整型|32|以分为单位
	createdAt|开票清单单创建时间|是|日期|以毫秒数表示的日期
	updatedAt|开票清单修改时间|是|日期|以毫秒数表示的日期


- 错误结果示例, HTTP `STATUS=500`

  ```
  {
    "success": false
    "error":"查询失败"
   }
  ```

查询单个订单

  • 请求服务名
GET order.query.byid
  • 请求参数示例
id=123
  • 请求参数说明

    参数名 说明 必填 类型 长度 备注
    id 订单id 整型 32
  • 返回结果集

    同批量查询订单, 但是返回的不是一个列表

接单确认接口

供应商通过开放接口拉取订单后, 需要将订单状态设置为已接收,待发货

  • 请求服务名

    POST order.accept
    
    • 请求参数示例
    id=123
    
    • 请求参数说明

      参数名 说明 必填 类型 长度 备注
      id 订单id 整型 32
    • 返回结果集

      • 正确结果示例, HTTP STATUS=200
      {
      "success": true,
      "result": true
      }
      

      代表更新成功

      • 错误结果示例, HTTP STATUS=500
      {"success": false,
       "error": "更新订单状态失败"
       }
      

创建发货单

供应商根据发货需求清单发货, 可能一个发货需求清单要多批次发货

  • 请求服务名

    POST order.express.create
    
    • 请求参数示例
    data={
       "itemDeliveryId":"发货需求清单id",
       "deliveryCode": "发货单号(客户发货单记录id)",
       "expressCode": "物流单号",
       "expressCompanyCode": "物流公司编码",
       "skus": [
                  {
                      "itemCode": "外部商品编码",
                      "skuCode": "外部sku编码",
                      "quantity": "发货数量"
                  },
                  {
                      "itemCode": "外部商品编码",
                      "skuCode": "外部sku编码",
                      "quantity": "发货数量"
                  }
              ]
    }
    
    • 请求参数说明

      参数名 说明 必填 类型 长度 备注
      itemDeliveryId 发货需求清单id 整型 32
      de
      deliveryCode 发货单号(客户发货单记录id) 字符串 32 用这个字段防止重复创建发货单
      expressCode 物流单号 字符串 32
      expressCompanyCode 物流公司编号 字符串 32
      itemCode 外部商品编码 字符串 32
      skuCode 外部sku编码 字符串 32
      quantity 发货数量 整型 32
    • 返回结果集

      • 正确结果示例, HTTP STATUS=200
      {
      "success": true,
      "result":123
      }
      

      返回政采云发货单id

      • 错误结果示例, HTTP STATUS=500
      {
      "success": false,
      "error":创建发货单失败
      }
      

查询已经确认的发货单

  • 请求服务名

    GET order.express.query
    
    • 请求参数示例
    start=20151224&end=20160101
    
    • 请求参数说明

      参数名 说明 必填 类型 长度 备注
      start 开始时间 字符串 YYYYMMDDHHMM
      end 结束时间 字符串 32
    • 返回结果集

      • 正确结果示例, HTTP STATUS=200
      {
      "success": true,
      "result":
      [123, 456 ...]
      }
      

      返回政采云已确认发货单id列表

      • 错误结果示例, HTTP STATUS=500
      {
      "success": false,
      "error":"查询发货单失败"
      }
      
      

查询单个发货单

  • 请求服务名

    GET order.express.query.byid
    
    • 请求参数示例
    id=123
    
    • 请求参数说明

      参数名 说明 必填 类型 长度 备注
      123 政采云 字符串 YYYYMMDDHHMM
    • 返回结果集

      • 正确结果示例, HTTP STATUS=200
      {"success": true,
      "result":
      {
      "id": 123,
      "itemDeliveryId":"发货需求清单id",
      "deliveryCode": "发货单号(客户发货单记录id)",
      "expressCode": "物流单号",
      "expressCompanyCode": "物流公司编码",
      "skus": [
                {
                    "itemCode": "外部商品编码",
                    "skuCode": "外部sku编码",
                    "quantity": "发货数量"
                },
                {
                    "itemCode": "外部商品编码",
                    "skuCode": "外部sku编码",
                    "quantity": "发货数量"
                }
            ]
            }
      

    }

    ```
    返回政采云对应的发货单信息
    
    • 返回结果说明

      参数名 说明 必填 类型 长度 备注
      id 发货单id 整型 32
      itemDeliveryId 发货需求清单id 整型 32
      deliveryCode 发货单号(客户发货单记录id) 字符串 32
      expressCode 物流单号 字符串 32
      expressCompanyCode 物流公司编号 字符串 32
      itemCode 外部商品编码 字符串 32
      skuCode 外部sku编码 字符串 32
      quantity 发货数量 整型 32
    • 错误结果示例, HTTP STATUS=500

    ```
    {"success": false,
    "error":查询发货单失败
    }
    ```
    
Clone this wiki locally