开发文档
Auchan Portugal API 参考:6 个操作
Auchan Portugal API 参考:6 个操作各自的输入、默认值与边界,以及返回数据的内容。
另见: Auchan Portugal API:分类、搜索、商品与门店数据概览与价格 · Auchan Portugal API 指南:搜索与门店
本页内容
auchan-pt-categories:嵌套分类条目包含什么
categories 行自己的 children 内部,每个条目都在下一层重复相同的结构,带有自己的 category_id、name、url 与 depth。即使是三层之下找到的子分类,也可以用这种方式读到,每一层嵌套的 children 列表都以同样的方式带有更多条目,不需要逐层单独调用。depth 从树的顶层开始计数,这与条目自身的 name 不同。
parent 说明发送 body.category 时它被解析到的那个条目。无法识别的 body.category 值会被直接拒绝,而不会返回一棵空树;cgid、category_id 与 parent 都可以作为它的替代名称。
本节涉及的字段(2)
auchan-pt-categories, body.category
auchan-pt-category、auchan-pt-promotions 与 auchan-pt-search:如何组合筛选条件
body.brand、body.nutriscore、body.organic 与 body.national_product 可以在对 auchan-pt-category 或 auchan-pt-promotions 的同一次调用中一起组合使用。这四个输入在 auchan-pt-search 上同样可以组合使用,共同缩小同一个结果集,而不需要逐个筛选条件分别调用一次。body.nutriscore 只接受 A 到 E 这五个字母,其他取值会被直接拒绝,而不是被忽略。
body.organic 与 body.national_product 都接受一个普通的布尔值,true 分别只保留 Auchan 自己的 'Biológico' 系列或标注为 'Produto Nacional' 的商品,biologico 与 produto_nacional 可以分别作为二者的替代名称。body.brand 需要与 Auchan 印刷的大写品牌名完全一致,例如 MIMOSA 或 NESTLÉ,marca 可以作为它的替代名称。每个 results 行自己的 labels 列表携带该行自身的标签文字,与调用本身用来筛选的这四个条件是分开的。
body.min_price 与 body.max_price 只接受整数欧元,带小数点的数值会被直接拒绝,不会先四舍五入再接受。body.page 与 body.per_page 一旦超出各自文档规定的范围,就会被直接拒绝,而不会被截断到边界值内。
本节涉及的字段(11)
auchan-pt-category, auchan-pt-promotions, auchan-pt-search, body.brand, body.nutriscore, body.organic, body.national_product, body.min_price, body.max_price, body.page, body.per_page
auchan-pt-category、auchan-pt-promotions 与 auchan-pt-search:必填项有何不同
body.query 只在 auchan-pt-search 上是必填项;auchan-pt-category 与 auchan-pt-promotions 都没有任何必填输入,因此即使把其他字段都省略,调用也会得到回应而不是被拒绝,并回落到 body.sort 的默认值 popular。auchan-pt-category 自己的 body.category 与 auchan-pt-search 的 body.query 角色正好相反:它是可选项而非必填项,并且要与 auchan-pt-categories 给出的已知分类 id 匹配,而不是自由文本。q、keyword、search 与 term 都可以作为 body.query 的替代名称。
auchan-pt-search 与 auchan-pt-promotions 都接受这些替代名称。cgid 与 category_id 在这三个操作上都可以同样代替 body.category。这六个操作的必填输入分为三种不同形式。
auchan-pt-search 的 body.query 是自由文本,auchan-pt-product 的 body.product_id 则是一个已知标识符。auchan-pt-stores 的 body.latitude 与 body.longitude 是一对坐标;auchan-pt-categories、auchan-pt-category 与 auchan-pt-promotions 则完全不需要这些必填项。
本节涉及的字段(11)
auchan-pt-search, auchan-pt-category, auchan-pt-promotions, auchan-pt-categories, auchan-pt-product, auchan-pt-stores, body.query, body.category, body.product_id, body.latitude, body.longitude
auchan-pt-product:只有这个操作返回的字段
auchan-pt-product 返回的 product 对象由它自己的 product_id、name 与 brand 标识。short_description 给出一段简短说明,而 description 给出同一商品更完整的文字。price 是当前价格,price_valid_until 说明它的有效期限,而 regular_price 与 recommended_retail_price 分别给出划线促销价与 Auchan 自己的建议零售价,即 PVPR,方式与搜索行自身的字段一致,单位是 currency 所给出的币种。
unit_price、unit_price_unit 与 unit_price_text 给出与搜索行字段相同的按公斤或按升计算的单价。category_id 与 category_name 说明商品所在的分类,url 给出它自己的页面地址,images 列出图片链接。无论是否发送了 body.store_id,响应都会随 product 一起返回一个 store 对象,说明 price 及其他价格字段是从哪家门店读取的。
省略 body.store_id 则返回线上门店自己的价格,而不是任何实体门店的价格。rating 给出商品自身的综合评分,category_id 与 category_name 一起把它放进 auchan-pt-categories 所返回的同一棵分类树中,因此这里读到的 category_id 可以直接发送回那个操作,或发送给 auchan-pt-category。
本节涉及的字段(5)
auchan-pt-product, auchan-pt-categories, auchan-pt-category, body.product_id, body.store_id
auchan-pt-stores:如何读取门店条目与半径
auchan-pt-stores 每条记录自己的 latitude 与 longitude 给出该门店固定的坐标,这与调用所用于搜索的 body.latitude、body.longitude 这个点不同;distance 与 distance_unit 给出两者之间的差距。type 说明这是哪一类门店,phone 与 email 则是该门店自己的联系方式。total 统计 body.radius_km 范围内搜索到的门店总数。
这个输入只接受 15、30、50、100 或 300,其他距离值会被直接拒绝,而不会被四舍五入到最接近的选项。调大 body.radius_km 只会让搜索返回更多门店,不会改变已经在较小范围内的某条记录的 distance 或其他字段。postal_code、city 与 locality 把同一个地址归入葡萄牙自己的邮政与行政区划之中,这与单纯的 address 这一行文字是分开的。
本节涉及的字段(4)
auchan-pt-stores, body.latitude, body.longitude, body.radius_km
Auchan Portugal API 如何让门店标识连接 auchan-pt-stores 与 auchan-pt-product
auchan-pt-stores 自己的 store_id 与 auchan-pt-product 的 body.store_id 接受的是同一个值,因此通过前者找到的门店可以直接用于后者,不需要重新格式化。auchan-pt-category、auchan-pt-promotions 与 auchan-pt-search 各自返回自己的 store 对象,带有 store_defaulted 与 resolved_from,说明的是这三个操作自己解析出的门店,而不是调用方主动选择的门店;auchan-pt-product 自己的 store 对象则只是简单说明 body.store_id 发送的是哪家门店,省略时则是线上门店。auchan-pt-category、auchan-pt-promotions 与 auchan-pt-search 都不接受 body.store_id 本身,因此它们自己行里的价格始终来自 resolved_from 所说明的那家门店,而不是直接选定的门店。
本节涉及的字段(6)
auchan-pt-stores, auchan-pt-product, auchan-pt-category, auchan-pt-promotions, auchan-pt-search, body.store_id
{
"body": {
"product_id": "3010403",
"store_id": "B85"
}
}{
"body": {
"query": "leite",
"min_price": 1,
"max_price": 3,
"sort": "price_asc"
}
}操作
公共网关操作统一使用 POST /api/v1/{project}/{action}。
使用 JSON 对象,按文档将参数放入 path、query、headers 和 body,省略未使用的位置。input.headers 是供操作使用的 JSON 数据,不是浏览器请求头。请勿在此填写凭证。按文档保留 body 的数组、标量或 null;省略与 null 含义不同。
分类
POST /api/v1/auchan-pt/auchan-pt-categories
返回 Auchan Portugal 的分类树,每个条目都有自己的 id、名称、链接与嵌套的子分类。
输入字段
| 字段 | 类型 | 是否必填 | 允许的值 | 范围限制 |
|---|---|---|---|---|
body.category | string | 可选 | — | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/auchan-pt/auchan-pt-categories' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"category":"alimentacao-"}}'响应字段
parenttotal_categoriescategories[]category_idnameurlpathdepthchildren[]
分类浏览
POST /api/v1/auchan-pt/auchan-pt-category
按分类分页列出 Auchan Portugal 的商品,并提供价格、Nutri-Score、有机与本土商品筛选。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.brand | string | 可选 | — | — | — |
body.category | string | 可选 | — | — | — |
body.max_price | integer | 可选 | — | — | 0–9007199254740991 |
body.min_price | integer | 可选 | — | — | 0–9007199254740991 |
body.national_product | boolean | 可选 | — | — | — |
body.nutriscore | string | 可选 | — | "A""B""C""D""E" | — |
body.organic | boolean | 可选 | — | — | — |
body.page | integer | 可选 | 1 | — | 1–2000 |
body.per_page | integer | 可选 | 48 | — | 1–100 |
body.sort | string | 可选 | "popular" | "popular""relevance""best_seller""price_asc""price_desc""name_asc""name_desc" | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/auchan-pt/auchan-pt-category' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"category":"produtos-lacteos"}}'响应字段
storestore_idstore_namestore_defaultedsourcing_codes[]resolved_from
querycategoryfilterssorttotaltotal_is_exacttotal_notepageper_pagehas_morereturnedresults[]rankproduct_idnamebrandpriceprice_unitprice_textregular_pricerecommended_retail_pricerecommended_retail_price_textdiscount_vs_recommended_textcurrencyon_offerpromotion_windowtextfromto
unit_priceunit_price_unitunit_price_textmin_quantity_textmin_quantity_pricelabels[]category_pathanalytics_priceanalytics_discountimageurl
商品详情
POST /api/v1/auchan-pt/auchan-pt-product
按商品 id 返回 Auchan Portugal 单个商品的价格、促销、下单限制、配料与营养信息。
输入字段
| 字段 | 类型 | 是否必填 | 允许的值 | 范围限制 |
|---|---|---|---|---|
body.product_id | string | 必填 | — | — |
body.store_id | string | 可选 | — | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/auchan-pt/auchan-pt-product' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"product_id":"3010403"}}'特惠商品
POST /api/v1/auchan-pt/auchan-pt-promotions
返回 Auchan Portugal 线上门店当前正在促销的商品,可按关键词、分类或品牌进一步筛选。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.brand | string | 可选 | — | — | — |
body.category | string | 可选 | — | — | — |
body.max_price | integer | 可选 | — | — | 0–9007199254740991 |
body.min_price | integer | 可选 | — | — | 0–9007199254740991 |
body.national_product | boolean | 可选 | — | — | — |
body.nutriscore | string | 可选 | — | "A""B""C""D""E" | — |
body.organic | boolean | 可选 | — | — | — |
body.page | integer | 可选 | 1 | — | 1–2000 |
body.per_page | integer | 可选 | 48 | — | 1–100 |
body.query | string | 可选 | — | — | — |
body.sort | string | 可选 | "popular" | "popular""relevance""best_seller""price_asc""price_desc""name_asc""name_desc" | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/auchan-pt/auchan-pt-promotions' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"query":"leite"}}'响应字段
storestore_idstore_namestore_defaultedsourcing_codes[]resolved_from
querycategoryfilterssorttotaltotal_is_exacttotal_notepageper_pagehas_morereturnedresults[]rankproduct_idnamebrandpriceprice_unitprice_textregular_pricerecommended_retail_pricerecommended_retail_price_textdiscount_vs_recommended_textcurrencyon_offerpromotion_windowtextfromto
unit_priceunit_price_unitunit_price_textmin_quantity_textmin_quantity_pricelabels[]category_pathanalytics_priceanalytics_discountimageurl
搜索
POST /api/v1/auchan-pt/auchan-pt-search
按关键词搜索 Auchan Portugal 的线上商品,筛选方式与分类浏览相同。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.query | string | 必填 | — | — | — |
body.brand | string | 可选 | — | — | — |
body.category | string | 可选 | — | — | — |
body.max_price | integer | 可选 | — | — | 0–9007199254740991 |
body.min_price | integer | 可选 | — | — | 0–9007199254740991 |
body.national_product | boolean | 可选 | — | — | — |
body.nutriscore | string | 可选 | — | "A""B""C""D""E" | — |
body.organic | boolean | 可选 | — | — | — |
body.page | integer | 可选 | 1 | — | 1–2000 |
body.per_page | integer | 可选 | 48 | — | 1–100 |
body.sort | string | 可选 | "popular" | "popular""relevance""best_seller""price_asc""price_desc""name_asc""name_desc" | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/auchan-pt/auchan-pt-search' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"query":"leite"}}'响应字段
storestore_idstore_namestore_defaultedsourcing_codes[]resolved_from
querycategoryfilterssorttotaltotal_is_exacttotal_notepageper_pagehas_morereturnedresults[]rankproduct_idnamebrandpriceprice_unitprice_textregular_pricerecommended_retail_pricerecommended_retail_price_textdiscount_vs_recommended_textcurrencyon_offerpromotion_windowtextfromto
unit_priceunit_price_unitunit_price_textmin_quantity_textmin_quantity_pricelabels[]category_pathanalytics_priceanalytics_discountimageurl
门店查询
POST /api/v1/auchan-pt/auchan-pt-stores
返回某个位置附近的 Auchan Portugal 门店,包含距离、配送方式与营业时间。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.latitude | number | 必填 | — | — | — |
body.longitude | number | 必填 | — | — | — |
body.radius_km | string | 可选 | "30" | "15""30""50""100""300" | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/auchan-pt/auchan-pt-stores' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"latitude":38.75,"longitude":-9.15}}'响应字段
latitudelongituderadius_kmtotalstores[]store_idnametypeaddresspostal_codecitylocalitylatitudelongitudedistancedistance_unitphoneemaildelivery_typesactive_delivery_typesopening_hoursopen_date
调用方式
- 使用
POST /api/v1/auchan-pt/<action>,并携带x-api-key、Content-Type: application/json和必需的Idempotency-Key。 - 调用成功时返回
ok: true:data是操作的结果,meta.requestId标识已记录的请求,meta.chargedCreditUnits是实际扣费金额。否则ok为false,error.code说明原因;请读取ok和error.code,不要只依赖 HTTP 状态码。每个网关响应都带有供支持使用的请求 ID:meta.requestId;没有meta的响应(如受理前被拒绝)则为顶层requestId。 - 只有调用成功才按标价扣费。失败不扣费;结果无法确认时,最多 900 秒后释放,不扣费。
- 请求完成后,以同一个 Idempotency-Key 重复发送相同请求,24 小时内返回已保存的响应,不会再次扣费。
网关调用参考: