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

[PUT] 將訂閱轉移至其他訂閱

AI 概覽

說明將到貨通知登記移至其他商品和款式的端點。

  • 呼叫 PUT /shop-api/back-in-stock/update;速率限制為 throttle:30,1。
  • submission_id、new_product_id 和 new_variant_id 為必填;note 和 pending 為選填。
  • 狀態預設維持不變;pending = true 會將狀態還原為補貨郵件傳送之前的狀態。
  • 商品標題、款式標題、SKU 和庫存 ID 會從新的 Shopify 商品同步;顧客的電子郵件和電話不會變更。

摘要由 AI 產生,可能有誤,請以下方完整指南為準。

* 驗證

必要 Authorization

限制 throttle:30,1

請求

端點 PUT - /shop-api/back-in-stock/update

Payload 內容

根據預設,訂閱狀態會保持不變。
若 pending = true,訂閱狀態會還原為寄送補貨郵件之前的狀態。

參數類型必填
submission_idintegeryes
new_product_idnumberyes
new_variant_idnumberyes
notestringno
pendingboolean true falseno
PUT /shop-api/back-in-stock/update HTTP/1.1
Host: globo.preorder.io
Content-Type: application/json
Authorization: ************
Content-Length: 123
{
"submission_id": 1,
"new_product_id": 9697898955032,
"new_variant_id": 49921014628632,
"note" : "ok"
}
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "************");
const raw = JSON.stringify({
"submission_id": 1,
"new_product_id": 9697898955032,
"new_variant_id": 49921014628632,
"note": "ok"
});
const requestOptions = {
method: "PUT",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://preorder.globo.io/shop-api/back-in-stock/update", 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/update',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"submission_id": 1,
"new_product_id": 9697898955032,
"new_variant_id": 49921014628632,
"note" : "ok"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: ••••••'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

成功回應 200

{
"success": true,
"message": "Submission updated successfully",
"data": {
"id": 12345,
"product_id": 7891234567890, // changed to new product_id
"variant_id": 43900910010999, // changed to new variant_id
"customer_email": "[email protected]", // Not change
"customer_phone": "+84123456789", // Not change
"product_title": "Product Name", // Sync new product Shopify
"variant_title": "Size L / Red", // Sync new product Shopify
"sku": "SKU-002", // Sync new product Shopify
"inventory_id": "45678901234", // Sync new product Shopify inventory_item_id
"status": 0, // Leave as is if not submitted pending
"last_sent": null, // Leave as is if not submitted pending
"opened": 0, // Leave as is if not submitted pending
"clicked": 0, // Leave as is if not submitted pending
"note": "test", // Update if necessary.
"created_at": "2026-07-06T10:00:00.000000Z",
"updated_at": "2026-07-06T15:00:00.000000Z"
}
}

失敗

{ "success": false, "message": "Back in stock product not found" }
{ "success": false, "message": "Variant not found" }
{ "success": false, "message": "The submission id field is required." }
{ "success": false, "message": "Something went wrong" }

這個頁面有幫助嗎?

回報問題