返回商城

AI 与 MCP 接入说明

服务卡片 · 工具与字段 JSON · 纯文本说明

# 小钉快跑商城 AI 接入

MCP Endpoint: https://ai.xdkp8.com/mcp
Transport: Streamable HTTP(无状态)

AI 查询本商城时优先使用 MCP 工具,避免逐个抓取接口。客户端需要支持并允许连接 MCP;HTML、llms.txt 和实验性的 ai-catalog/server-card 仅帮助发现,不保证自动接入。

登录支持账号密码工具,以及官网 OAuth 授权码 + PKCE S256。推荐浏览器官网授权,由客户端保存 MCP Token。密码直登参数为原始密码,HTTPS 保护公网传输;AI/客户端可能读取这些参数。密码不应写入日志或持久保存。官网 Token 不能调用 MCP,MCP Token 也不能调用普通商城 API。

账号密码直登 Token 默认闲置 72 小时失效,活跃请求剩余不足 24 小时时续期,绝对期限 365 天;OAuth access_token 有效期 1 小时,refresh_token 轮换且受同一会话期限约束。客户端应安全保存 Token,后续请求使用 Authorization: Bearer。仅密码直登 Token 支持 accessToken 工具参数兼容;OAuth Token 不得放参数或 URL。

权限:shop:read 查询;quote:submit 提交 AI 报价。支持查询商品、订单、收货地址、开票记录、报价额度和结果。不支持下单、支付、地址新增/修改/删除/设置默认、开票申请。logout 撤销当前 MCP 会话;修改密码、冻结客户、后台强制退出会撤销对应会话。

需求没有准确标准、型号、规格,或 search_goods 无结果时,推荐 AI 报价。须根据用户意愿提交。提交立即返回任务 ID,AI 回调较慢;随后查询 list_ai_quotes / get_ai_quote_status / get_ai_quote_detail 或官网列表、详情获取结果,建议间隔 15 秒。超时不代表失败,不要自动重复提交。

submit_ai_quote 的 requestId 必须由客户端生成,同一请求重试保持一致。提交不确定时只查询,不自动换 requestId 重复提交。配额不足、鉴权失败等需处理后再由用户决定是否重新提交。

HTTP 401 表示需要登录,WWW-Authenticate 指向 /.well-known/oauth-protected-resource/mcp;403 表示权限不足;429 表示触发频率限制。业务工具失败通过 isError=true 返回 JSON 文本 {error,message},成功通过 structuredContent 和兼容 JSON 文本返回同一对象。null 表示商城未提供该字段;金额以十进制字符串提供。

授权元数据:https://ai.xdkp8.com/.well-known/oauth-authorization-server
服务卡片(实验性):https://ai.xdkp8.com/mcp/server-card
完整工具与字段 Schema:/readme/tools.json

最小调用顺序:连接 /mcp → initialize → tools/list → 浏览器授权或 login → search_goods → get_goods_detail。私有列表默认只查询当前登录客户,不能传 uId/cId 切换客户。

工具与字段约定

字段以 Schema 为准。required 表示必填,default 为省略时采用的默认值,enum 为允许值。以下内容由实际工具定义生成。

login

使用用户明确提供的账号密码登录。密码为原始字符串,经 HTTPS 加密传输;AI 和客户端可能读取工具参数。不得记录或持久保存密码。返回 Token 由客户端安全保存,后续优先放 Bearer 请求头。也可选择官网 OAuth 授权。

输入字段

{
  "type": "object",
  "properties": {
    "account": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "description": "商城账号,通常为注册手机号"
    },
    "password": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256,
      "description": "原始账号密码,必填,非 MD5 摘要;空密码不允许"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "required": [
    "account",
    "password"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "accessToken": {
      "type": "string",
      "description": "仅用于本 MCP 的访问凭证;安全保存,不放 URL 或日志"
    },
    "sessionId": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "本次 MCP 会话 ID;null 表示未提供。"
    },
    "absoluteExpiresAt": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "会话绝对到期时间,Unix 毫秒,默认最长 365 天;null 表示未提供。"
    },
    "idleTimeoutSeconds": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "不活跃到期秒数,默认 259200 秒即 72 小时;活跃请求按续期策略延长;null 表示未提供。"
    },
    "expiresIn": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "OAuth 访问 Token 到期秒数;密码直登为 null,期限由 Redis 会话控制;null 表示未提供。"
    },
    "user": {
      "type": "object",
      "properties": {
        "userId": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991,
          "description": "当前客户 ID,由登录状态确定"
        },
        "account": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "当前登录账号;null 表示未提供。"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "客户姓名;null 表示未提供。"
        },
        "company": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "客户公司;null 表示未提供。"
        },
        "channel": {
          "type": "string",
          "const": "MCP",
          "description": "登录渠道固定 MCP"
        },
        "loginMethod": {
          "type": "string",
          "enum": [
            "PASSWORD",
            "OAUTH"
          ],
          "description": "PASSWORD 账号密码直登;OAUTH 官网授权"
        },
        "scope": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "空格分隔的权限;shop:read 查询,quote:submit 提交报价;null 表示未提供。"
        },
        "clientId": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "OAuth 客户端 ID;密码直登时为 null;null 表示未提供。"
        }
      },
      "required": [
        "userId",
        "channel",
        "loginMethod"
      ],
      "additionalProperties": false,
      "description": "当前客户身份和 MCP 授权范围"
    }
  },
  "required": [
    "accessToken",
    "user"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
get_current_user

获取当前 MCP 登录身份和授权范围。

输入字段

{
  "type": "object",
  "properties": {
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "userId": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "当前客户 ID,由登录状态确定"
    },
    "account": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "当前登录账号;null 表示未提供。"
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "客户姓名;null 表示未提供。"
    },
    "company": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "客户公司;null 表示未提供。"
    },
    "channel": {
      "type": "string",
      "const": "MCP",
      "description": "登录渠道固定 MCP"
    },
    "loginMethod": {
      "type": "string",
      "enum": [
        "PASSWORD",
        "OAUTH"
      ],
      "description": "PASSWORD 账号密码直登;OAUTH 官网授权"
    },
    "scope": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "空格分隔的权限;shop:read 查询,quote:submit 提交报价;null 表示未提供。"
    },
    "clientId": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "OAuth 客户端 ID;密码直登时为 null;null 表示未提供。"
    }
  },
  "required": [
    "userId",
    "channel",
    "loginMethod"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
logout

退出当前 MCP 会话并撤销该会话授权。

输入字段

{
  "type": "object",
  "properties": {
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "loggedOut": {
      "type": "boolean",
      "description": "是否已退出"
    }
  },
  "required": [
    "loggedOut"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
search_goods

搜索商城商品,支持关键词、SKU 或 O 开头的 SPU。登录后使用当前客户价格。需求没有准确标准、型号、规格,或 search_goods 无结果时,推荐 AI 报价。须根据用户意愿提交。提交立即返回任务 ID,AI 回调较慢;随后查询 list_ai_quotes / get_ai_quote_status / get_ai_quote_detail 或官网列表、详情获取结果,建议间隔 15 秒。超时不代表失败,不要自动重复提交。

输入字段

{
  "type": "object",
  "properties": {
    "search": {
      "type": "string",
      "maxLength": 500,
      "minLength": 1,
      "description": "搜索词、SKU 或 SPU;多个词用空格分隔"
    },
    "pageNum": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000,
      "default": 1,
      "description": "页码,从 1 开始,默认 1"
    },
    "pageSize": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 20,
      "description": "每页条数,1–100,默认 20"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "required": [
    "search"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "gId": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "商品 SKU ID;以返回值为准,不由商品名称推测;null 表示未提供。"
          },
          "goodsInfo": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "商品描述;null 表示未提供。"
          },
          "norm": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "规格;null 表示未提供。"
          },
          "brand": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "品牌;null 表示未提供。"
          },
          "materials": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "材质;null 表示未提供。"
          },
          "level": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "性能等级;null 表示未提供。"
          },
          "cHstandard": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "中文标准;null 表示未提供。"
          },
          "eNstandard": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "英文标准;null 表示未提供。"
          },
          "surfacetreat": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "表面处理;null 表示未提供。"
          },
          "toothshape": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "牙型;null 表示未提供。"
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "商城计量单位组合,价格口径应结合该单位与商品详情核对;null 表示未提供。"
          },
          "baseUnit": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "库存基本单位;null 表示未提供。"
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "商城当前展示价格;访客与已登录客户价格可能不同,不代表最终下单结算价;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
          },
          "facestock": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "商城展示库存;可能包含单位或文本,以库存基本单位为准,非承诺可交付数量;null 表示未提供。"
          },
          "bigNum": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "大包装规格,可能带单位;null 表示未提供。"
          },
          "smallNum": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "小包装规格,可能带单位;null 表示未提供。"
          },
          "img": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "商品图片 URL;null 表示未提供。"
          },
          "remark": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "商品备注;null 表示未提供。"
          }
        },
        "additionalProperties": false
      },
      "default": [],
      "description": "本页商品"
    },
    "hasMore": {
      "type": "boolean",
      "description": "本页已满时为 true,表示可能还有下一页,不能作为总数"
    },
    "recommendation": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "无结果时的下一步建议;null 表示未提供。"
    }
  },
  "required": [
    "hasMore"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
get_goods_detail

查询商品详情,分别返回整包和散装商品的当前价格、单位、库存。

输入字段

{
  "type": "object",
  "properties": {
    "gId": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "商品 SKU ID,由搜索结果取得"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "required": [
    "gId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "who": {
      "type": "object",
      "properties": {
        "gId": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "商品 SKU ID;以返回值为准,不由商品名称推测;null 表示未提供。"
        },
        "goodsInfo": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "商品描述;null 表示未提供。"
        },
        "norm": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "规格;null 表示未提供。"
        },
        "brand": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "品牌;null 表示未提供。"
        },
        "materials": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "材质;null 表示未提供。"
        },
        "level": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "性能等级;null 表示未提供。"
        },
        "cHstandard": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "中文标准;null 表示未提供。"
        },
        "eNstandard": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "英文标准;null 表示未提供。"
        },
        "surfacetreat": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "表面处理;null 表示未提供。"
        },
        "toothshape": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "牙型;null 表示未提供。"
        },
        "unit": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "商城计量单位组合,价格口径应结合该单位与商品详情核对;null 表示未提供。"
        },
        "baseUnit": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "库存基本单位;null 表示未提供。"
        },
        "price": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "商城当前展示价格;访客与已登录客户价格可能不同,不代表最终下单结算价;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
        },
        "facestock": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "商城展示库存;可能包含单位或文本,以库存基本单位为准,非承诺可交付数量;null 表示未提供。"
        },
        "bigNum": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "大包装规格,可能带单位;null 表示未提供。"
        },
        "smallNum": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "小包装规格,可能带单位;null 表示未提供。"
        },
        "img": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "商品图片 URL;null 表示未提供。"
        },
        "remark": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "商品备注;null 表示未提供。"
        }
      },
      "additionalProperties": false,
      "description": "整包商品详情;价格与库存按这一对象的单位读取"
    },
    "sca": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "gId": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "商品 SKU ID;以返回值为准,不由商品名称推测;null 表示未提供。"
            },
            "goodsInfo": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "商品描述;null 表示未提供。"
            },
            "norm": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "规格;null 表示未提供。"
            },
            "brand": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "品牌;null 表示未提供。"
            },
            "materials": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "材质;null 表示未提供。"
            },
            "level": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "性能等级;null 表示未提供。"
            },
            "cHstandard": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "中文标准;null 表示未提供。"
            },
            "eNstandard": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "英文标准;null 表示未提供。"
            },
            "surfacetreat": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "表面处理;null 表示未提供。"
            },
            "toothshape": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "牙型;null 表示未提供。"
            },
            "unit": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "商城计量单位组合,价格口径应结合该单位与商品详情核对;null 表示未提供。"
            },
            "baseUnit": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "库存基本单位;null 表示未提供。"
            },
            "price": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "商城当前展示价格;访客与已登录客户价格可能不同,不代表最终下单结算价;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
            },
            "facestock": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "商城展示库存;可能包含单位或文本,以库存基本单位为准,非承诺可交付数量;null 表示未提供。"
            },
            "bigNum": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "大包装规格,可能带单位;null 表示未提供。"
            },
            "smallNum": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "小包装规格,可能带单位;null 表示未提供。"
            },
            "img": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "商品图片 URL;null 表示未提供。"
            },
            "remark": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "description": "商品备注;null 表示未提供。"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "对应散装商品详情;不提供散装时为 null,不能套用整包价格或库存"
    }
  },
  "required": [
    "who",
    "sca"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
list_orders

只读查询当前客户的订单,合并支付记录通过 orderList 展开。

输入字段

{
  "type": "object",
  "properties": {
    "pageNum": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000,
      "default": 1,
      "description": "页码,从 1 开始,默认 1"
    },
    "pageSize": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 20,
      "description": "每页条数,1–100,默认 20"
    },
    "beginDate": {
      "type": "string",
      "format": "date",
      "description": "开始日期;有效日历日期 YYYY-MM-DD,按北京时间整日过滤"
    },
    "endDate": {
      "type": "string",
      "format": "date",
      "description": "结束日期;有效日历日期 YYYY-MM-DD,按北京时间整日过滤"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "list": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "订单 ID,需与订单类型一起使用;null 表示未提供。"
          },
          "number": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "订单编号;null 表示未提供。"
          },
          "type": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "订单详情类型:1 临时单,2 销售单,3 物流费,4 销售退单;集合行可能为空,应展开 orderList;null 表示未提供。"
          },
          "createTime": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "创建时间,北京时间;null 表示未提供。"
          },
          "paystate": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "商城支付状态码:1 待支付,2 支付成功,3 月结未支付,4 月结已支付,5 订单关闭或支付失败;null 表示未提供。"
          },
          "orderstate": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "原商城订单状态:销售单 0 待分拣、1 分拣、2 待出货、3 配送、4 到货、7 调货完成;临时单 1 待支付、2 关闭、3 已付款;物流或退单可能不提供;null 表示未提供。"
          },
          "totalAmount": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "订单总金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
          },
          "shouldMoney": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "应收金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
          },
          "returnMoney": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "退货金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
          },
          "remark": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "订单备注;null 表示未提供。"
          },
          "sendee": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "收货人;null 表示未提供。"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "收货电话;null 表示未提供。"
          },
          "sendAddress": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "配送地址;null 表示未提供。"
          },
          "expressCompany": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "配送公司;null 表示未提供。"
          },
          "expressNumber": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "物流单号;null 表示未提供。"
          },
          "goodsList": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "gId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "商品 SKU ID;null 表示未提供。"
                },
                "goodsInfo": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "订单商品描述;null 表示未提供。"
                },
                "norm": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "规格;null 表示未提供。"
                },
                "brand": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "品牌;null 表示未提供。"
                },
                "unit": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "订单单位;null 表示未提供。"
                },
                "goodsNum": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "订单商品数量;null 表示未提供。"
                },
                "price": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "订单单价;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
                },
                "totalmoney": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "商品行金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
                },
                "returnQuantity": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "已退数量;null 表示未提供。"
                }
              },
              "additionalProperties": false
            },
            "default": [],
            "description": "订单商品明细"
          },
          "orderList": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "default": null,
                  "description": "订单 ID,需与订单类型一起使用;null 表示未提供。"
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "订单编号;null 表示未提供。"
                },
                "type": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "default": null,
                  "description": "订单详情类型:1 临时单,2 销售单,3 物流费,4 销售退单;集合行可能为空,应展开 orderList;null 表示未提供。"
                },
                "createTime": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "创建时间,北京时间;null 表示未提供。"
                },
                "paystate": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "default": null,
                  "description": "商城支付状态码:1 待支付,2 支付成功,3 月结未支付,4 月结已支付,5 订单关闭或支付失败;null 表示未提供。"
                },
                "orderstate": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "default": null,
                  "description": "原商城订单状态:销售单 0 待分拣、1 分拣、2 待出货、3 配送、4 到货、7 调货完成;临时单 1 待支付、2 关闭、3 已付款;物流或退单可能不提供;null 表示未提供。"
                },
                "totalAmount": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "订单总金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
                },
                "shouldMoney": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "应收金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
                },
                "returnMoney": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "退货金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
                },
                "remark": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "订单备注;null 表示未提供。"
                },
                "sendee": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "收货人;null 表示未提供。"
                },
                "phone": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "收货电话;null 表示未提供。"
                },
                "sendAddress": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "配送地址;null 表示未提供。"
                },
                "expressCompany": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "配送公司;null 表示未提供。"
                },
                "expressNumber": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "default": null,
                  "description": "物流单号;null 表示未提供。"
                },
                "goodsList": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "gId": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null,
                        "description": "商品 SKU ID;null 表示未提供。"
                      },
                      "goodsInfo": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null,
                        "description": "订单商品描述;null 表示未提供。"
                      },
                      "norm": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null,
                        "description": "规格;null 表示未提供。"
                      },
                      "brand": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null,
                        "description": "品牌;null 表示未提供。"
                      },
                      "unit": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null,
                        "description": "订单单位;null 表示未提供。"
                      },
                      "goodsNum": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null,
                        "description": "订单商品数量;null 表示未提供。"
                      },
                      "price": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null,
                        "description": "订单单价;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
                      },
                      "totalmoney": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null,
                        "description": "商品行金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
                      },
                      "returnQuantity": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null,
                        "description": "已退数量;null 表示未提供。"
                      }
                    },
                    "additionalProperties": false
                  },
                  "default": [],
                  "description": "订单商品明细"
                }
              },
              "additionalProperties": false
            },
            "default": [],
            "description": "合并支付行中的子订单;详情使用子订单 ID 和类型"
          }
        },
        "additionalProperties": false
      },
      "default": [],
      "description": "本页订单或合并支付行"
    },
    "total": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "订单列表总行数;null 表示未提供。"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
get_order_detail

只读查询当前客户的一张订单,不支持下单或支付。

输入字段

{
  "type": "object",
  "properties": {
    "orderId": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "订单 ID"
    },
    "type": {
      "type": "number",
      "enum": [
        1,
        2,
        3,
        4
      ],
      "description": "1 临时单;2 销售单;3 物流费;4 销售退单"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "required": [
    "orderId",
    "type"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "本次详情类型;null 表示未提供。"
    },
    "summary": {
      "type": "object",
      "properties": {
        "id": {
          "type": [
            "number",
            "null"
          ],
          "default": null,
          "description": "订单 ID,需与订单类型一起使用;null 表示未提供。"
        },
        "number": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "订单编号;null 表示未提供。"
        },
        "type": {
          "type": [
            "number",
            "null"
          ],
          "default": null,
          "description": "订单详情类型:1 临时单,2 销售单,3 物流费,4 销售退单;集合行可能为空,应展开 orderList;null 表示未提供。"
        },
        "createTime": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "创建时间,北京时间;null 表示未提供。"
        },
        "paystate": {
          "type": [
            "number",
            "null"
          ],
          "default": null,
          "description": "商城支付状态码:1 待支付,2 支付成功,3 月结未支付,4 月结已支付,5 订单关闭或支付失败;null 表示未提供。"
        },
        "orderstate": {
          "type": [
            "number",
            "null"
          ],
          "default": null,
          "description": "原商城订单状态:销售单 0 待分拣、1 分拣、2 待出货、3 配送、4 到货、7 调货完成;临时单 1 待支付、2 关闭、3 已付款;物流或退单可能不提供;null 表示未提供。"
        },
        "totalAmount": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "订单总金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
        },
        "shouldMoney": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "应收金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
        },
        "returnMoney": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "退货金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
        },
        "remark": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "订单备注;null 表示未提供。"
        },
        "sendee": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "收货人;null 表示未提供。"
        },
        "phone": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "收货电话;null 表示未提供。"
        },
        "sendAddress": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "配送地址;null 表示未提供。"
        },
        "expressCompany": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "配送公司;null 表示未提供。"
        },
        "expressNumber": {
          "type": [
            "string",
            "null"
          ],
          "default": null,
          "description": "物流单号;null 表示未提供。"
        },
        "goodsList": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "gId": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "商品 SKU ID;null 表示未提供。"
              },
              "goodsInfo": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "订单商品描述;null 表示未提供。"
              },
              "norm": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "规格;null 表示未提供。"
              },
              "brand": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "品牌;null 表示未提供。"
              },
              "unit": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "订单单位;null 表示未提供。"
              },
              "goodsNum": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "订单商品数量;null 表示未提供。"
              },
              "price": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "订单单价;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
              },
              "totalmoney": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "商品行金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
              },
              "returnQuantity": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "已退数量;null 表示未提供。"
              }
            },
            "additionalProperties": false
          },
          "default": [],
          "description": "订单商品明细"
        }
      },
      "additionalProperties": false,
      "description": "订单摘要"
    },
    "goodsList": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "gId": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "商品 SKU ID;null 表示未提供。"
          },
          "goodsInfo": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "订单商品描述;null 表示未提供。"
          },
          "norm": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "规格;null 表示未提供。"
          },
          "brand": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "品牌;null 表示未提供。"
          },
          "unit": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "订单单位;null 表示未提供。"
          },
          "goodsNum": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "订单商品数量;null 表示未提供。"
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "订单单价;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
          },
          "totalmoney": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "商品行金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
          },
          "returnQuantity": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "已退数量;null 表示未提供。"
          }
        },
        "additionalProperties": false
      },
      "default": [],
      "description": "订单商品明细"
    }
  },
  "required": [
    "summary"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
list_addresses

只读获取当前客户的收货地址列表;无新增、修改、删除或设置默认功能。

输入字段

{
  "type": "object",
  "properties": {
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "description": "收货地址 ID"
          },
          "area": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "省市区;null 表示未提供。"
          },
          "detailAddress": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "详细地址;null 表示未提供。"
          },
          "consignee": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "收货人;null 表示未提供。"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "收货联系电话;null 表示未提供。"
          },
          "isDefault": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "默认地址标志:1 默认,0 非默认;null 表示未提供。"
          },
          "customName": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "地址自定义名称;null 表示未提供。"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false
      },
      "default": [],
      "description": "收货地址列表"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
get_address

只读获取当前客户的一条收货地址。

输入字段

{
  "type": "object",
  "properties": {
    "addressId": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "地址 ID"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "required": [
    "addressId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "收货地址 ID"
    },
    "area": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "省市区;null 表示未提供。"
    },
    "detailAddress": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "详细地址;null 表示未提供。"
    },
    "consignee": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "收货人;null 表示未提供。"
    },
    "phone": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "收货联系电话;null 表示未提供。"
    },
    "isDefault": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "默认地址标志:1 默认,0 非默认;null 表示未提供。"
    },
    "customName": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "地址自定义名称;null 表示未提供。"
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
list_invoices

只读获取当前客户的开票记录,不提交开票申请。

输入字段

{
  "type": "object",
  "properties": {
    "pageNum": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000,
      "default": 1,
      "description": "页码,从 1 开始,默认 1"
    },
    "pageSize": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 20,
      "description": "每页条数,1–100,默认 20"
    },
    "beginTime": {
      "type": "string",
      "format": "date",
      "description": "关联单据开始日期;有效日历日期 YYYY-MM-DD,按北京时间整日过滤"
    },
    "endTime": {
      "type": "string",
      "format": "date",
      "description": "关联单据结束日期;有效日历日期 YYYY-MM-DD,按北京时间整日过滤"
    },
    "invoiceStatus": {
      "type": "integer",
      "minimum": 1,
      "maximum": 4,
      "description": "1 申请中,2 已开票,3 已红冲,4 已开红票;省略查询全部"
    },
    "invoiceNumber": {
      "type": "string",
      "maxLength": 500,
      "description": "精确发票号码"
    },
    "orderNumber": {
      "type": "string",
      "maxLength": 500,
      "description": "关联单号关键词"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "list": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "invoiceId": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991,
            "description": "发票记录 ID"
          },
          "clientCompany": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "开票公司;null 表示未提供。"
          },
          "invoiceAmount": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "开票金额;红冲可为负数;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
          },
          "invoiceStatus": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "发票状态:1 申请中,2 已开票,3 已红冲,4 已开红票;null 表示未提供。"
          },
          "invoiceStatusValue": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "发票状态中文名称;null 表示未提供。"
          },
          "category": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "发票类别:1 纸质,2 数电;null 表示未提供。"
          },
          "categoryValue": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "发票类别名称;null 表示未提供。"
          },
          "applyTime": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "申请时间,北京时间;null 表示未提供。"
          },
          "confirmTime": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "开票时间,北京时间;null 表示未提供。"
          },
          "numbers": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "发票号码;null 表示未提供。"
          }
        },
        "required": [
          "invoiceId"
        ],
        "additionalProperties": false
      },
      "default": [],
      "description": "开票记录"
    },
    "total": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "总条数;null 表示未提供。"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
get_invoice_detail

只读获取当前客户发票及其关联单据。

输入字段

{
  "type": "object",
  "properties": {
    "invoiceId": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "发票记录 ID"
    },
    "category": {
      "type": "number",
      "enum": [
        1,
        2
      ],
      "description": "1 纸质发票,2 数电发票,沿用列表返回值"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "required": [
    "invoiceId",
    "category"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "invoiceId": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "发票记录 ID"
    },
    "clientCompany": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "开票公司;null 表示未提供。"
    },
    "billTfn": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "税号;null 表示未提供。"
    },
    "billAddress": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "开票地址;null 表示未提供。"
    },
    "clientPhone": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "联系电话;null 表示未提供。"
    },
    "billBank": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "开户行及账号;null 表示未提供。"
    },
    "expressAddress": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "邮寄地址;null 表示未提供。"
    },
    "applyTime": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "申请时间,北京时间;null 表示未提供。"
    },
    "list": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "关联业务单据 ID;null 表示未提供。"
          },
          "orderNumber": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "关联单号;null 表示未提供。"
          },
          "orderType": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "关联单据类型中文名称;null 表示未提供。"
          },
          "orderTime": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "关联单据时间,北京时间;null 表示未提供。"
          },
          "increaseAmount": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "增加应收金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
          },
          "reduceAmount": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "减少应收金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
          },
          "receivableAmount": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "按明细顺序累计的应收金额;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
          }
        },
        "additionalProperties": false
      },
      "default": [],
      "description": "关联单据明细"
    }
  },
  "required": [
    "invoiceId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
get_ai_quote_quota

查询当前客户今日 AI 报价配额。

输入字段

{
  "type": "object",
  "properties": {
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "usedCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "今日已用需求条数;null 表示未提供。"
    },
    "remainingCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "今日剩余需求条数;null 表示未提供。"
    },
    "totalCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "今日总额度;null 表示未提供。"
    },
    "date": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "配额所属日期,北京时间;null 表示未提供。"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
submit_ai_quote

提交文本 AI 报价任务。需求没有准确标准、型号、规格,或 search_goods 无结果时,推荐 AI 报价。须根据用户意愿提交。提交立即返回任务 ID,AI 回调较慢;随后查询 list_ai_quotes / get_ai_quote_status / get_ai_quote_detail 或官网列表、详情获取结果,建议间隔 15 秒。超时不代表失败,不要自动重复提交。

输入字段

{
  "type": "object",
  "properties": {
    "requestId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{16,100}$",
      "description": "客户端生成的幂等请求 ID,同一提交及重试保持一致;新需求用新 ID"
    },
    "promptsList": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 2000,
        "description": "一条用户的商品需求,保留数量、用途、规格等原始条件"
      },
      "minItems": 1,
      "maxItems": 50,
      "description": "用户需求文本数组,1–50 条;本工具不接受文件上传"
    },
    "saleType": {
      "type": "number",
      "enum": [
        1,
        2
      ],
      "default": 1,
      "description": "报价商品优先级:1 自营优先,2 联营优先,默认 1"
    },
    "orderBy": {
      "type": "number",
      "enum": [
        1,
        2
      ],
      "default": 2,
      "description": "报价排序模式:1 库存从高到低,2 价格从低到高,默认 2"
    },
    "deepType": {
      "type": "number",
      "enum": [
        2,
        3
      ],
      "default": 3,
      "description": "2 快速报价,3 深度报价,默认 3"
    },
    "haveStock": {
      "type": "boolean",
      "default": false,
      "description": "是否只查有库存商品,默认 false"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "required": [
    "requestId",
    "promptsList"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "aimId": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "报价任务 ID;提交结果不确定时为 null,请查看列表确认;null 表示未提供。"
    },
    "inquiryUuid": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "询价业务编号;null 表示未提供。"
    },
    "requestCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "提交需求条数;null 表示未提供。"
    },
    "message": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "提交状态说明;null 表示未提供。"
    },
    "uncertain": {
      "type": "boolean",
      "default": false,
      "description": "true 表示上次提交结果尚未确定;禁止自动新建重复任务"
    },
    "pollAfterSeconds": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "建议 15 秒后查询;null 表示未提供。"
    },
    "detailUrl": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "官网报价详情链接;null 表示未提供。"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
list_ai_quotes

查看当前客户 AI 报价列表;用于找回提交超时但实际已创建的任务。需求没有准确标准、型号、规格,或 search_goods 无结果时,推荐 AI 报价。须根据用户意愿提交。提交立即返回任务 ID,AI 回调较慢;随后查询 list_ai_quotes / get_ai_quote_status / get_ai_quote_detail 或官网列表、详情获取结果,建议间隔 15 秒。超时不代表失败,不要自动重复提交。

输入字段

{
  "type": "object",
  "properties": {
    "pageNum": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000,
      "default": 1,
      "description": "页码,从 1 开始,默认 1"
    },
    "pageSize": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 20,
      "description": "每页条数,1–100,默认 20"
    },
    "inquiryUuid": {
      "type": "string",
      "maxLength": 500,
      "description": "精确询价业务编号"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "list": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "AI 报价任务 ID,对应详情参数 aimId;null 表示未提供。"
          },
          "inquiryUuid": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "询价业务编号;null 表示未提供。"
          },
          "state": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "报价状态:0 失败,1 完成,2 处理中,3 取消,4 请求异常,5 无匹配,6 超时,7 等待询价,14 解析中,15 解析失败;null 表示未提供。"
          },
          "createTime": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "提交时间,北京时间;null 表示未提供。"
          },
          "dataCount": {
            "type": [
              "number",
              "null"
            ],
            "default": null,
            "description": "需求条数;null 表示未提供。"
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "商城状态说明;null 表示未提供。"
          },
          "firstPrompt": {
            "type": [
              "string",
              "null"
            ],
            "default": null,
            "description": "第一条用户需求;null 表示未提供。"
          }
        },
        "additionalProperties": false
      },
      "default": [],
      "description": "本页报价任务"
    },
    "total": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "总任务数;null 表示未提供。"
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
get_ai_quote_status

查询报价进度;成功需求数与匹配商品数分开,不将已处理条数当成功条数。

输入字段

{
  "type": "object",
  "properties": {
    "aimId": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "报价任务 ID"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "required": [
    "aimId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "aimId": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "报价任务 ID"
    },
    "inquiryUuid": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "询价业务编号;null 表示未提供。"
    },
    "state": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "报价状态:0 失败,1 完成,2 处理中,3 取消,4 请求异常,5 无匹配,6 超时,7 等待询价,14 解析中,15 解析失败;null 表示未提供。"
    },
    "stateDescription": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "报价状态说明;null 表示未提供。"
    },
    "totalCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "实际需求条数;null 表示未提供。"
    },
    "matchedCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "状态为完成的需求条数,不是商品个数;null 表示未提供。"
    },
    "pendingCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "处理中或等待中的需求条数;null 表示未提供。"
    },
    "failedCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "失败、无匹配、超时或取消的需求条数;null 表示未提供。"
    },
    "pollAfterSeconds": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "建议下次查询间隔,处理中为 15 秒;完成为 null;null 表示未提供。"
    },
    "detailUrl": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "官网报价详情链接,可由用户打开继续查看;null 表示未提供。"
    }
  },
  "required": [
    "aimId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
get_ai_quote_detail

查询报价商品结果;处理中可先读取部分结果。需求没有准确标准、型号、规格,或 search_goods 无结果时,推荐 AI 报价。须根据用户意愿提交。提交立即返回任务 ID,AI 回调较慢;随后查询 list_ai_quotes / get_ai_quote_status / get_ai_quote_detail 或官网列表、详情获取结果,建议间隔 15 秒。超时不代表失败,不要自动重复提交。

输入字段

{
  "type": "object",
  "properties": {
    "aimId": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "报价任务 ID"
    },
    "pageNum": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000,
      "default": 1,
      "description": "页码,从 1 开始,默认 1"
    },
    "pageSize": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 20,
      "description": "每页条数,1–100,默认 20"
    },
    "saleType": {
      "type": "number",
      "enum": [
        1,
        2
      ],
      "default": 1,
      "description": "报价商品优先级:1 自营优先,2 联营优先,默认 1"
    },
    "orderBy": {
      "type": "number",
      "enum": [
        1,
        2
      ],
      "default": 2,
      "description": "报价排序模式:1 库存从高到低,2 价格从低到高,默认 2"
    },
    "accessToken": {
      "type": "string",
      "minLength": 1,
      "maxLength": 8192,
      "description": "仅账号密码直登 Token 的兼容参数。优先使用 Authorization: Bearer;OAuth Token 只能放请求头。不得传官网 Token"
    }
  },
  "required": [
    "aimId"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}

返回字段

{
  "type": "object",
  "properties": {
    "aimId": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "报价任务 ID"
    },
    "inquiryUuid": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "询价业务编号;null 表示未提供。"
    },
    "state": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "报价状态:0 失败,1 完成,2 处理中,3 取消,4 请求异常,5 无匹配,6 超时,7 等待询价,14 解析中,15 解析失败;null 表示未提供。"
    },
    "stateDescription": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "报价状态说明;null 表示未提供。"
    },
    "totalCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "实际需求条数;null 表示未提供。"
    },
    "matchedCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "状态为完成的需求条数,不是商品个数;null 表示未提供。"
    },
    "pendingCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "处理中或等待中的需求条数;null 表示未提供。"
    },
    "failedCount": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "失败、无匹配、超时或取消的需求条数;null 表示未提供。"
    },
    "pollAfterSeconds": {
      "type": [
        "number",
        "null"
      ],
      "default": null,
      "description": "建议下次查询间隔,处理中为 15 秒;完成为 null;null 表示未提供。"
    },
    "detailUrl": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "description": "官网报价详情链接,可由用户打开继续查看;null 表示未提供。"
    },
    "detail": {
      "type": "object",
      "properties": {
        "total": {
          "type": [
            "number",
            "null"
          ],
          "default": null,
          "description": "总需求条数;null 表示未提供。"
        },
        "goodsTotal": {
          "type": [
            "number",
            "null"
          ],
          "default": null,
          "description": "本页匹配商品数;null 表示未提供。"
        },
        "priceAccuracy": {
          "type": [
            "number",
            "null"
          ],
          "default": null,
          "description": "当前客户价格小数位数;null 表示未提供。"
        },
        "list": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "aidId": {
                "type": [
                  "number",
                  "null"
                ],
                "default": null,
                "description": "单条需求 ID;null 表示未提供。"
              },
              "prompt": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "原始需求;null 表示未提供。"
              },
              "aidState": {
                "type": [
                  "number",
                  "null"
                ],
                "default": null,
                "description": "报价状态:0 失败,1 完成,2 处理中,3 取消,4 请求异常,5 无匹配,6 超时,7 等待询价,14 解析中,15 解析失败;null 表示未提供。"
              },
              "errorMsg": {
                "type": [
                  "string",
                  "null"
                ],
                "default": null,
                "description": "未完成或失败说明;null 表示未提供。"
              },
              "total": {
                "type": [
                  "number",
                  "null"
                ],
                "default": null,
                "description": "该需求匹配商品数量;null 表示未提供。"
              },
              "list": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "gId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "商品 SKU ID;以返回值为准,不由商品名称推测;null 表示未提供。"
                    },
                    "goodsInfo": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "商品描述;null 表示未提供。"
                    },
                    "norm": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "规格;null 表示未提供。"
                    },
                    "brand": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "品牌;null 表示未提供。"
                    },
                    "materials": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "材质;null 表示未提供。"
                    },
                    "level": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "性能等级;null 表示未提供。"
                    },
                    "cHstandard": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "中文标准;null 表示未提供。"
                    },
                    "eNstandard": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "英文标准;null 表示未提供。"
                    },
                    "surfacetreat": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "表面处理;null 表示未提供。"
                    },
                    "toothshape": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "牙型;null 表示未提供。"
                    },
                    "unit": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "商城计量单位组合,价格口径应结合该单位与商品详情核对;null 表示未提供。"
                    },
                    "baseUnit": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "库存基本单位;null 表示未提供。"
                    },
                    "price": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "商城当前展示价格;访客与已登录客户价格可能不同,不代表最终下单结算价;十进制字符串,金额单位人民币元,保留商城精度;null 表示未提供。"
                    },
                    "facestock": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "商城展示库存;可能包含单位或文本,以库存基本单位为准,非承诺可交付数量;null 表示未提供。"
                    },
                    "bigNum": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "大包装规格,可能带单位;null 表示未提供。"
                    },
                    "smallNum": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "小包装规格,可能带单位;null 表示未提供。"
                    },
                    "img": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "商品图片 URL;null 表示未提供。"
                    },
                    "remark": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null,
                      "description": "商品备注;null 表示未提供。"
                    }
                  },
                  "additionalProperties": false
                },
                "default": [],
                "description": "该需求的匹配商品,任务处理中也可能已有部分结果"
              }
            },
            "additionalProperties": false
          },
          "default": [],
          "description": "按原始需求分组的匹配结果"
        }
      },
      "additionalProperties": false,
      "description": "报价明细"
    }
  },
  "required": [
    "aimId",
    "detail"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}