콘텐츠로 이동
앱 설치
한국어

[POST] 규칙 생성

AI 개요

모든 제품, 컬렉션, 제품 또는 이형 상품에 대한 출시 예정 규칙을 만드는 엔드포인트를 설명합니다.

  • POST /shop-api/coming-soon/create를 호출합니다. 속도 제한은 throttle:30,1입니다.
  • name, start_date, apply_to는 필수이며, end_date는 start_date 이후여야 합니다.
  • apply_to는 all, collection, product, variant 중 하나이며, 이에 맞게 product_ids 또는 variant_ids(1~50개) 또는 단일 collection_id를 보냅니다.
  • translations는 출시 예정 버튼 텍스트와 메시지가 담긴 언어별 객체이며, show_countdown은 선택 사항입니다.
  • 유효성 검사 표에는 모든 필드의 규칙과 발생 가능한 오류 메시지가 나와 있습니다.

AI가 생성한 요약입니다. 오류가 있을 수 있으니 아래 전체 가이드를 확인하세요.

* 인증

필수 Authorization

제한 throttle:30,1

요청

엔드포인트 POST - /shop-api/coming-soon/create

페이로드 본문

매개변수유형필수
namestringyes
statusint 0 1no
start_datedatetimeyes 예: 2026-07-01T10:00:00.000000Z
end_datedatetime no
apply_to"all" | "collection" | "product" | "variant"yes
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 단일 컬렉션yes (apply_to = collection인 경우)
translationsobjectno
show_countdownboolean true falseno
  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: {...}
}
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;

성공 응답 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"
}
}

유효성 검사

필드규칙가능한 오류 메시지
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.

도움이 되었나요?

문제 신고