跳转到内容
安装应用
简体中文

[PUT] 更新规则

AI 概览

介绍更新现有即将上市规则的端点。

  • 发送 PUT 请求,并附带必填的 coming_soon_id;速率限制为 throttle:30,1。
  • name、status、日期、apply_to、translations 和 show_countdown 为可选。
  • 当 apply_to 为 product 或 variant 时,请发送 1 至 50 个 product_ids 或 variant_ids;为 collection 时,请发送 collection_id。
  • 验证表列出了每个字段的规则和可能出现的错误消息。

摘要由 AI 生成,可能有误,请以下方完整指南为准。

* 身份验证

必需 Authorization

限制 throttle:30,1

请求

端点 POST - /shop-api/coming-soon/create

请求体负载

参数类型是否必填
coming_soon_idintyes
namestringoption
statusint 0 1option
start_datedatetimeoption 例如 2026-07-01T10:00:00.000000Z
end_datedatetime option
apply_to"all" | "collection" | "product" | "variant"option
product_idsarray [1,2,...]yes min:1|max:50(如果 apply_to = product)
variant_idsarray [1,2,...]yes min:1|max:50(如果 apply_to = variant)
collection_id number single collectionyes (如果 apply_to = collection)
translationsobjectoption
show_countdownboolean true falseoption
  1. apply_to 必须是 "all" "collection" "product" "variant" 之一
  2. 当 apply_to 不是 "product" 时可以不发送 product_ids,且 product_ids 必须是数组
  3. 当 apply_to 不是 "variant" 时可以不发送 variant_ids,且 variant_ids 必须是数组
  4. 当 apply_to 不是 "collection" 时可以不发送 collection_id,且 collection_id 必须是签名 ID
  5. translations 必须是对象,示例:
translations: {
default: {
comingSoonAddToCartText: "Coming Soon" // string
}
// en: {...}, jp: {...}
}
PUT /shop-api/coming-soon/update HTTP/1.1
Host: preorder.globo.io
Content-Type: application/json
Authorization: ************
Content-Length: 347
{
"coming_soon_id": 1,
"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({
"coming_soon_id": 1,
"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: "PUT",
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 => 'PUT',
CURLOPT_POSTFIELDS =>'{
"coming_soon_id": 1,
"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;

成功响应 200

{
"success": true,
"message": "Coming soon product updated",
"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"
}
}

验证

字段规则可能的错误消息
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.

此页面对您有帮助吗?

报告问题