Skip to content

Store

Create Store

Description

Create a store

Request Config

ConfigDefinition
URL/store
MethodPOST
Content-Typeapplication/json

Request Body Schema

NameTypeDescriptionRequired
codestringStore codeYes
namestringStore nameYes
addressstringStore addressNo
longitudefloat64Store longitude,WGS84 requiredNo
latitudefloat64Store latitude,WGS84 requiredNo
attributes[]objectStore attributesNo
+ typeint32Attribute 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
+ codestringAttribute code,code is unique with one typeYes
+ namestringAttribute nameYes
contact_namestringContact nameNo
mobilestringMobileNo
images[]stringStore imagesNo
sales_repobjectSales representativeNo
+ usernamestringLogin user name, maximum 50 bitYes
+ real_namestringReal name, maximum 100 bitNo
+ passwordstringPassword, maximum 200 bitNo
+ phonestringPhoneNo
+ departmentstringDepartment,maximum 100 bitNo
+ ext_infostringOther 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

NameTypeDescription
codestringStore code
sales_repobjectSales representative, if there is a sales_rep value in the request, there will be a return value, otherwise there will be no return value
+ idint64User id
+ usernamestringLogin user name

Response Body Sample

json
{
  "code": 0,
  "message": "",
  "data": {
    "code": "TEST001"
  }
}

Query Store

Description

Query store

Request Config

ConfigDefinition
URL/store?code=TEST001
MethodGET

Params

NameTypeDescriptionRequired
codestringStore codeYes

Response


Schema of data

NameTypeDescription
codestringStore code
namestringStore name
addressstringStore address
longitudefloat64Store longitude
latitudefloat64Store latitude
attributes[]objectStore attributes
+ typeint32Attribute 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
+ codestringAttribute code,code is unique with one type
+ namestringAttribute name
contact_namestringContact name
mobilestringMobile
images[]stringStore 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

ConfigDefinition
URL/store
MethodPUT
Content-Typeapplication/json

Request Body Schema

NameTypeDescriptionRequired
codestringStore codeYes
namestringStore nameYes
addressstringStore addressNo
attributes[]objectStore attributesNo
+ typeint32Attribute 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
+ codestringAttribute code,code is unique with one typeYes
+ namestringAttribute nameYes
contact_namestringContact nameNo
mobilestringMobileNo
images[]stringStore imagesNo
longitudefloat64Store longitude, WGS84 requiredNo
latitudefloat64Store latitude, WGS84 requiredNo

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

NameTypeDescription
codestringStore code

Response Body Sample

json
{
  "code": 0,
  "message": "",
  "data": {
    "code": "TEST001"
  }
}

Powered by Clobotics Retail Team.