コンテンツにスキップ
アプリをインストール
日本語

[POST] Create submission

AI による概要

顧客とバリエーションに対して再入荷通知の登録を作成するエンドポイントを説明します。

  • POST /shop-api/back-in-stock/create を呼び出します。レート制限は throttle:30,1 です。
  • customer_email、product_id、variant_id は必須です。customer_phone、locale、note、content は任意です。
  • フォームフィールドの ID と一致しない content のキーは破棄されます。管理画面とエクスポートで読みやすいラベルが表示されるように content.keyLabel を追加してください。
  • 登録がすでに存在する場合のメッセージは「Submission updated successfully」です。そのバリエーションにすでに登録している顧客にはエラーが返されます。

AI が生成した要約です。誤りが含まれる場合があるため、下記のガイド全文をご確認ください。

* 認証

必須 Authorization

制限 throttle:30,1

リクエスト

エンドポイント POST - /shop-api/back-in-stock/create

POST /shop-api/back-in-stock/create HTTP/1.1
Host: preorder.globo.io
Content-Type: application/json
Authorization: ************
Content-Length: 84
{
"product_id":123456789,
"variant_id":123456789,
"customer_email": "[email protected]"
}
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "••••••");
const raw = JSON.stringify({
"product_id": 1,
"variant_id": 1,
"customer_email": "[email protected]"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://preorder.globo.io/shop-api/back-in-stock/create", 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/create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"product_id": 123456789,
"variant_id": 987654321,
"customer_email": "[email protected]"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: ************'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

ペイロード本文

パラメーター型必須
customer_emailemailyes
product_idnumberyes
variant_idnumberyes
customer_phonephone +9123456789no
localestring enno
notestringno
contentobjectno
content.keyLabelobjectno
  1. content:カスタムフィールドの値です。下のマッピング表を参照してください。GET /form が返すフィールドの id に一致しないキー(source と keyLabel を除く)は、保存前に通知なく破棄されます。
  2. content.keyLabel 送信するカスタムフィールドの { fieldId: label } のマップです。指定することを強くおすすめします。指定しない場合、ストア運営者の管理画面とCSVエクスポートには、読みやすいラベルではなくフィールドの id がそのまま表示されます。

全フィールドのフォームを使用して購読者を生成するために必要なコンテンツについて詳しく見る


成功時のレスポンス 200

{
"success": true,
"message": "Submission created successfully", // "Submission updated successfully" if submission exist
"data": {
"id": 12345, // ID submission
"product_id": 1234567890, // Shopify product ID
"variant_id": 9876543210, // Shopify variant ID
"customer_email": "[email protected]",
"customer_phone": null,
"product_title": "Product Name",
"variant_title": "Size M / Blue",
"sku": "SKU-001",
"inventory_id": "45678901234", // Shopify inventory_item_id
"status": 0, // 0 => pending
"last_sent": null, // => pending
"unsubscribe": 0, // 0 => subscribe
"content": "{\"source\":\"api\"}", // JSON string (nullable)
"locale": "default",
"opened": 0, // Chưa mở email
"clicked": 0, // Chưa click link email
"note": null,
"created_at": "2026-07-06T10:00:00.000000Z",
"updated_at": "2026-07-06T10:00:00.000000Z"
}
}

失敗

// Missing ID
{
"success": false,
"message": "product_id and variant_id are required"
}
// Not email
{
"success": false,
"message": "customer_email is required"
}
// variant not found
{
"success": false,
"message": "Variant not found"
}
// registered
{
"success": false,
"message": "Customer is already registered for this variant"
}
// catch
{
"success": false,
"message": "Something went wrong"
}

このページは役に立ちましたか?

問題を報告