需要 read_products 权限点。
更多权限点使用信息,请参考:
GET https://{handle}.myshopline.com/admin/openapi/v20260301/products/products.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
批量查询商品基本信息。
查询参数
  • collection_id string
    商品分类的唯一标识 ID。
    最大长度限制:64
    例子: 12248721639068681442230282
  • created_at_max string
    指定要查询商品的最晚创建时间。在此日期或此日期之前创建的数据会被返回。格式:ISO 8601
    例子: 2021-09-02T14:11:54+00:00
  • created_at_min string
    指定要查询商品的最早创建时间。在此日期或此日期之后创建的数据会被返回。格式:ISO 8601
    例子: 2021-09-03T14:11:54+00:00
  • fields string
    指明需要返回的字段,多个字段用逗号分隔。可指定的字段范围参考响应体中 product 对象下的一级子字段。
    例子: title,id,created_at
  • handle string
    商品的语义化的唯一标识,默认基于 title 生成。
    最大长度限制:255
    例子: product-handle
  • ids string
    指定查询的商品 ID,多个 ID 用逗号分隔。
    例子: 16057850264845250791280282,16057850264845250333280282
  • limit integer
    要查询的商品的数量限制。
    取值范围:1-250
    默认值:50
  • order_by string
    基于款式创建时间的排序规则。有效枚举值包含:
    • created_at_asc: 时间升序排列,即从最早创建到最晚创建。
    • created_at_desc: 时间降序排列,即从最晚创建到最早创建。
    例子: created_at_desc
  • page_info string
    分页查询的唯一标识,用于定位特定页面。
    该字段值需要在你已经查询完分页信息后,在该接口响应头中的 link 字段值中获取。例如,你获取到的 link 的值为 <https://{handle}.myshopline.com/admin/openapi/{version}/products/products.json?limit=1&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel="next" ,那么 page_info 的值为 eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9
    关于更多如何使用分页信息,请参考 分页机制
  • product_category string
    商家自定义的商品类型。
    最大长度限制:255
    例子: Electronics
  • since_id string
    商品的 ID。传入该值后,会从指定的商品ID 开始查询商品。
    例子: 16057850264845250791280282
  • status string
    商品的状态。有效枚举值包含:
    • active:上架
    • draft:下架
    • archived:归档
  • title string
    商品的标题。
    最大长度限制:255
    例子: This is a title.
  • updated_at_max string
    指定要查询商品的最晚更新时间。在此日期或此日期之前更新的数据会被返回。格式ISO 8601
    例子: 2021-09-02T14:11:54+00:00
  • updated_at_min string
    指定要查询商品的最早更新时间。在此日期或此日期之后更新的数据会被返回。格式:ISO 8601
    例子: 2021-09-03T14:11:54+00:00
  • vendor string
    商品的品牌或厂商。
    最大长度限制:255
    例子: SHOPLINE
请求头
  • Content-Type string required
    字段值固定为 application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入。
    例子:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
状态码
更多状态码信息,参考 HTTP 状态码

响应头
  • traceId
    请求的全局唯一标识符。用于追踪请求在系统中的流转,以便于问题发生时进行定位和调试。
  • link
    提供分页数据的 URL 链接。你可以获取该字段值中的 page_info 信息用于下一次分页请求中。
    当你请求的页面存在上一页或下一页的时候,该字段会被返回。关于更多如何使用分页信息,请参考 分页机制
响应体
  • productsobject[]
    商品列表。
  • tags string
    商品的标签。
    例子: tag1, tag2
  • variantsobject[]
    商品款式列表。
  • price string
    款式的售价,数值保留到小数点后两位。
    例子: 90.22
  • imageobject
    款式的图片。
  • alt string
    款式图的替代文本描述,通常是具有图片特征或内容的单词或短语。
    例子: This is an image alt.
  • id string
    款式图的唯一标识 ID。
    例子: 5785060242207917075
  • src string
    款式图的链接,以 URL 形式展示。
    例子: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • sku string
    商家为款式自定义的标识,区别于 SHOPLINE 生成的 variant.id
    例子: S000000001
  • title string
    款式的标题,由款式的规格值拼装而成。
    例子: red · xl
  • option2 string
    款式第二个规格的信息。
    例子: xl
  • id string
    款式的唯一标识 ID。
    例子: 18057850264851626133510282
  • option3 string
    款式第三个规格的信息。
    例子: cotton
  • option4 string
    款式第四个规格的信息。
    例子: short
  • option5 string
    款式第五个规格的信息。
    例子: casual
  • required_shipping boolean
    表明款式是否需要运输。
    • true:需要运输。
    • false:不需要运输。
  • position integer
    款式的排序位置。
    例子: 1
  • product_id string
    款式对应商品的唯一标识 ID。
    例子: 16057850264845250791280282
  • barcode string
    款式的条形码。
    例子: T0000001
  • option1 string
    款式第一个规格的信息。
    例子: red
  • taxable boolean
    表明款式是否需要收税。
    • true:需要收税。
    • false:不需要收税。
  • inventory_item_id string
    库存单位的唯一标识 ID。
    例子: 5785060242375689228
  • inventory_quantity integer
    各存放地点的库存数量总和。
    例子: 99
  • inventory_tracker boolean
    表明是否开启库存追踪。
    • true:开启库存追踪。
    • false:不开启库存追踪。
  • weight string
    款式的重量,超过两位小数向上取整。
    例子: 0.23
  • compare_at_price string
    款式的原价,数值保留到小数点后两位。
    例子: 129.99
  • inventory_policy string
    表明款式是否允许超卖。
    • deny:不允许超卖。
    • continue:允许超卖。
  • weight_unit string
    款式的重量单位。有效枚举值包含:
    • g:克
    • kg:千克
    • lb:磅
    • oz:盎司
    • zh_kg:公斤
  • body_html string
    商品的描述。
  • template_path string
    商品的主题模板。
    例子: templates/product.product_template_name.json
  • published_scope string
    商品的销售渠道发布范围。有效值固定为web,代表在线商城。
  • vendor string
    商品的品牌或厂商。
    例子: SHOPLINE
  • status string
    商品的状态。有效枚举值包含:
    • active: 上架
    • draft: 下架
    • archived: 归档
  • title string
    商品的标题。
    例子: This is a Product title
  • published_at string
    商品发布到在线商店的时间。格式:ISO 8601
    例子: 2025-03-06T02:20:26+08:00
  • imagesobject[]
    商品图片列表。
  • alt string
    商品图的替代文本描述,通常是具有图片特征或内容的单词或短语。
    例子: This is an image alt.
  • id string
    商品图的唯一标识 ID。
    例子: 5785060242207917075
  • src string
    商品图的链接,以 URL 形式展示。
    例子: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • optionsobject[]
    商品规格列表。
  • id string
    规格的唯一标识 ID。
    例子: 16158068291703878544960282
  • name string
    规格的名称。
    例子: Color
  • option_valuesobject[]
    商品规格值列表。
  • value string
    规格值。
    例子: red
  • id string
    规格值的唯一标识 ID。
    例子: 16050375155238626683133099
  • product_id string
    规格对应商品的唯一标识 ID。
    例子: 16057850264845250791280282
  • values array
    规格值列表。
    例子: ["[\"red\", \"green\", \"white\"]"]
  • values_images map
    规格值与对应图片 URL 的映射关系。
    例子: {}
  • product_type string
    商品的来源。有效枚举值包含:
    • NORMAL : SHOPLINE 商家后台维护的商品
    • POD_TEMPORARY : POD 应用的临时商品
    • TEMPORARY : 其他临时商品
  • updated_at string
    商品最近一次更新的时间。格式:ISO 8601
    例子: 2025-03-06T02:20:26+08:00
  • created_at string
    商品的创建时间。格式:ISO 8601
    例子: 2025-03-06T02:20:26+08:00
  • id string
    商品的唯一标识 ID。
    例子: 16057850264845250791280282
  • imageobject
    商品的封面图。
  • alt string
    图片的替代文本描述,通常是具有图片特征或内容的单词或短语。
    例子: This is an image alt.
  • id string
    图片的唯一标识 ID。
    例子: 5785060242207917075
  • src string
    图片的链接,以 URL 形式展示。
    例子: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • handle string
    商品的语义化的唯一标识,默认基于 title 生成。
    例子: product-handle
  • product_behavior string
    用于标识商品的特殊行为,只在特定情况下有值返回。例如,当商品有潜在风险时,返回一个值。
    例子: RISK, HIDDEN
  • spu string
    商家为商品自定义的标识,区别于 SHOPLINE 生成的 product.id
    例子: S00000001
  • product_category string
    商家自定义的商品类型。
    例子: Electronics
  • path string
    商品的相对路径。
    例子: /products/clothes
  • subtitle string
    商品的摘要。
    例子: This is a subtitle
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301

ParamOptions

header required
query
query
query
query
query
query
query
query
query
query
query
query
query
query
query
query

Language

curl --request GET \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301/products/products.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
指定PageInfo
Response
{
"products": [
{
"body_html": "<p>This is a desription</p>",
"product_type": "NORMAL",
"status": "active",
"image": {
"alt": "This is a alt",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"spu": "S000000001",
"updated_at": "2023-08-28T19:23:56+08:00",
"variants": [
{
"weight_unit": "g",
"price": "100.00",
"inventory_item_id": "6087890295139080241",
"position": 1,
"option1": "White",
"barcode": "T00000001",
"inventory_tracker": true,
"compare_at_price": "120.00",
"taxable": true,
"id": "18060878902931594024673144",
"inventory_quantity": 580,
"image": {
"alt": "This is a alt",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"weight": "10.00",
"sku": "S00000000101",
"inventory_policy": "continue",
"product_id": "16060878902926560859813144",
"title": "White",
"required_shipping": true
}
],
"images": [
{
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024",
"alt": "This is a alt"
}
],
"subtitle": "This is a subtitle",
"product_behavior": "",
"published_at": "2023-08-28T11:50:47+08:00",
"handle": "my-product-19",
"options": [
{
"values_images": {},
"id": "16160878902931594024693144",
"name": "Color",
"product_id": "16060878902926560859813144",
"values": [
"White"
]
}
],
"published_scope": "web",
"product_category": "Clothes",
"title": "My Product 19",
"created_at": "2023-08-28T11:50:47+08:00",
"id": "16060878902926560859813144",
"tags": "Spring,T shirt",
"template_path": "templates/products/detail.html",
"vendor": "Shopline"
},
{
"images": [
{
"alt": "My Product 17",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
}
],
"published_scope": "web",
"updated_at": "2023-08-28T11:50:32+08:00",
"spu": "S0000001",
"image": {
"alt": "My Product 17",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"product_type": "NORMAL",
"vendor": "Shopline",
"created_at": "2023-08-28T11:50:32+08:00",
"product_behavior": "",
"handle": "my-product-18",
"product_category": "Clothes",
"published_at": "2023-08-28T11:50:32+08:00",
"body_html": "<p>This is a desription</p>",
"variants": [
{
"compare_at_price": "120.00",
"inventory_quantity": 222,
"position": 1,
"product_id": "16060878900384309254383144",
"barcode": "B0000001",
"inventory_tracker": true,
"price": "100.00",
"inventory_item_id": "6087890040041533931",
"sku": "T0000001",
"id": "18060878900387832469803144",
"inventory_policy": "deny",
"required_shipping": true,
"weight": "50.00",
"taxable": true,
"weight_unit": "g"
}
],
"template_path": "templates/products/detail.html",
"subtitle": "This is a subtitle",
"tags": "T shirt",
"title": "My Product 18",
"options": [],
"status": "active",
"id": "16060878900384309254383144"
},
{
"template_path": "templates/products/detail.html",
"variants": [
{
"weight": "50.00",
"compare_at_price": "120.00",
"inventory_item_id": "6087889308152263615",
"inventory_policy": "deny",
"sku": "T0000001",
"inventory_quantity": 222,
"id": "18060878893070953099003144",
"inventory_tracker": true,
"price": "100.00",
"barcode": "B0000001",
"weight_unit": "g",
"required_shipping": true,
"position": 1,
"taxable": true,
"product_id": "16060878893067429883503144"
}
],
"published_scope": "web",
"product_type": "NORMAL",
"body_html": "<p>This is a desription</p>",
"spu": "S0000001",
"image": {
"alt": "My Product 17",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"status": "draft",
"updated_at": "2023-08-28T11:49:48+08:00",
"title": "My Product 17",
"handle": "my-product-17",
"product_category": "Clothes",
"published_at": "2023-08-28T11:49:48+08:00",
"subtitle": "This is a subtitle",
"created_at": "2023-08-28T11:49:48+08:00",
"id": "16060878893067429883503144",
"tags": "T shirt",
"images": [
{
"alt": "My Product 17",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
}
],
"options": [],
"product_behavior": "",
"vendor": "Shopline"
},
{
"title": "My Product 16",
"vendor": "Shopline",
"image": {
"alt": "This is a alt",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"published_at": "2023-08-28T11:46:31+08:00",
"product_behavior": "",
"updated_at": "2023-08-28T19:23:28+08:00",
"product_category": "Clothes",
"body_html": "<p>This is a desription</p>",
"published_scope": "web",
"product_type": "NORMAL",
"spu": "S000000001",
"handle": "my-product-16",
"options": [
{
"product_id": "16060878859910114569133144",
"values": [
"White"
],
"values_images": {},
"id": "16160878859913134468093144",
"name": "Color"
}
],
"created_at": "2023-08-28T11:46:30+08:00",
"id": "16060878859910114569133144",
"status": "active",
"tags": "Spring,T shirt",
"variants": [
{
"inventory_policy": "continue",
"title": "White",
"product_id": "16060878859910114569133144",
"sku": "S00000000101",
"position": 1,
"inventory_quantity": 580,
"barcode": "T00000001",
"compare_at_price": "120.00",
"required_shipping": true,
"image": {
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024",
"alt": "This is a alt"
},
"inventory_item_id": "6087885992420710729",
"weight": "10.00",
"inventory_tracker": true,
"option1": "White",
"taxable": true,
"id": "18060878859913134468073144",
"price": "100.00",
"weight_unit": "g"
}
],
"subtitle": "This is a subtitle",
"template_path": "templates/products/detail.html",
"images": [
{
"alt": "This is a alt",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
}
]
},
{
"images": [
{
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024",
"alt": "This is a alt"
}
],
"variants": [
{
"option2": "White",
"price": "100.00",
"weight_unit": "g",
"compare_at_price": "120.00",
"inventory_item_id": "6087885361949712083",
"inventory_quantity": 580,
"sku": "S00000000101",
"image": {
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024",
"alt": "This is a alt",
"id": "5976632123224980485"
},
"position": 1,
"id": "18060878853605069127743144",
"barcode": "T00000001",
"taxable": true,
"title": "L · White",
"option1": "L",
"weight": "10.00",
"inventory_policy": "continue",
"inventory_tracker": true,
"required_shipping": true,
"product_id": "16060878853599197112313144"
},
{
"inventory_item_id": "6087885361949712081",
"inventory_policy": "deny",
"id": "18060878853605069127833144",
"price": "100.00",
"required_shipping": true,
"taxable": true,
"option2": "White",
"product_id": "16060878853599197112313144",
"option1": "XL",
"barcode": "B0000000001",
"position": 2,
"image": {
"alt": "My Product-10",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"sku": "S00000000102",
"weight_unit": "g",
"inventory_quantity": 100,
"title": "XL · White",
"inventory_tracker": true,
"compare_at_price": "120.00",
"weight": "50.00"
},
{
"price": "100.00",
"id": "18060878853605069127893144",
"sku": "S00000000103",
"required_shipping": true,
"taxable": true,
"inventory_item_id": "6087885361949712082",
"weight": "50.00",
"barcode": "B0000000001",
"weight_unit": "g",
"product_id": "16060878853599197112313144",
"compare_at_price": "120.00",
"option1": "XXL",
"position": 3,
"title": "XXL · White",
"inventory_quantity": 170,
"inventory_tracker": true,
"option2": "White",
"image": {
"alt": "My Product-10",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"inventory_policy": "deny"
}
],
"title": "My Product 15",
"updated_at": "2023-08-28T19:19:05+08:00",
"tags": "Spring,T shirt",
"template_path": "templates/products/detail.html",
"product_category": "Clothes",
"body_html": "<p>This is a desription</p>",
"created_at": "2023-08-28T11:45:53+08:00",
"product_behavior": "",
"published_scope": "web",
"vendor": "Shopline",
"handle": "my-product-15",
"id": "16060878853599197112313144",
"image": {
"alt": "This is a alt",
"id": "5976632123224980485",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"options": [
{
"values_images": {},
"id": "16160878853605069127763144",
"name": "Size",
"product_id": "16060878853599197112313144",
"values": [
"L",
"XL",
"XXL"
]
},
{
"values": [
"White"
],
"values_images": {},
"id": "16160878853605069127793144",
"name": "Color",
"product_id": "16060878853599197112313144"
}
],
"product_type": "NORMAL",
"published_at": "2023-08-28T11:45:53+08:00",
"spu": "S000000001",
"subtitle": "This is a subtitle",
"status": "active"
}
]
}
这篇文章对你有帮助吗?