- 登录授权
- 商品
- 账户
- 验证码
- Keywords
- Banner
- 文章
- 短信
- 订单
- 地区
- 收货地址
- 优惠券
- 余额提现
- 评论
商品查询
开发中
GET
/api/goods
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Query 参数
category
integer
分类id
示例值:
1
recommend
integer
是否推荐
示例值:
1
sort
string
可选
示例值:
price
sort_by
string
可选
示例值:
asc
search
string
关键字搜索
示例值:
感冒
per_page
integer
每页条数
默认值:
10
page
integer
页码
默认值:
1
Header 参数
Accept
string
必需
默认值:
application/json
X-Requested-With
string
必需
默认值:
XMLHttpRequest
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET '/api/goods?per_page=10&page=1' \
--header 'Accept;' \
--header 'X-Requested-With;'
返回响应
🟢200成功
application/json
Body
data
array[object (Goods) {18}]
数据
id
integer
商品 id
category_id
integer
分类 id
type_id
integer | null
类型 id
brand_id
integer | null
品牌 id
goods_sn
string
商品编号
name
string
商品名称
cover_image
string
封面图
description
string | null
描述
price
integer
价格
on_sale
integer
是否上架
sold_count
integer
销量
stock
integer
库存
created_at
integer
创建时间
content
array[string]
详细
attr
array [object {2}] | null
属性
part
array [object {2}] | null
可选
spec
array [object {2}] | null
规格
skus
array[object (GoodsSku) {7}]
可选
code
integer
返回码
message
string
信息
meta
object (Pagination)
分页
current_page
integer
当前页码
last_page
integer
最大页码
per_page
integer
每页条数
total
integer
总记录数
示例
{
"data": [
{
"id": 1,
"merchant_id": 1,
"merchant": {
"id": 1,
"user_id": 1,
"category_id": 34,
"address": "\u897f\u5b89\u6c88\u6cb3\u533a",
"logo": "https:\/\/via.placeholder.com\/640x480.png",
"description": "Occaecati reprehenderit nemo maiores et velit.",
"name": "\u80e1\u91d1\u51e4",
"position": {
"lat": 39.90923,
"lng": 116.397428,
"address": "\u897f\u5b89\u6c88\u6cb3\u533a"
},
"profit_ratio": 50,
"sold_count": 0
},
"category_id": 3,
"type_id": 3,
"brand_id": 1,
"goods_sn": "1016",
"name": "\u4e09\u661fGalaxy Noet10+ 5G(SM-N9760)",
"cover_image": "https:\/\/img14.360buyimg.com\/n5\/s54x54_jfs\/t1\/85701\/3\/3164\/116271\/5ddcffaeEd7924f35\/013d69c48b507982.jpg",
"description": null,
"price": "6499.00",
"vip_price": "6499.00",
"on_sale": 1,
"sold_count": 1,
"stock": 100,
"created_at": 1660618730
}
],
"code": 200,
"message": "",
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 15,
"total": 2
}
}
修改于 2022-09-13 05:44:48