# 获取商品列表
接口地址: http://www.damaijia168.com/vv/external/v1/product_get_list
请求方式: GET
返回格式: JSON
# 请求头参数
| 参数 | 类型 | 必选 | 值 | 示例 |
|---|---|---|---|---|
| Authorization | string | 是 | 授权 access_token | 1798c6aadec33d1bc2f5b707f1049aefexxxx |
# 请求参数
| 参数 | 类型 | 必选 | 描述 |
|---|---|---|---|
| id | int | 是 | 仓库id |
| page | int | 否 | 第几页 |
| pageSize | int | 否 | 每页数量 |
| 不传默认返回20条 |
# 请求示例
http://www.damaijia168.com/vv/external/v1/product_get_list?id=2&page=1&pageSize=10
# 请求代码示例
cURL请求代码示例
curl --location --request GET 'http://www.damaijia168.com/vv/external/v1/product_get_list?id=2&page=1&pageSize=10' \--header 'accept: application/json' \
--header 'Authorization: 4703691108576a896499xxxxxxxx'
PHP请求代码示例
<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => 'http://www.damaijia168.com/vv/external/v1/product_get_list?id=2&page=1&pageSize=10',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'accept: application/json',
'Authorization: 4703691108576a896499ddxxxxxxx'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
JAVA请求代码示例
OkHttpClient client = new OkHttpClient().newBuilder() .build();Request request = new Request.Builder() .url("http://www.damaijia168.com/vv/external/v1/product_get_list?id=2&page=1&pageSize=10")
.method("GET", null)
.addHeader("accept", "application/json")
.addHeader("Authorization", "4703691108576a896499ddaxxxxxxxx")
.build();
Response response = client.newCall(request).execute();
Python请求代码示例
import requests
import json
url = "http://www.damaijia168.com/vv/external/v1/product_get_list?id=2&page=1&pageSize=10"
headers = {
'Authorization': '1798c6aadec33d1bc2f5b707f1049aefexxxx',
'Content-Type': 'application/json'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
# 响应参数
| 参数 | 类型 | 描述 |
|---|---|---|
| data | array | 返回数据 |
| total | int | 总数量 |
| index | int | 当前页数 |
| list | array | 数据 |
| —id | int | 商品ID |
| —name | string | 商品名称 |
| —othumb | string | 商品图片 |
| —cost_price | int | 成本价(点券) |
| —weight | int | 重量g |
| —stock | int | 商品库存 |
| —sales | int | 销售数量 |
| —create_time | string | 创建时间 |
| —user_source | string | 收件人信息数据来源(来源 taobao:淘宝 tmall:天猫 jd:京东 pdd:拼多多 albb:阿里巴巴 ks:快手小店 dyxd:抖音小店 other:其他) |
| —signing_method | int | 签收方式 1买家签收 2站点签收 3快递员签收 |
| –is_support_encry | int | 是否支持密文 0否1支持 |
| –support_entry_source | int | 支持密文的平台(taobao:淘宝 tmall:天猫 jd:京东 pdd:拼多多 dyxd:抖店 返回参数为空不支持密文) |
| status | int | 状态码,0为成功 |
# 返回数据
{
"data": {
"total": 6,
"list": [
{
"user_source": [
"taobao",
"tmall",
"other"
],
"id": 358,
"name": "双齿梳",
"othumb": "http://image.damaijia168.com/2021/01/11/09/01/56/12609.png",
"cost_price": 11,
"weight": 10,
"stock": 9999,
"sales": 9948,
"create_time": "2020-11-12 22:22:17",
"signing_method": 1
},
{
"user_source": [
"pdd",
"other"
],
"id": 400,
"name": "密封夹5个装",
"othumb": "http://image.damaijia168.com/2021/01/09/06/01/19/73112.jpg",
"cost_price": 121,
"weight": 40,
"stock": 9999,
"sales": 135,
"create_time": "2020-11-12 22:22:21",
"signing_method": 1
}
]
},
"status": 0
}
# 错误码(更多错误码请进入获取token页面查看公共错误码)
| 状态码 | 错误说明 |
|---|---|
| 422 | 参数列表不合法,在err中会给出提示 |
| 200 | 认证失败 |
| 227 | 仓库已下架 |
← 1-3_获取快递列表 1-5_创建订单 →