需要 read_product_listings 权限点。
更多权限点使用信息,请参考:
GET https://{handle}.myshopline.com/admin/openapi/v20261201/product_listings.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
根据条件返回销售渠道中的商品
查询参数
  • page_info string
    分页查询的唯一标识,用于定位特定页面。
    该字段值需要在你已经查询完分页信息后,在该接口响应头中的 link 字段值中获取。例如,你获取到的 link 的值为 <https://{handle}.myshopline.com/admin/openapi/{version}/product_listings.json?limit=1&page_info=eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9>; rel="next" ,那么 page_info 的值为 eyJzaW5jZUlkIjoiMTYwNTc1OTAxNTM4OTA4Mjk1MjExMTI3ODgiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjF9
    关于更多如何使用分页信息,请参考 分页机制
    例子: eyJzaW5jZUlkIjoiMTYwNTc0NzY4NjQyMTI3MzUxNTQxNjAyODIiLCJkaXJlY3Rpb24iOiJuZXh0IiwibGltaXQiOjV9
  • product_ids string
    根据传入的商品ID列表筛选,最多1000个,多个用逗号分隔
    例子: 16057039432335097907370282
  • updated_at_min string
    按在特定日期和时间之后最后更新的产品列表进行筛选
    例子: 2022-12-06T15:13:50+08:00
  • collection_id string
    使用分类ID筛选
    例子: 12250433045062532239420282
  • handle string
    全局唯一的商品handle
    例子: product-handle
  • limit string
    查询数量限制,默认50,不能超过1000
    例子: 50
请求头
  • Content-Type string required
    字段值固定为 application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入。
    例子:
    Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA
状态码
更多状态码信息,参考 HTTP 状态码

响应头
  • link
    提供分页数据的 URL 链接。你可以获取该字段值中的 page_info 信息用于下一次分页请求中。
    当你请求的页面存在上一页或下一页的时候,该字段会被返回。关于更多如何使用分页信息,请参考 分页机制
  • traceId
    请求的全局唯一标识符。用于追踪请求在系统中的流转,以便于问题发生时进行定位和调试。
响应体
  • product_listingsobject[]
    商品列表
  • published_at string
    发布到在线商店的时间
    例子: 2022-12-06T15:13:50+08:00
  • published_scope string
    设置发布范围,值为「web」时表示在线商店
    例子: web
  • status string
    商品状态:active - 上架,draft - 下架,archived - 归档
    例子: active
  • variantsobject[]
    规格列表,最多500个
  • required_shipping boolean
    是否需要发货
    例子: true
  • taxable boolean
    是否需要收税
    例子: true
  • barcode string
    条形码
    例子: B00000001
  • compare_at_price string
    原价
    例子: 100
  • imageobject
    款式图
  • alt string
    图片alt
    例子: This is a image alt
  • src string
    图片地址
    例子: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • inventory_policy string
    是否允许超卖,continue:允许,deny:不允许
    例子: deny
  • option1 string
    该款式对应的第一个选项的值
    例子: Red
  • option5 string
    该款式对应的第五个选项的值
  • product_id string
    商品ID
    例子: 16057039432335097907370282
  • weight_unit string
    重量单位, g:克,kg:千克,lb:磅,oz:盎司
    例子: g
  • id string
    款式ID
    例子: 18057039432358082693350282
  • inventory_item_id string
    库存对象ID
    例子: 5703943240925324252
  • inventory_quantity integer
    所有地点的库存汇总值
    例子: 100
  • option3 string
    该款式对应的第三个选项的值
  • price string
    售价
    例子: 90
  • sku string
    SKU码
    例子: T00000001
  • title string
    款式标题
    例子: Red/L
  • weight string
    重量
    例子: 0.5
  • inventory_tracker boolean
    是否追踪库存,true:追踪,false:不追踪
    例子: true
  • option2 string
    该款式对应的第二个选项的值
    例子: L
  • option4 string
    该款式对应的第四个选项的值
  • handle string
    全局唯一的商品handle
    例子: product-handle
  • imagesobject[]
    商品主图列表
  • alt string
    图片ALT
    例子: This is a image alt
  • src string
    图片地址
    例子: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • subtitle string
    商品摘要
    例子: This is a subtitle
  • body_html string
    商品描述
    例子: This is a description
  • template_path string
    模板路径
    例子: templates/products/detail.json
  • updated_at string
    商品更新时间
    例子: 2022-12-06T15:13:50+08:00
  • vendor string
    商品厂商
    例子: Shopline
  • created_at string
    商品创建时间
    例子: 2022-12-06T15:13:50+08:00
  • spu string
    SPU码
    例子: S00000001
  • tags string
    商品标签
    例子: tag1,tag2
  • title string
    商品标题
    例子: This is a title
  • optionsobject[]
    选项列表,最多5个
  • values_images map
    选项值图
    例子: {"Red":"https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"}
  • id string
    选项ID
    例子: 16157850264851626133440282
  • name string
    选项名称
    例子: Color
  • product_id string
    商品ID
    例子: 16057039432335097907370282
  • values array
    选项值列表
    例子: ["[\"Red\", \"Green\", \"White”]"]
  • product_id string
    商品ID
    例子: 16057039432335097907370282
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20261201

ParamOptions

header required
query
query
query
query
query
query

Language

curl --request GET \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20261201/product_listings.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
指定商品查询销售渠道的商品
Response
{
"product_listings": [
{
"product_id": "16060878850545743695513144",
"published_at": "2023-08-28T11:45:35+08:00",
"published_scope": "web",
"spu": "S000000001",
"subtitle": "This is a subtitle",
"title": "My Product 14",
"options": [
{
"product_id": "16060878850545743695513144",
"values": [
"L",
"XL",
"XXL"
],
"values_images": {},
"id": "16160878850550105771753144",
"name": "Size"
},
{
"values_images": {},
"id": "16160878850550105771783144",
"name": "Color",
"product_id": "16060878850545743695513144",
"values": [
"White"
]
}
],
"tags": "Spring,T shirt",
"updated_at": "2023-08-28T19:23:04+08:00",
"vendor": "Shopline",
"created_at": "2023-08-28T11:45:35+08:00",
"handle": "my-product-14",
"images": [
{
"alt": "This is a alt",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
}
],
"variants": [
{
"sku": "S00000000101",
"weight": "10.00",
"image": {
"alt": "This is a alt",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"inventory_policy": "continue",
"inventory_tracker": true,
"option1": "L",
"id": "18060878850550105771733144",
"inventory_item_id": "6087885056453385358",
"product_id": "16060878850545743695513144",
"required_shipping": true,
"compare_at_price": "120.00",
"option2": "White",
"taxable": true,
"title": "L · White",
"weight_unit": "g",
"barcode": "T00000001",
"inventory_quantity": 580,
"price": "100.00"
},
{
"id": "18060878850550105771823144",
"image": {
"alt": "My Product-10",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"inventory_item_id": "6087885056453385359",
"inventory_policy": "deny",
"inventory_quantity": 100,
"inventory_tracker": true,
"compare_at_price": "120.00",
"option1": "XL",
"option2": "White",
"required_shipping": true,
"taxable": true,
"sku": "S00000000102",
"product_id": "16060878850545743695513144",
"title": "XL · White",
"weight": "50.00",
"weight_unit": "g",
"price": "100.00",
"barcode": "B0000000001"
},
{
"barcode": "B0000000001",
"image": {
"alt": "My Product-10",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"inventory_tracker": true,
"product_id": "16060878850545743695513144",
"inventory_policy": "deny",
"option2": "White",
"price": "100.00",
"taxable": true,
"inventory_item_id": "6087885056453385357",
"required_shipping": true,
"compare_at_price": "120.00",
"id": "18060878850550105771883144",
"inventory_quantity": 170,
"option1": "XXL",
"sku": "S00000000103",
"title": "XXL · White",
"weight": "50.00",
"weight_unit": "g"
}
],
"body_html": "<p>This is a desription</p>",
"status": "archived",
"template_path": "templates/products/detail.html"
},
{
"created_at": "2023-08-28T11:45:15+08:00",
"spu": "S000000001",
"status": "archived",
"template_path": "templates/products/detail.html",
"handle": "my-product-13",
"images": [
{
"alt": "This is a alt",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
}
],
"product_id": "16060878847266804612583144",
"published_at": "2023-08-28T11:45:15+08:00",
"published_scope": "web",
"subtitle": "This is a subtitle",
"tags": "Spring,T shirt",
"variants": [
{
"title": "L · White",
"barcode": "T00000001",
"inventory_item_id": "6087884728240708834",
"inventory_quantity": 580,
"inventory_tracker": true,
"option2": "White",
"sku": "S00000000101",
"weight_unit": "g",
"compare_at_price": "120.00",
"product_id": "16060878847266804612583144",
"taxable": true,
"id": "18060878847269824511623144",
"required_shipping": true,
"weight": "10.00",
"image": {
"alt": "This is a alt",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"inventory_policy": "continue",
"option1": "L",
"price": "100.00"
},
{
"price": "100.00",
"taxable": true,
"weight_unit": "g",
"product_id": "16060878847266804612583144",
"compare_at_price": "120.00",
"id": "18060878847269824511713144",
"barcode": "B0000000001",
"image": {
"alt": "My Product-10",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"inventory_quantity": 100,
"title": "XL · White",
"weight": "50.00",
"required_shipping": true,
"sku": "S00000000102",
"inventory_item_id": "6087884728240708835",
"inventory_policy": "deny",
"inventory_tracker": true,
"option1": "XL",
"option2": "White"
},
{
"inventory_item_id": "6087884728240708836",
"inventory_quantity": 170,
"option1": "XXL",
"option2": "White",
"price": "100.00",
"image": {
"alt": "My Product-10",
"src": "https://img-va.myshopline.com/image/store/2001026666/1653474941510/c4845f8f7cd84ff18f082eaf9c05b820.webp?w=1024&h=1024"
},
"inventory_policy": "deny",
"inventory_tracker": true,
"product_id": "16060878847266804612583144",
"taxable": true,
"weight_unit": "g",
"barcode": "B0000000001",
"compare_at_price": "120.00",
"required_shipping": true,
"sku": "S00000000103",
"id": "18060878847269824511773144",
"title": "XXL · White",
"weight": "50.00"
}
],
"body_html": "<p>This is a desription</p>",
"title": "My Product 13",
"vendor": "Shopline",
"options": [
{
"id": "16160878847269824511643144",
"name": "Size",
"product_id": "16060878847266804612583144",
"values": [
"L",
"XL",
"XXL"
],
"values_images": {}
},
{
"id": "16160878847269824511673144",
"name": "Color",
"product_id": "16060878847266804612583144",
"values": [
"White"
],
"values_images": {}
}
],
"updated_at": "2023-08-28T19:32:57+08:00"
}
]
}
这篇文章对你有帮助吗?