POST/api/v4/locations/archive

归档地点

安排在当前计费周期结束时归档一个或多个地点。

需要 API 密钥。请求头格式和密钥轮换请参阅身份验证。

参数

请求体

名称类型必填描述
input.locationIdsarray of strings必填Base64-encoded location node IDs to archive.
input.clientMutationIdstring可选Optional correlation token returned unchanged in the response. It does not prevent duplicate writes: the server does not detect repeated calls that reuse the same value.

请求示例

可直接粘贴的请求体。请将占位 ID 和值替换为您自己的。

Request body
{  "input": {    "locationIds": [      "TG9jYXRpb246MTgwMDI4OQ==",      "TG9jYXRpb246MTgwMDI5MA=="    ]  }}

响应

200Locations scheduled for archival. Returns per-location status.
Response
{  "data": {    "archiveLocations": {      "clientMutationId": null,      "bulkEditTaskId": null,      "errors": null,      "success": null,      "result": [        {          "locationId": "TG9jYXRpb246MTgwMDI4OQ==",          "status": "ARCHIVE_SCHEDULED",          "success": true,          "errors": null        },        {          "locationId": "TG9jYXRpb246MTgwMDI5MA==",          "status": "ARCHIVE_SCHEDULED",          "success": true,          "errors": null        }      ]    }  }}
400Bad request, invalid or empty `locationIds`.
401Unauthenticated, missing or invalid API key.
403Forbidden, insufficient permissions to archive.

归档一个或多个地点。归档不会立即生效:每个地点都会进入 ARCHIVE_SCHEDULED 状态,并保持在线,直到当前计费周期结束。生成下一张账单时,地点将被完全归档,并停止对其计费。

使用场景:在计费周期结束时停用已关闭的分店。 当特许经营企业永久关闭多家门店时,在一次调用中提交这些地点的 base64 ID,以便在生成下一张账单时停止计费,而不是在计费周期中途停止。检查响应中的 result[]:每个条目都会报告对应地点的 status 和 success 标志,因此部分失败(一个无效 ID)不会阻止批次中的其余地点得到处理。

响应中的状态值:

  • ARCHIVE_SCHEDULED:已加入队列,将在计费周期结束时归档
  • ARCHIVED:已归档

撤销:要在计费周期结束前撤销尚未执行的归档计划,请使用相同的 ID 调用取消计划归档。已归档的地点在重新激活之前无法更新。

Request
curl -X POST 'https://listingsapi.com/api/v4/locations/archive' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "input": {      "locationIds": [        "TG9jYXRpb246MTgwMDI4OQ==",        "TG9jYXRpb246MTgwMDI5MA=="      ]    }  }'