客户信息
字段可选
M:must 必填
O:optional 选填
C: conditional 某些条件下必选
搜索客户
接口名
/customer
Method
GET
请求
query_data O string 查询内容,支持客户ID(K001或者1)
offset O int 分页缩进,默认0
limit O int 分页每页数量,默认10
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回json数据
[
{
"cellphone" M string 客户手机号
"name" M string 客户名
"company" M string 客户公司名
"id" M string 客户ID
}
]
示例
request
http://test.guanmai.cn:8888/customer/?query_data=K1&offset=0&limit=10
response
{
"data": [{
"name": "开户人455",
"cellphone": "12222",
"id": "K00010",
"company": "司名称12"
}],
"code": 0,
"pagination": {
"offset": 0,
"count": 79,
"limit": 10
},
"msg": "ok"
}
客户明细
接口名
/customer/detail
Method
GET
请求
id M string 客户ID
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回json数据
"available_pay_days" M int 付款期限
"contact_address" M string 联系地址
"username" M string 用户名
"company" M string 公司名
"delivery_address" M string 送货地址
"is_frozen" M bool 是否冻结
"cellphone" M string 手机号
"contact_name" M string 联系人
"name" M string 开户人
"is_white" M bool 是否白名单
"min_stock" M float 出仓警示(kg)
"phone" M string 联系电话
"id" M string 客户ID
"bill_day" M string 每月结款日
"contracts": [ M list
{
"is_active" M bool 是否激活
"type" M int 合同类型(1:公库;2:私库)
"id" M string 合同ID
}
]
示例
request
http://test.guanmai.cn:8888/customer/detail?id=K00001
response
{
"data": {
"available_pay_days": 12,
"contact_address": "asdad",
"username": "had23",
"company": "test",
"delivery_address": "货地址",
"is_frozen": 0,
"cellphone": "23223123",
"contact_name": "test11111111",
"name": "hahasadf",
"is_white": 1,
"min_stock": 2.32,
"phone": "1111111111",
"contracts": [{
"is_active": true,
"type": 1,
"id": "HT00018"
}],
"id": "K00001",
"bill_day": 28
},
"code": 0,
"msg": "ok"
}
创建客户
接口名
/customer/create
Method
POST
请求
"available_pay_days" M int 付款期限
"contact_address" M string 联系地址
"password" M string 密码
"username" M string 用户名
"company" M string 公司名
"delivery_address" M string 送货地址
"is_frozen" M bool 是否冻结
"cellphone" M string 手机号
"contact_name" M string 联系人
"name" M string 开户人
"is_white" M bool 是否白名单
"min_stock" M int 出仓警示(g)
"phone" M string 联系电话
"bill_day" M string 每月结款日
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回客户ID
示例
request
http://test.guanmai.cn:8888/customer/create
form-data
available_pay_days: 2
contact_address: "adfaf"
password: "dfafadf"
username: "dfafadf"
company: "dfafadf"
delivery_address: "dfafadf"
is_frozen: "0"
cellphone: "12313131323"
contact_name: "dfafadf"
name: "dfafadf"
is_white: "1"
min_stock: "100"
phone: "12313131323"
bill_day: "23"
response
{
"data": "RK0001",
"code": 0,
"msg": "ok"
}
更新客户
接口名
/customer/update
Method
POST
请求
"id" M string 客户ID
"available_pay_days" O int 付款期限
"contact_address" O string 联系地址
"username" O string 用户名
"company" O string 公司名
"delivery_address" O string 送货地址
"is_frozen" O bool 是否冻结
"cellphone" O string 手机号
"contact_name" O string 联系人
"name" O string 开户人
"is_white" O bool 是否白名单
"min_stock" O int 出仓警示(g)
"phone" O string 联系电话
"bill_day" O string 每月结款日
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 空
示例
request
http://test.guanmai.cn:8888/customer/create
form-data
id: K00001
available_pay_days: 2
contact_address: "adfaf"
username: "dfafadf"
company: "dfafadf"
delivery_address: "dfafadf"
is_frozen: "0"
cellphone: "12313131323"
contact_name: "dfafadf"
name: "dfafadf"
is_white: "1"
min_stock: "100"
phone: "12313131323"
bill_day: "23"
response
{
"data": "RK0001",
"code": 0,
"msg": "ok"
}
所有客户
接口名
/customer/all
Method
GET
请求
无
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回json数据
[
{
"cellphone" M string 手机号
"company" M string 公司名
"id" M string 客户ID
"name" M string 客户名
"contact_name" M 联系人
"pinyin_name" M 客户名的拼音
}
]
示例
request
127.0.0.1:8888/customer/all
response
{
"data": [{
"name": "hahasadf",
"cellphone": "23223123",
"company": "test",
"pinyin_name": "t_test",
"id": "K00001",
"contact_name": "test11111111"
}],
"code": 0,
"msg": "ok"
}