Store
Create Store
Description
Create a store
Request Config
| Config | Definition |
|---|---|
| URL | /store |
| Method | POST |
| Content-Type | application/json |
Request Body Schema
| Name | Type | Description | Required |
|---|---|---|---|
| code | string | Store code | Yes |
| name | string | Store name | Yes |
| address | string | Store address | No |
| longitude | float64 | Store longitude,WGS84 required | No |
| latitude | float64 | Store latitude,WGS84 required | No |
| attributes | []object | Store attributes | No |
| + type | int32 | Attribute type。 0: Region 1: Sales office 2: Route 3: CHANNEL 4: G1 (Province) 5: G2 (City) 6: G3 (District) 7: Retailer 8: Sub retailer 9: Organization 101: Custom attr 1 102: Custom attr 2 103: Custom attr 3 104: Custom attr 4 105: Custom attr 5 106: Custom attr 6 | Yes |
| + code | string | Attribute code,code is unique with one type | Yes |
| + name | string | Attribute name | Yes |
| contact_name | string | Contact name | No |
| mobile | string | Mobile | No |
| images | []string | Store images | No |
| sales_rep | object | Sales representative | No |
| + username | string | Login user name, maximum 50 bit | Yes |
| + real_name | string | Real name, maximum 100 bit | No |
| + password | string | Password, maximum 200 bit | No |
| + phone | string | Phone | No |
| + department | string | Department,maximum 100 bit | No |
| + ext_info | string | Other additional information, the maximum length is 1000. It is recommended to use json format string data, such as: {"lead_phone":"18888888888","lead_real_name":"wangwu","lead_username":"wangwu","area_manager":"zhangsan"} | No |
Request Body Sample
json
{
"code": "TEST001",
"name": "store name",
"address": "St.xx Rd.xxxx No.xx",
"longitude": 121.42394,
"latitude": 31.22024,
"contact_name": "contact name",
"mobile": "15699999999",
"images": ["https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef843.jpg","https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef844.jpg"],
"attributes": [
{
"type": 3,
"code": "hospital",
"name": "hospital name"
},
{
"type": 4,
"code": "Shanghai",
"name": "Shanghai"
},
{
"type": 5,
"code": "Shanghai",
"name": "Shanghai"
},
{
"type": 6,
"code": "Changning District",
"name": "Changning District"
}
],
"sales_rep":{
"username": "testname",
"real_name": "zhangsan",
"password": "123456",
"phone": "15699999999",
"department":"Sales Department",
"ext_info":"{\"lead_phone\":\"18888888888\",\"lead_real_name\":\"王五\",\"lead_username\":\"wangwu\",\"area_manager\":\"zhangsan\"}"
}
}Response
Schema of data
| Name | Type | Description |
|---|---|---|
| code | string | Store code |
| sales_rep | object | Sales representative, if there is a sales_rep value in the request, there will be a return value, otherwise there will be no return value |
| + id | int64 | User id |
| + username | string | Login user name |
Response Body Sample
json
{
"code": 0,
"message": "",
"data": {
"code": "TEST001"
}
}Query Store
Description
Query store
Request Config
| Config | Definition |
|---|---|
| URL | /store?code=TEST001 |
| Method | GET |
Params
| Name | Type | Description | Required |
|---|---|---|---|
| code | string | Store code | Yes |
Response
Schema of data
| Name | Type | Description |
|---|---|---|
| code | string | Store code |
| name | string | Store name |
| address | string | Store address |
| longitude | float64 | Store longitude |
| latitude | float64 | Store latitude |
| attributes | []object | Store attributes |
| + type | int32 | Attribute type。 0: Region 1: Sales office 2: Route 3: CHANNEL 4: G1 (Province) 5: G2 (City) 6: G3 (District) 7: Retailer 8: Sub retailer 9: Organization 101: Custom attr 1 102: Custom attr 2 103: Custom attr 3 104: Custom attr 4 105: Custom attr 5 106: Custom attr 6 |
| + code | string | Attribute code,code is unique with one type |
| + name | string | Attribute name |
| contact_name | string | Contact name |
| mobile | string | Mobile |
| images | []string | Store images |
Response Body Sample
json
{
"code": 0,
"message": "",
"data": {
"code": "TEST001",
"name": "Store name",
"address": "St.xx Rd.xx No.xx xx",
"longitude": 121.42394,
"latitude": 31.22024,
"contact_name": "contact name",
"mobile": "15699999999",
"images": ["https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef843.jpg","https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef844.jpg"],
"attributes": [
{
"type": 3,
"code": "hospital",
"name": "hospital name"
},
{
"type": 4,
"code": "Shanghai",
"name": "Shanghai"
},
{
"type": 5,
"code": "Shanghai",
"name": "Shanghai"
},
{
"type": 6,
"code": "Changning District",
"name": "Changning District"
}
]
}
}Update Store
Description
Update store data, all fields should be passed in, we don't support updating part of fields.
Request Config
| Config | Definition |
|---|---|
| URL | /store |
| Method | PUT |
| Content-Type | application/json |
Request Body Schema
| Name | Type | Description | Required |
|---|---|---|---|
| code | string | Store code | Yes |
| name | string | Store name | Yes |
| address | string | Store address | No |
| attributes | []object | Store attributes | No |
| + type | int32 | Attribute type。 0: Region 1: Sales office 2: Route 3: CHANNEL 4: G1 (Province) 5: G2 (City) 6: G3 (District) 7: Retailer 8: Sub retailer 9: Organization 101: Custom attr 1 102: Custom attr 2 103: Custom attr 3 104: Custom attr 4 105: Custom attr 5 106: Custom attr 6 | Yes |
| + code | string | Attribute code,code is unique with one type | Yes |
| + name | string | Attribute name | Yes |
| contact_name | string | Contact name | No |
| mobile | string | Mobile | No |
| images | []string | Store images | No |
| longitude | float64 | Store longitude, WGS84 required | No |
| latitude | float64 | Store latitude, WGS84 required | No |
Request Body Sample
json
{
"id": 234,
"code": "TEST001",
"name": "Store name",
"address": "St.xx Rd.xx No.xx xx",
"longitude": 121.42394,
"latitude": 31.22024,
"contact_name": "contact name",
"mobile": "15699999999",
"images": ["https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef843.jpg","https://f-dev.clobotics.cn/4/0040ca4d85f5e5ef7354102f486ef844.jpg"],
"attributes": [
{
"type": 3,
"code": "hospital",
"name": "hospital name"
},
{
"type": 4,
"code": "Shanghai",
"name": "Shanghai"
},
{
"type": 5,
"code": "Shanghai",
"name": "Shanghai"
},
{
"type": 6,
"code": "Changning District",
"name": "Changning District"
}
]
}Response
Schema of data
| Name | Type | Description |
|---|---|---|
| code | string | Store code |
Response Body Sample
json
{
"code": 0,
"message": "",
"data": {
"code": "TEST001"
}
}