跳转到内容
安装应用
简体中文

[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.1
Host: preorder.globo.io
Authorization: ************
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 意外错误

此页面对您有帮助吗?

报告问题