[GET] 已订阅产品列表
AI 概览
介绍列出客户订阅的多属性的端点,并给出每个多属性下处于等待、已发送、失败和已取消订阅状态的客户数量。
- 调用
GET /shop-api/back-in-stock/products;速率限制为throttle:60,1。 - 可选参数:
page、per_page(1 至 100,默认 10)、query、state、stock和sort。 state按ready、waiting、notified或problem筛选;stock按in_stock或out_of_stock筛选。sort最多接受 3 个键,如waiting:desc;默认按订阅者最多优先排序。- 仅统计提供了电子邮件地址的订阅;
waiting、sent、failed和unsubscribed之和等于subscribers。
摘要由 AI 生成,可能有误,请以下方完整指南为准。
* 身份验证
必需 Authorization: Bearer ••••••••••••••••••••••••••••••••••••
限制 throttle:60,1
请求
检索客户订阅的多属性,每个多属性一行,并显示有多少客户在等待、已发送到货邮件、发送失败或已取消订阅。支持分页、搜索、筛选和排序。
端点 GET - /shop-api/back-in-stock/products?page=1&per_page=10
| 参数 | 类型 | 是否必需 |
|---|---|---|
| page | number | no |
| per_page | number | no |
| query | string | no |
| state | string | no |
| stock | string | no |
| sort | string | no |
page— 页码,从1开始。默认为1。per_page— 每页的多属性数量,范围为1到100。默认为10。query— 按产品标题、多属性标题或 SKU 搜索。state— 可选值:all(默认)ready— 有客户在等待,且该多属性已到货waiting— 有客户在等待,且该多属性仍然缺货notified— 不再有客户在等待problem— 至少有一封到货邮件发送失败
stock—all(默认)、in_stock、out_of_stock。sort— 最多 3 个键,以逗号分隔,每个键写作key:asc或key:desc。键包括:product、waiting、notified、subscribers、last_added。默认:订阅者最多的排在最前。示例:waiting:desc,last_added:desc。
仅统计带有电子邮件地址的订阅。
GET /shop-api/back-in-stock/products?page=1&per_page=10&state=waiting&sort=waiting:desc HTTP/1.1Host: preorder.globo.ioAuthorization: ************const myHeaders = new Headers();myHeaders.append("Authorization", "************");const requestOptions = { method: "GET", headers: myHeaders, redirect: "follow"};fetch("https://preorder.globo.io/shop-api/back-in-stock/products?page=1&per_page=10&state=waiting&sort=waiting:desc", requestOptions) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.error(error));$curl = curl_init();curl_setopt_array($curl, array( CURLOPT_URL => 'https://preorder.globo.io/shop-api/back-in-stock/products?page=1&per_page=10&state=waiting&sort=waiting:desc', 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( 'Authorization: ************' ),));$response = curl_exec($curl);curl_close($curl);echo $response;成功响应 200
waiting、sent、failed 和 unsubscribed 互不重叠,且总和始终等于 subscribers。
{ "success": true, "data": [ { "product_id": 1234567890, // Shopify product ID without gid://shopify/Product/ "variant_id": 9876543210, // Shopify variant ID without gid://shopify/ProductVariant/ "product_title": "Product Name", "variant_title": "Size M / Blue", // "Default Title" if the product has no variants "sku": "SKU-001", // nullable "inventory_available": 0, // Latest available quantity recorded for the variant, null if not recorded yet "state": "waiting", // ready => waiting customers + in stock, waiting => waiting customers + out of stock, notified => nobody waiting "subscribers": 41, // Total sign-ups for this variant "waiting": 39, // Not sent the restock email yet "sent": 1, // Restock email sent "failed": 1, // Restock email failed to send "unsubscribed": 0, // Unsubscribed before the restock email was sent "opened": 0, // Customers who opened the restock email "clicked": 0, // Customers who clicked the restock email "last_subscribed_at": "2026-07-03 10:00:00", // Latest sign-up "last_sent_at": "2026-07-05 08:30:00" // Latest restock email, null if none sent } ], "pagination": { "total": 25, // Total variants "per_page": 10, "current_page": 1, "last_page": 3, "from": 1, // null if the page is empty "to": 10 // null if the page is empty }}失败
{ "success" => false, "message" => "The selected state is invalid."}| 消息 | 触发条件 |
|---|---|
The page must be at least 1. |
page 小于 1 |
The per page may not be greater than 100. |
per_page 超出范围 |
The selected state is invalid. |
state 不是上述值之一 |
The selected stock is invalid. |
stock 不是上述值之一 |
Something went wrong |
意外错误 |
此页面对您有帮助吗?
感谢您的反馈! 告诉我们缺少了什么
报告问题