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

[GET] 列出优惠

AI 概览

介绍以分页和关键词搜索方式列出店铺预购优惠的端点。

  • 调用 GET /shop-api/pre-order/list,可选择附带 page 和 keyword;速率限制为 throttle:30,1。
  • keyword 按优惠名称或产品名称搜索;结果每页显示 50 个优惠,按 updated_at 从新到旧排序。
  • 每个优惠包含日期、倒计时、apply_to、库存条件、配送、继续销售和付款折扣字段。
  • 当 apply_to = product 时,products 仅包含第一个产品的示例;如需完整列表,请使用优惠详情端点。

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

* 身份验证

必需 Authorization

限制 throttle:30,1

请求

分页检索店铺的到货提醒 (BIS) 订阅列表。

端点 GET - /shop-api/pre-order/list?page=1

参数 类型 是否必需
page number no
keyword string no
GET /shop-api/pre-order/list?page=1 HTTP/1.1
Host: preorder.globo.io
Authorization: ************
const myHeaders = new Headers();
myHeaders.append("Authorization", "************");
const requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
fetch("https://preorder.globo.io/shop-api/pre-order/list?page=1", 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/pre-order/list?page=1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: ************'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

成功响应 200

{
"success": true,
"data": [
{
"id": 123,
"offer_name": "Summer Pre-order",
"start_date": "2026-08-01 00:00:00",
"end_date": "2026-09-30 23:59:59",
"countdown_before_preorder_start": true,
"countdown_before_preorder_end": false,
"apply_to": "product",
"preorder_condition_inventory": "oos",
"fulfillment_status": "ON_HOLD",
"fulfillment_shipping_date": "2026-10-15",
"turn_on_continue_selling_when_preorder_start": true,
"turn_off_continue_selling_when_preorder_end": true,
"status": 1,
"products": [
{
"product_id": 7890123456789,
"variant_id": 4567890123456,
"limit": 100
}
],
"full_payment_discount_type": "percentage",
"full_payment_discount_value": 10,
"partial_payment_value": 30,
"partial_payment_value_type": "percentage",
"partial_payment_discount_value": 0,
"partial_payment_discount_type": "percentage",
"partial_payment_remaining_balance_charge_date": "2026-10-01"
}
],
"pagination": {
"total": 120,
"per_page": 50,
"current_page": 1,
"last_page": 3,
"from": 1,
"to": 50
}
}

关于 apply_to 结构的说明:

  • product → 响应包含 products[]
  • collection → 响应包含 collection_id(以及可选的 collection_name)
  • all → 既不包含 products,也不包含 collection_id

当 apply_to = product 时,列表接口的特有行为:
products 仅包含一个示例的第一个产品(不是完整的产品列表)。如需完整的产品详情,请使用 GET /shop-api/pre-order/get/{id} 或产品列表 API。

响应键和字段

顶层

键 类型 说明
success boolean 请求成功时为 true
data array 优惠对象列表(按 updated_at 从新到旧)
pagination object 分页元数据

pagination

键 类型 说明
total integer 符合筛选条件的优惠总数
per_page integer 始终为 50
current_page integer 当前页
last_page integer 最后一页
from integer | null 此页第一项的索引(为空时为 null)
to integer | null 此页最后一项的索引(为空时为 null)

优惠对象(data[])

字段 类型 说明
id integer 优惠(配置)ID
offer_name string 优惠显示名称
start_date string | null 预购开始日期时间
end_date string | null 预购结束日期时间;无结束日期时为 null
countdown_before_preorder_start boolean 是否启用开始前倒计时
countdown_before_preorder_end boolean 是否启用结束前倒计时
apply_to string 目标范围:product、collection 或 all
preorder_condition_inventory string 库存开始条件(例如 now、oos)
fulfillment_status string | null 订单配送模式:ON_HOLD、UNFULFILLMENT、SCHEDULED
fulfillment_shipping_date string 按确切日期安排配送时出现
fulfillment_after_checkout mixed 按结账后的时间安排配送时出现
turn_on_continue_selling_when_preorder_start boolean 优惠开始时自动启用缺货继续销售
turn_off_continue_selling_when_preorder_end boolean 优惠结束时自动禁用缺货继续销售
status integer | null 优惠状态(通过 API 创建时 1 = 活跃)
products array 仅当 apply_to = product 时出现
collection_id integer 仅当 apply_to = collection 时出现
collection_name string 可选;仅当优惠中有该信息时出现
full_payment_discount_type string 全额付款折扣类型(默认 percentage)
full_payment_discount_value number 全额付款折扣值
partial_payment_value number | null 定金 / 部分付款金额(仅在启用部分付款时)
partial_payment_value_type string 部分付款金额类型(例如 percentage)
partial_payment_discount_value number 部分付款的折扣
partial_payment_discount_type string 部分付款折扣类型
partial_payment_remaining_balance_charge_date string | null 尾款扣款日期(若为确切时间触发)

products[] 项(当 apply_to = product 时)

字段 类型 说明
product_id integer Shopify 产品 ID
variant_id integer Shopify 多属性 ID
limit integer | null 该多属性的预购数量上限;null = 不限

失败响应

出现问题 — 200

{
"success": false,
"message": "Something went wrong"
}

空结果

{
"success": true,
"data": [],
"pagination": {
"total": 0,
"per_page": 50,
"current_page": 1,
"last_page": 1,
"from": null,
"to": null
}
}

此页面对您有帮助吗?

报告问题