# api2021
**Repository Path**: fuw/api2021
## Basic Information
- **Project Name**: api2021
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-05-26
- **Last Updated**: 2021-05-26
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
API文档中心(1.0.0)
======
------
## 1 简介
### 1.1 业务流程说明

### 1.2 Base URL
接口API引用的地址有Base URL。
生产环境的Base URL:https://api.xxxxxx.com
注意:为了确保数据隐私,本平台的REST API是通过HTTPS方式请求。
### 1.3 业务URL
业务URL格式:/v1/Product/addProductBase?aid={accountId}&sig={SigParameter}
在URL格式中,{}内的内容表示为参数,非{}的内容固定不变,版本号(v1)以文档更新为准。
Base URL与业务URL相拼接成完整请求URL,完整URL示例:
https://api.xxxxxx.com?aid=100000&sig=C1F20E7A9733CE94F680C70A1DBABCD
#### 公共参数说明
| 参数 | 类型 | 必填 | 说明 |
| ---- |:----:|:----:|:----|
| accountId | String | 是 | 授权企业调用接口的account id |
| SigParameter | String | 是 | REST API 验证参数,生成规则如下:
1.使用MD5加密(account id + 账户授权令牌 + 时间戳)。
时间戳是当前系统时间,格式"yyyyMMddHHmmss"。
时间戳有效时间为24小时,如:20210526100130
2.SigParameter参数需要大写,如sig=ABCDEFG |
### 1.4 HTTP标准包头字段
Accept:application/xml;
Content-Type:application/xml;charset=utf-8;
Content-Length:256;
Authorization:
#### 头包参数说明
| 参数 | 类型 | 必填 | 说明 |
| ---- |:----:|:----:|:----|
| Accept | String | 是 | 客户端响应接收数据格式:application/xml、application/json
Content-Type | String | 是 | 类型:application/xml;charset=utf-8、application/json;charset=utf-8 |
| Content-Length | String | 是 | Content-Length |
| Authorization | String | 是 | 验证信息,生成规则:
1.使用Base64编码(account id + 冒号 + 时间戳)
2.冒号为英文冒号
3.时间戳是当前系统时间,格式"yyyyMMddHHmmss",需与SigParameter中时间戳相同。 |
------
## 2 API概览
### 2.1 仓库相关接口
| 接口名称 | 接口功能 |
|---|---|
| AddStoreInfo | 新增仓库信息 |
| UpdateStoreInfo | 变更仓库信息 |
### 2.2 商品相关接口
| 接口名称 | 接口功能 |
|---|---|
| AddProductBase | 新增商品基础信息 |
| UpdateProductBase | 变更商品基础信息 |
| DeleteProductBase | 删除商品基础信息 |
| UpdateProductSKU | 变更商品SKU数据 |
| updateProductCount | 变更商品库存数据 |
### 2.3 订单相关接口
| 接口名称 | 接口功能 |
|---|---|
| SendOrderDelivery | 推送订单发货信息 |
### 2.4 代理商相关接口
| 接口名称 | 接口功能 |
|---|---|
| UpdateStorePricesData | 更新代理商价格表数据 |
------
## 3 新增商品基础信息接口
### 3.1 请求地址
POST /v1/Product/AddProductBase?aid={accountId}&sig={SigParameter}
### 3.2 输入参数
| 属性 | 类型 | 必填 | 说明 |
| ---- |:----:|:----:|:----|
| ProductName | String | 是 | 商品名称 |
| ProductNumber | String | 是 | 商品货号,对应SAP或ERP中的货号 |
| InsideNumber | String | 是 | 本平台唯一识别商品的编号,制定规则参考款号设计标准文档 |
| ProductMarketPrice | float | 是 | 市场销售价 |
| ProductPrice | float | 是 | 商品平台售价 |
| ProductImage | Array | 是 | 商品图片,默认首图作为封面图|
### 3.3 输出参数
| 属性 | 类型 | 必填 | 说明 |
| ---- |:----:|:----:|:----|
| status | String | 是 | 请求状态码,取值200(成功),其余状态码含义详见错误码表 |
| InsideNumber | String | 是 |商品唯一标识符 |
### 3.4 示例
#### 输入示例
POST https://api.xxxxxx.com?aid=100000&sig=C1F20E7A9733CE94F680C70A1DBABCD HTTP/1.1
Host:192.168.0.1:8883
content-length: 139
Accept:application/json;
Content-Type:application/json;charset=utf-8;
Authorization:C1F20E7A9733CE94F680C70A1DBABCD
#### 输出示例
HTTP/1.1 200 OK
response:{
"status":"200",
"data":{
"InsideNumber":"20210526001"
},
"message":"成功"
}