- 登录授权
- 商品
- 账户
- 验证码
- Keywords
- Banner
- 文章
- 短信
- 订单
- 地区
- 收货地址
- 优惠券
- 余额提现
- 评论
商品详细
开发中
GET
/api/goods/{id}
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Path 参数
id
string
商品id
示例值:
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/1' \
--header 'Accept;' \
--header 'X-Requested-With;'
返回响应
🟢200成功
application/json
Body
data
object (Goods)
数据
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
信息
示例
{
"data": {
"id": 1,
"category_id": 3,
"type_id": 1,
"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",
"images": [
"https:\/\/img14.360buyimg.com\/n0\/jfs\/t1\/138249\/34\/51\/266266\/5edaed2fE2d4d4050\/297b76afaff928bb.jpg",
"https:\/\/img14.360buyimg.com\/n0\/jfs\/t1\/85701\/3\/3164\/116271\/5ddcffaeEd7924f35\/013d69c48b507982.jpg",
"https:\/\/img14.360buyimg.com\/n0\/jfs\/t1\/43997\/21\/12754\/274595\/5d5f87f1Ec419d2f9\/358032d0a7a2ccd7.jpg"
],
"description": null,
"price": 6499,
"on_sale": 1,
"sold_count": 0,
"stock": 100,
"created_at": 1663042669,
"content": [
"https:\/\/img30.360buyimg.com\/sku\/jfs\/t1\/91355\/34\/4028\/288919\/5de4c653Ed267b5d0\/b67ac088ded04947.jpg"
],
"attr": [
{
"name": "\u4e3b\u4f53",
"values": [
{
"name": "\u5165\u7f51\u578b\u53f7",
"value": "5G"
},
{
"name": "\u54c1\u724c",
"value": "\u4e09\u661fGalaxy"
},
{
"name": "\u4e0a\u5e02\u5e74\u4efd",
"value": "2020"
}
]
}
],
"part": [
{
"name": "\u5957\u9910",
"values": [
{
"name": "\u5957\u99101",
"value": 850
},
{
"name": "\u5957\u99102",
"value": 1200
},
{
"name": "\u5957\u99103",
"value": 1800
}
]
}
],
"spec": [
{
"name": "\u989c\u8272",
"values": [
{
"name": "\u767d\u8272",
"value": 0
},
{
"name": "\u7ea2\u8272",
"value": 800
},
{
"name": "\u9ed1\u8272",
"value": 0
}
]
},
{
"name": "\u5185\u5b58",
"values": [
{
"name": "32G",
"value": 0
},
{
"name": "64G",
"value": 1000
},
{
"name": "128G",
"value": 2000
}
]
}
],
"skus": [
{
"id": 1,
"sn": "f8853b5a-e6f6-42d3-85d1-a3c8ffea38bf",
"goods_id": 1,
"name": "\u4e09\u661fGalaxy Noet10+ 5G(SM-N9760)",
"price": "6499.00",
"stock": 100,
"spec": [
{
"name": "\u989c\u8272",
"price": 0,
"value": "\u767d\u8272"
},
{
"name": "\u5185\u5b58",
"price": 0,
"value": "32G"
}
]
}
]
},
"code": 200,
"message": ""
}