商品查询
功能介绍
商品查询
URI
POST /v1/{project_id}/trace/trace-sweepcode/product/info
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
租户从IAM申请到的projectid,一般为32位字符串 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
是 |
String |
用户Token |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
productCode |
否 |
String |
产品编码(productCode和productName不能同时为空) |
|
productName |
否 |
String |
产品名称(productCode和productName不能同时为空) |
|
merchant |
是 |
String |
商户ID(取值为项目ID) |
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
code |
String |
返回码 |
|
message |
String |
响应消息 |
|
data |
data object |
商品详情 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
productCode |
String |
商品码 |
|
productName |
String |
商品名称 |
|
productPhotoUrl |
String |
商品溯源url |
|
bannerUrl |
String |
横幅url |
|
productOrigin |
String |
商品产地 |
|
sweepcodeStatisticsSwitch |
String |
商品溯源扫码统计开关(0:关闭;1 打开) |
|
merchant |
String |
商户ID(取值为项目ID) |
状态码:500
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码 |
|
error_msg |
String |
错误描述 |
请求示例
{
"productCode" : "fffffewrw",
"productName" : "fsddafdsa",
"merchant" : "1416325181332881400"
}
响应示例
状态码:200
Success
{
"code" : "200",
"message" : "操作成功!",
"data" : {
"productCode" : "77",
"productName" : "7711",
"productPhotoUrl" : "https://xxx.xxx.xxx.xxx/petaltrace/6BF050A8AA19BB2F0BFA9F2F0529991C.jpg",
"bannerUrl" : "https://xxx.xxx.xxx.xxx/petaltrace/6BF050A8AA19BB2F0BFA9F2F0529991C.jpg",
"productOrigin" : "bj",
"sweepcodeStatisticsSwitch" : "1",
"merchant" : "1759540612045058049"
}
}
状态码:500
Error response
{
"code" : "500",
"message" : "系统异常"
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
Success |
|
500 |
Error response |