跳到內容
安裝應用程式
繁體中文

[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 未預期的錯誤

這個頁面有幫助嗎?

回報問題