Transactions API در 3 مه 2023 منسوخ خواهد شد، قبل از غروب کنشهای مکالمه در 13 ژوئن 2023. برای اطلاعات بیشتر،
غروب کنشهای مکالمه را ببینید.
Method: orders.createWithCustomToken
با استفاده از یک توکن سفارشی که توسط گوگل ساخته شده است، سفارش جدید را ایجاد و برمی گرداند. توسعه دهندگانی که از این روش استفاده می کنند باید userToken ارسال شده توسط گوگل را در درخواست تنظیم کنند. این روش در مواردی استفاده میشود که توسعهدهندگان/تجار مستقیماً سفارشها را از طرف سفارش در Google ذخیره میکنند (بهجای تراکنشها و جریان AMP).
درخواست HTTP
POST https://actions.googleapis.com/v3/orders:createWithCustomToken
URL از دستور GRPC Transcoding استفاده می کند.
درخواست بدن
بدنه درخواست حاوی داده هایی با ساختار زیر است:
فیلدها |
---|
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 نوع عمودی نگاشت شوند. یک سفارش اگر بیش از 1 عمودی را نشان دهد، یک سفارش معتبر نیست. |
userToken | string مورد نیاز: رمز رمزگذاری شده توسط Google از طریق کانال ناهمزمان به شریک ارائه شده است. |
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی نمونه ای از Order
است.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-01-06 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-06 بهوقت ساعت هماهنگ جهانی."],[[["This document explains the `orders:createWithCustomToken` method, which creates new Google Orders using a custom, Google-minted token."],["Developers should include the `userToken` provided by Google in the request."],["This process is typically used when developers or merchants directly save orders to Google on behalf of the order, rather than using Transactions or AMP flows."],["The request body must include a header, order details (with at least one line item and a specified vertical), and the `userToken`."],["A successful response will return the created `Order` object."]]],["This document outlines how to create a new order using a custom Google-minted token. It involves sending a `POST` request to `https://actions.googleapis.com/v3/orders:createWithCustomToken`. The request body requires a JSON structure with `header` (OrderRequestHeader object), `order` (Order object, including required fields like `create_time`, `merchant_order_id`, and line items), and a `userToken` (an encrypted token from Google). Successful requests return an `Order` object in the response body. The order must contain at least one line item, and all extensions should map to a single vertical type.\n"]]