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

[POST] Kural oluşturma

Yapay Zekâ Özeti

Tüm ürünler, bir koleksiyon, ürünler veya varyantlar için yakında geliyor kuralı oluşturan uç noktayı belgeler.

  • POST /shop-api/coming-soon/create çağırın; hız sınırı throttle:30,1'dir.
  • name, start_date ve apply_to zorunludur; end_date, start_date değerinden sonra olmalıdır.
  • apply_to, all, collection, product veya variant olur; eşleşmek için product_ids veya variant_ids (1 ile 50 arası) ya da tek bir collection_id gönderin.
  • translations, yakında geliyor düğme metnini ve mesajlarını içeren, dil başına bir nesnedir; show_countdown isteğe bağlıdır.
  • Bir doğrulama tablosu her alan için kuralları ve olası hata mesajlarını listeler.

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/coming-soon/create

Payload gövdesi

ParametrelerTürZorunlu
namestringevet
statusint 0 1hayır
start_datedatetimeevet örn. 2026-07-01T10:00:00.000000Z
end_datedatetime hayır
apply_to"all" | "collection" | "product" | "variant"evet
product_idsarray [1,2,...]evet min:1|max:50 (apply_to = product ise)
variant_idsarray [1,2,...]evet min:1|max:50 (apply_to = variant ise)
collection_id number tek koleksiyonevet (apply_to = collection ise)
translationsobjecthayır
show_countdownboolean true falsehayır
  1. apply_to şunlardan biri olmalıdır: "all" "collection" "product" "variant"
  2. apply_to değeri "product" değilse product_ids gönderilemez ve product_ids bir array olmalıdır
  3. apply_to değeri "variant" değilse variant_ids gönderilemez ve variant_ids bir array olmalıdır
  4. apply_to değeri "collection" değilse collection_id gönderilemez ve collection_id imzalı bir kimlik olmalıdır
  5. translations bir nesne olmalıdır, örnek:
translations: {
default: {
comingSoonAddToCartText: "Coming Soon" // string
}
// en: {...}, jp: {...}
}
POST /shop-api/coming-soon/create HTTP/1.1
Host: preorder.globo.io
Content-Type: application/json
Authorization: ************
Content-Length: 347
{
"name": "Summer launch",
"status": 1,
"start_date": "2026-07-01T10:00:00.000000Z",
"end_date": "2026-07-11T10:00:00.000000Z",
"apply_to": "product",
"product_ids": [10076972613912],
"translations": {
"default":{
"comingSoonAddToCartText":"Coming Soon",
"comingSoonAboveMessage":"Product will available in ...",
"comingSoonBellowMessage":""
},
"jp":{
"comingSoonAddToCartText":"Coming Soon",
"comingSoonAboveMessage":"Product will available in ...",
"comingSoonBellowMessage":""
}
}
}
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "************");
const raw = JSON.stringify({
"name": "Summer launch",
"status": 1,
"start_date": "2026-07-01T10:00:00.000000Z",
"end_date": "2026-07-11T10:00:00.000000Z",
"apply_to": "product",
"product_ids": [10076972613912],
"translations": {
"default":{
"comingSoonAddToCartText":"Coming Soon",
"comingSoonAboveMessage":"Product will available in ...",
"comingSoonBellowMessage":""
},
"jp":{
"comingSoonAddToCartText":"Coming Soon",
"comingSoonAboveMessage":"Product will available in ...",
"comingSoonBellowMessage":""
}
}
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://preorder.globo.io/shop-api/coming-soon/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/coming-soon/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 =>'{
"name": "coming soon 1",
"status": 0,
"start_date": "2026-07-01T10:00:00.000000Z",
"apply_to": "product",
"product_ids": [10076972613912],
"translations": {
"default":{
"comingSoonAddToCartText":"Coming Soon",
"comingSoonAboveMessage":"Product will available in ...",
"comingSoonBellowMessage":""
},
"jp":{
"comingSoonAddToCartText":"Coming Soon",
"comingSoonAboveMessage":"Product will available in ...",
"comingSoonBellowMessage":""
}
}
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: ************'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Başarılı yanıt 200

{
"success": true,
"message": "Coming soon product created",
"data": {
"id": 1,
"name": "Summer launch",
"start_date": "2026-07-01 10:00:00",
"end_date": null,
"show_countdown": null,
"apply_to": "product",
"product_ids": [10076972613912],
"variant_ids": null,
"collection_id": null,
"translations": { "default": { "comingSoonAddToCartText": "Coming soon" } },
"status": 1,
"created_at": "2026-07-16T07:00:00.000000Z",
"updated_at": "2026-07-16T07:00:00.000000Z"
}
}

Doğrulama

AlanKurallarOlası hata mesajları
namerequired, string, max:255The name field is required.
The name may not be greater than 255 characters.
statusrequired, in:0,1The status field is required.
The selected status is invalid.
start_daterequired, dateThe start date field is required.
The start date is not a valid date.
end_datenullable, date, after:start_dateThe end date is not a valid date.
The end date must be a date after start date.
show_countdownnullable, booleanThe show countdown field must be true or false.
apply_toproduct,variant,collection,allThe apply to field is required.
The selected apply to is invalid.
product_idsrequired_if:apply_to,product, arrayThe product ids field is required when apply to is product.
The product ids must be an array.
variant_idsrequired_if:apply_to,variant, arrayThe variant ids field is required when apply to is variant.
The variant ids must be an array.
collection_idrequired_if:apply_to,collectionThe collection id field is required when apply to is collection.
translationsnullable, arrayThe translations must be an array.
translations.{lang}arrayEach translation entry must be an array.
translations.{lang}.comingSoonAddToCartTextstringThe translations.{lang}.comingSoonAddToCartText must be a string.
translations.{lang}.comingSoonAboveMessagestringThe translations.{lang}.comingSoonAboveMessage must be a string.
translations.{lang}.comingSoonBellowMessagestringThe translations.{lang}.comingSoonBellowMessage must be a string.

Bu sayfa yardımcı oldu mu?

Sorun bildir