Transaction API 将于 2023 年 5 月 3 日弃用,在此之前,会话操作将于 2023 年 6 月 13 日停用。如需了解详情,请参阅
对话型 Action 停用。
Method: orders.createWithCustomToken
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
使用由 Google 创建的自定义令牌创建并返回新订单。使用此方法的开发者应设置 Google 在请求中传递的 userToken。如果开发者/商家代表订单(而不是交易和 AMP 流程)直接将订单保存到 Google,则可以使用此方法。
HTTP 请求
POST https://actions.googleapis.com/v3/orders:createWithCustomToken
网址采用 gRPC 转码语法。
请求正文
请求正文中包含结构如下的数据:
字段 |
header |
object (OrderRequestHeader )
必需:创建订单请求的标头。
|
order |
object (Order )
必需:要创建的订单。 注意:1.要创建有效订单,以下字段始终是必填字段:order.create_time、order.merchant_order_id、order.contents.line_items、order.contents.line_items.id 2.订单中必须至少包含 1 个订单项,并且订单项必须已定义行业/附加信息。3. 所有附加信息(包括订单级和订单项级)都必须映射到 1 种行业类型,即如果一个订单代表多个行业,就不是有效的订单。
|
userToken |
string
必需:Google 通过异步渠道向合作伙伴提供的加密令牌。
|
响应正文
如果成功,则响应正文包含一个 Order
实例。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-13。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-09-13。"],[[["Creates new Orders using a custom token provided by Google, enabling developers to save orders directly on behalf of the user."],["Requires a `POST` request to `https://actions.googleapis.com/v3/orders:createWithCustomToken` with specific data in the request body."],["The request body must contain `header`, `order`, and `userToken` fields with specified data structures and requirements."],["A successful response returns the created `Order` object with details of the order."]]],["This describes the process of creating a new order using a custom Google-minted token. A `POST` request is sent to `https://actions.googleapis.com/v3/orders:createWithCustomToken`. The request body requires a JSON payload with `header`, `order` (including `create_time`, `merchant_order_id`, and at least one valid `line_item` with an ID and vertical extension), and `userToken` (an encrypted token from Google). A successful request returns an `Order` instance in the response body.\n"]]