{
  "openapi": "3.0.3",
  "info": {
    "title": "SKU 工作台 ERP API",
    "version": "1.1.0",
    "description": "服务端接入接口。每个成功 SKU 记 1 点应结，失败/高权重/无效不计费；不操作 ERP 客户钱包。总后台统一登记已结算点数。仅支持查询同步，不含回调。每日北京时间 01:00 划分批次，终态 SKU 明细保留 48 小时；幂等凭据与累计结算统计持续保留。所有示例均为格式说明，请勿向正式环境提交示例 SKU。"
  },
  "servers": [
    {
      "url": "https://api.ozonkaqiusha.com/api/v1",
      "description": "正式 API；由 ERP 服务器调用"
    }
  ],
  "security": [
    {
      "ErpBearer": []
    }
  ],
  "tags": [
    {
      "name": "提交与结果"
    },
    {
      "name": "结算账户"
    }
  ],
  "paths": {
    "/account": {
      "get": {
        "tags": [
          "结算账户"
        ],
        "operationId": "getErpAccount",
        "summary": "查询 ERP 点数结算统计",
        "description": "返回累计接受/成功/失败、应结、已结、未结和结余。ERP 只能查询，结算金额由总后台登记。统计不因 48 小时明细清理而丢失。",
        "responses": {
          "200": {
            "description": "结算账户",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      }
    },
    "/submissions": {
      "post": {
        "tags": [
          "提交与结果"
        ],
        "operationId": "submitErpSkus",
        "summary": "幂等提交 1–500 条 SKU",
        "description": "请求头 Idempotency-Key 必须为 UUID。ERP 订单号也唯一；相同订单号或幂等键与同一内容重放返回原订单当前状态。内容中的 items 顺序不影响幂等比较。不同内容返回 409，过期订单重放返回 410。当前 ERP 已处理中 SKU 返回 duplicate，不新建任务、不另计费、不产生退款。",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "先持久化，再发起请求。网络重试必须沿用相同 UUID。"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitRequest"
              },
              "example": {
                "externalOrderId": "ERP-20261011-001",
                "items": [
                  {
                    "externalItemId": "line-001",
                    "sku": "1234567890"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "新订单已接受，包括逐项 duplicate 结果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitResponse"
                }
              }
            }
          },
          "200": {
            "description": "相同请求重放，replayed=true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubmitResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "410": {
            "$ref": "#/components/responses/410"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      },
      "get": {
        "tags": [
          "提交与结果"
        ],
        "operationId": "listErpSubmissions",
        "summary": "查询当前 ERP 的订单摘要",
        "description": "按创建时间倒序。列表不包含 items；用详情接口获取明细。过期订单保留最小凭据，status=expired。分页期间可能有新订单进入，调用方以订单 ID 去重。",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "externalOrderId",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$"
            },
            "description": "精确匹配 ERP 订单号，可用于提交响应丢失后的订单定位。"
          }
        ],
        "responses": {
          "200": {
            "description": "订单摘要分页",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      }
    },
    "/submissions/{submissionId}/cancel": {
      "post": {
        "tags": [
          "提交与结果"
        ],
        "operationId": "cancelErpSubmission",
        "summary": "批次截止前幂等撤回当前 ERP 的任务",
        "description": "使用原 API 密钥，无需重置。请求头必须带独立持久化的 Idempotency-Key UUID。{} 撤回此订单所有被接受任务并跳过 duplicate；externalItemIds 指定 1–500 个明细号。所有指定任务先整体校验：仅 pending/paused/onsale/unknown 且服务器当前时间严格早于该任务 batchCutoffAt 可新增撤回。已 withdrawn 为无操作，已终态/已截止/显式 duplicate 返回 409，整次操作不部分撤回。只能撤回当前订单、当前 ERP 所有的任务。撤回后 status=withdrawn、billablePoints=0、refundPoints=1、resultId 版本递增，ERP 对自身原预扣记录按版本差额仅释放一次。本接口不直接操作第三方客户钱包。新幂等键再次撤回已 withdrawn 项返回 200、cancelledCount=0；原键与原内容重试在截止后仍返回原操作计数及当前订单，replayed=true。相同键用于不同订单或明细列表返回 409。全部明细过期返回 410。",
        "parameters": [
          {
            "name": "submissionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ERPORD-[A-F0-9]{10}$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "取消操作自己的 UUID，与提交操作区分；超时重试保持同一订单、UUID 和内容。"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelRequest"
              },
              "examples": {
                "all": {
                  "summary": "撤回本订单全部被接受任务",
                  "value": {}
                },
                "selected": {
                  "summary": "撤回指定明细",
                  "value": {
                    "externalItemIds": [
                      "line-001",
                      "line-002"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "撤回成功、已撤回无操作或相同取消操作重放",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "409": {
            "$ref": "#/components/responses/409"
          },
          "410": {
            "$ref": "#/components/responses/410"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      }
    },
    "/submissions/{submissionId}": {
      "get": {
        "tags": [
          "提交与结果"
        ],
        "operationId": "getErpSubmission",
        "summary": "查询订单全部 SKU 结果",
        "description": "只能查询当前 ERP 的订单。resultId 是 taskId:版本的状态快照标识。ERP 应在数据库事务内比较版本并使用 billablePoints/refundPoints 新旧目标差额记账，重复或旧版本不得再次入账。failed→invalid 的退点差额为 0；success→highweight 的应结差额为 -1、退点差额为 +1。部分过期的明细只返回 externalItemId/status/expiredAt；不要将缺失金额视为 0。全部明细过期返回 410。",
        "parameters": [
          {
            "name": "submissionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ERPORD-[A-F0-9]{10}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "订单详情与当前结果快照",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetailResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "410": {
            "$ref": "#/components/responses/410"
          },
          "429": {
            "$ref": "#/components/responses/429"
          },
          "500": {
            "$ref": "#/components/responses/500"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ErpBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ERP_<opaque-token>",
        "description": "总后台生成的密钥。仅保存在 ERP 服务器；重置立即失效旧密钥。"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "人类可读错误；通用请求校验错误可能仅有此字段。"
          },
          "code": {
            "type": "string",
            "description": "可选机器错误码。"
          }
        },
        "required": [
          "error"
        ]
      },
      "SubmitItem": {
        "type": "object",
        "properties": {
          "externalItemId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$"
          },
          "sku": {
            "type": "string",
            "pattern": "^[0-9]{8,12}$",
            "example": "1234567890"
          }
        },
        "required": [
          "externalItemId",
          "sku"
        ]
      },
      "SubmitRequest": {
        "type": "object",
        "properties": {
          "externalOrderId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$",
            "description": "ERP 永久唯一的业务订单号；同号只能对应同一内容。"
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "items": {
              "$ref": "#/components/schemas/SubmitItem"
            }
          }
        },
        "required": [
          "externalOrderId",
          "items"
        ]
      },
      "DuplicateOf": {
        "type": "object",
        "properties": {
          "taskId": {
            "type": "string",
            "pattern": "^TSK-[A-F0-9]{10}$"
          },
          "submissionId": {
            "type": "string",
            "pattern": "^ERPORD-[A-F0-9]{10}$"
          },
          "externalOrderId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$"
          },
          "externalItemId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$"
          }
        },
        "required": [
          "taskId",
          "submissionId",
          "externalOrderId",
          "externalItemId"
        ]
      },
      "AcceptedItem": {
        "type": "object",
        "properties": {
          "externalItemId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$"
          },
          "sku": {
            "type": "string",
            "pattern": "^[0-9]{8,12}$",
            "example": "1234567890"
          },
          "taskId": {
            "type": "string",
            "pattern": "^TSK-[A-F0-9]{10}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "paused",
              "onsale",
              "unknown",
              "success",
              "failed",
              "highweight",
              "invalid",
              "withdrawn"
            ]
          },
          "resultId": {
            "type": "string",
            "pattern": "^TSK-[A-F0-9]{10}:[0-9]+$",
            "description": "任务 ID:单调递增版本。状态变化时版本递增；它是快照标识，不是直接入账指令。"
          },
          "billablePoints": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "当前目标应结点数，仅 success 为 1。结果更正时可以从 1 变为 0。"
          },
          "refundPoints": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "当前不计费目标点数，failed/highweight/invalid/withdrawn 为 1。ERP 按自身预收费规则对新旧目标差额进行退点或冲正，不能每次累加；撤回不直接修改第三方客户钱包。"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "processingBatchId": {
            "type": "string",
            "format": "date"
          },
          "batchCutoffAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "externalItemId",
          "sku",
          "taskId",
          "status",
          "resultId",
          "billablePoints",
          "refundPoints",
          "updatedAt",
          "processingBatchId",
          "batchCutoffAt"
        ]
      },
      "DuplicateItem": {
        "type": "object",
        "properties": {
          "externalItemId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$"
          },
          "sku": {
            "type": "string",
            "pattern": "^[0-9]{8,12}$",
            "example": "1234567890"
          },
          "taskId": {
            "type": "string",
            "nullable": true,
            "enum": [
              null
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "duplicate"
            ]
          },
          "resultId": {
            "type": "string"
          },
          "billablePoints": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "refundPoints": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "duplicateOf": {
            "$ref": "#/components/schemas/DuplicateOf"
          }
        },
        "required": [
          "externalItemId",
          "sku",
          "taskId",
          "status",
          "resultId",
          "billablePoints",
          "refundPoints",
          "updatedAt",
          "duplicateOf"
        ],
        "description": "当前 ERP 正在处理的重复 SKU 未建立新任务。它不是失败项，不触发接口退点。"
      },
      "ExpiredItem": {
        "type": "object",
        "properties": {
          "externalItemId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "expired"
            ]
          },
          "expiredAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "externalItemId",
          "status",
          "expiredAt"
        ],
        "description": "只保留明细号与到期凭据。缺失金额不表示金额清零；保留 ERP 本地已保存结果。"
      },
      "ItemResult": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/AcceptedItem"
          },
          {
            "$ref": "#/components/schemas/DuplicateItem"
          },
          {
            "$ref": "#/components/schemas/ExpiredItem"
          }
        ]
      },
      "SubmissionSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ERPORD-[A-F0-9]{10}$"
          },
          "externalOrderId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$"
          },
          "processingBatchId": {
            "type": "string",
            "format": "date"
          },
          "batchCutoffAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "processing",
              "completed"
            ]
          },
          "acceptedCount": {
            "type": "integer",
            "minimum": 0
          },
          "duplicateCount": {
            "type": "integer",
            "minimum": 0
          },
          "processingCount": {
            "type": "integer",
            "minimum": 0
          },
          "successCount": {
            "type": "integer",
            "minimum": 0
          },
          "failedCount": {
            "type": "integer",
            "minimum": 0,
            "description": "失败、高权重、无效数量，不含撤回。"
          },
          "withdrawnCount": {
            "type": "integer",
            "minimum": 0,
            "description": "当前仍在保留期内的撤回明细数量，与 failedCount 分开。"
          }
        },
        "required": [
          "id",
          "externalOrderId",
          "processingBatchId",
          "batchCutoffAt",
          "createdAt",
          "updatedAt",
          "status",
          "acceptedCount",
          "duplicateCount",
          "processingCount",
          "successCount",
          "failedCount",
          "withdrawnCount"
        ]
      },
      "Submission": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SubmissionSummary"
          },
          {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ItemResult"
                }
              }
            },
            "required": [
              "items"
            ]
          }
        ]
      },
      "ExpiredSubmission": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ERPORD-[A-F0-9]{10}$"
          },
          "externalOrderId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "expired"
            ]
          },
          "expiredAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "acceptedCount": {
            "type": "integer",
            "minimum": 0
          },
          "duplicateCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "externalOrderId",
          "status",
          "expiredAt",
          "createdAt",
          "acceptedCount",
          "duplicateCount"
        ]
      },
      "SubmitResponse": {
        "type": "object",
        "properties": {
          "submission": {
            "$ref": "#/components/schemas/Submission"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "submission",
          "replayed"
        ]
      },
      "DetailResponse": {
        "type": "object",
        "properties": {
          "submission": {
            "$ref": "#/components/schemas/Submission"
          }
        },
        "required": [
          "submission"
        ]
      },
      "CancelRequest": {
        "type": "object",
        "properties": {
          "externalItemIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 500,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]{0,99}$"
            },
            "description": "指定当前订单中被接受的明细号。省略时选择当前订单全部被接受任务，跳过 duplicate；不可用 SKU 或其他订单明细号代替。"
          }
        },
        "description": "JSON 对象。{} 表示撤回当前订单全部被接受任务；指定列表则先整体校验，全部可撤回才修改。"
      },
      "CancelResponse": {
        "type": "object",
        "properties": {
          "submission": {
            "$ref": "#/components/schemas/Submission"
          },
          "cancelledCount": {
            "type": "integer",
            "minimum": 0,
            "description": "本次操作实际新增撤回数量；幂等重放保留原操作数量。"
          },
          "alreadyCancelledCount": {
            "type": "integer",
            "minimum": 0,
            "description": "本次操作请求时已撤回的数量。"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "submission",
          "cancelledCount",
          "alreadyCancelledCount",
          "replayed"
        ]
      },
      "ListResponse": {
        "type": "object",
        "properties": {
          "submissions": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/SubmissionSummary"
                },
                {
                  "$ref": "#/components/schemas/ExpiredSubmission"
                }
              ]
            }
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "submissions",
          "page",
          "limit",
          "total"
        ]
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^ERP-[A-F0-9]{10}$"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "keyPrefix": {
            "type": "string",
            "nullable": true
          },
          "keyCreatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "acceptedCount": {
            "type": "integer",
            "minimum": 0
          },
          "processingCount": {
            "type": "integer",
            "minimum": 0
          },
          "successCount": {
            "type": "integer",
            "minimum": 0
          },
          "failedCount": {
            "type": "integer",
            "minimum": 0
          },
          "withdrawnCount": {
            "type": "integer",
            "minimum": 0,
            "description": "累计撤回数量，与 failedCount 分开；不因明细过期而归零。"
          },
          "billablePoints": {
            "type": "number",
            "minimum": 0,
            "description": "累计应结点数，仅成功任务计费，更正结果可回减。"
          },
          "settledPoints": {
            "type": "number",
            "minimum": 0,
            "description": "总后台登记的累计已结算点数。ERP 无修改接口。"
          },
          "outstandingPoints": {
            "type": "number",
            "minimum": 0,
            "description": "max(billablePoints - settledPoints, 0)。"
          },
          "creditPoints": {
            "type": "number",
            "minimum": 0,
            "description": "max(settledPoints - billablePoints, 0)，用于抵扣后续应结。"
          }
        },
        "required": [
          "id",
          "name",
          "enabled",
          "keyPrefix",
          "keyCreatedAt",
          "createdAt",
          "acceptedCount",
          "processingCount",
          "successCount",
          "failedCount",
          "withdrawnCount",
          "billablePoints",
          "settledPoints",
          "outstandingPoints",
          "creditPoints"
        ]
      },
      "AccountResponse": {
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "billingMode": {
            "type": "string",
            "enum": [
              "postpaid"
            ]
          },
          "unitCost": {
            "type": "integer",
            "enum": [
              1
            ]
          }
        },
        "required": [
          "account",
          "billingMode",
          "unitCost"
        ]
      }
    },
    "responses": {
      "400": {
        "description": "请求参数无效。INVALID_ITEMS / INVALID_SKU / INVALID_EXTERNAL_ID / DUPLICATE_ITEM_ID / INVALID_PAGE / INVALID_IDEMPOTENCY_KEY；通用错误可能没有 code。",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "401": {
        "description": "INVALID_API_KEY：密钥无效、已重置或 ERP 已停用。",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "403": {
        "description": "SERVER_TO_SERVER_ONLY 或域名入口限制：仅供 ERP 服务器调用，不开放浏览器跨站访问。",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "404": {
        "description": "NOT_FOUND / ITEM_NOT_FOUND：接口、当前 ERP 的订单或指定明细不存在；不透露其他 ERP 的订单。",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "409": {
        "description": "IDEMPOTENCY_CONFLICT：订单号或幂等键已对应不同内容；CANCELLATION_NOT_ALLOWED：取消请求含已截止、已完成、失败、duplicate 或不可撤回任务。整次取消不修改任何明细。",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "410": {
        "description": "RESULT_EXPIRED：全部结果已超过 48 小时保留期。使用本地保存结果，不要将旧订单换号重发。",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "429": {
        "description": "RATE_LIMITED：每密钥每分钟最多 60 次请求，请至少等待 60 秒。",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "500": {
        "description": "暂时服务故障。可退避重试；POST 必须保留原订单号、幂等键和内容。",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
