İçeriğe geç
Uygulamayı yükle
Türkçe

[POST] Kayıt oluşturma

Yapay Zekâ Özeti

Bir müşteri ve varyant için stoğa girince haber ver gönderimi oluşturan uç noktayı belgeler.

  • POST /shop-api/back-in-stock/create çağırın; hız sınırı throttle:30,1'dir.
  • customer_email, product_id ve variant_id zorunludur; customer_phone, locale, note ve content isteğe bağlıdır.
  • Bir form alanı kimliğiyle eşleşmeyen content anahtarları atılır; yönetici panelinde ve dışa aktarımlarda okunabilir etiketler görünsün diye content.keyLabel ekleyin.
  • Gönderim zaten varsa mesaj "Submission updated successfully" olur; varyant için zaten kayıtlı bir müşteri hata alır.

Yapay zekâ tarafından oluşturulan özet. Hata içerebilir; aşağıdaki kılavuzun tamamını kontrol edin.

* Kimlik doğrulama

Zorunlu Authorization

Sınır throttle:30,1

İstek

Uç nokta 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;

Payload gövdesi

ParametrelerTürZorunlu
customer_emailemailevet
product_idnumberevet
variant_idnumberevet
customer_phonephone +9123456789hayır
localestring enhayır
notestringhayır
contentobjecthayır
content.keyLabelobjecthayır
  1. content : Özel alan değerleri. Aşağıdaki eşleme tablosuna bakın. GET /form tarafından döndürülen bir alan id değeriyle eşleşmeyen (ve source ya da keyLabel olmayan) her anahtar, kaydedilmeden önce sessizce atılır.
  2. content.keyLabel Gönderdiğiniz özel alanlar için { fieldId: label } eşlemesi. Şiddetle önerilir — bu olmadan satıcının yönetim arayüzünde ve CSV dışa aktarımlarında okunabilir etiket yerine ham alan id değeri görünür.

Tüm alanlı formları kullanarak aboneler oluşturmak için gereken içerik hakkında daha fazla bilgi edinin.


Başarılı yanıt 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"
}
}

Başarısız

// 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"
}

Bu sayfa yardımcı oldu mu?

Sorun bildir