سيتم إيقاف واجهة برمجة تطبيقات المعاملات في 3 أيار (مايو) 2023، قبل إيقاف ميزة "إجراءات المحادثات" في 13 حزيران (يونيو) 2023. لمزيد من المعلومات، يُرجى الاطّلاع على
إنهاء إجراءات المحادثة.
Method: orders.createWithCustomToken
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تنشئ وتعيد الطلب الجديد باستخدام رمز مميز مخصص تم إنشاؤه بواسطة Google. وعلى المطوّرين الذين يستخدمون هذه الطريقة ضبط رمز userToken الذي تم تمريره من خلال Google في الطلب. تُستخدم هذه الطريقة في الحالات التي يحفظ فيها المطوّرون/التاجر الطلبات مباشرةً في Google بالنيابة عن الطلبات (بدلاً من "المعاملات" و"تدفق صفحات AMP").
طلب HTTP
POST https://actions.googleapis.com/v3/orders:createWithCustomToken
يستخدِم عنوان URL بنية تحويل ترميز 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. يجب أن يحتوي الطلب على عنصر واحد على الأقل، ويجب أن يحتوي العنصر على معرّف عمودي/إضافة محدّدَين. 3- يجب ربط كل الإضافات (في كلٍّ من مستوى الطلب ومستوى line_item) بنوع عمودي واحد. لا يكون الطلب أمرًا صالحًا إذا كان يمثل أكثر من قطاع واحد.
|
userToken |
string
مطلوب: الرمز المميز المشفر الذي تقدمه Google للشريك عبر قناة غير متزامنة.
|
نص الاستجابة
إذا كانت الاستجابة ناجحة، يحتوي نص الاستجابة على مثال Order
.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eCreates new Orders using a custom token provided by Google, enabling developers to save orders directly on behalf of the user.\u003c/p\u003e\n"],["\u003cp\u003eRequires a \u003ccode\u003ePOST\u003c/code\u003e request to \u003ccode\u003ehttps://actions.googleapis.com/v3/orders:createWithCustomToken\u003c/code\u003e with specific data in the request body.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain \u003ccode\u003eheader\u003c/code\u003e, \u003ccode\u003eorder\u003c/code\u003e, and \u003ccode\u003euserToken\u003c/code\u003e fields with specified data structures and requirements.\u003c/p\u003e\n"],["\u003cp\u003eA successful response returns the created \u003ccode\u003eOrder\u003c/code\u003e object with details of the order.\u003c/p\u003e\n"]]],["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"],null,["# Method: orders.createWithCustomToken\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n\nCreates and returns the new Order using a custom token minted by google. Developers using this method should set the userToken passed by google in the request. This method is used in cases where developers/merchant directly saves orders to Google on behalf of order (instead of Transactions and AMP flow).\n\n### HTTP request\n\n`POST https://actions.googleapis.com/v3/orders:createWithCustomToken`\n\nThe URL uses [gRPC Transcoding](https://github.com/googleapis/googleapis/blob/master/google/api/http.proto) syntax.\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ``` { \"header\": { object (/assistant/df-asdk/transactions/reference/physical/rest/v3/OrderRequestHeader) }, \"order\": { object (/assistant/df-asdk/transactions/reference/physical/rest/v3/Order) }, \"userToken\": string } ``` |\n\n| Fields ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `header` | `object (`[OrderRequestHeader](/assistant/df-asdk/transactions/reference/physical/rest/v3/OrderRequestHeader)`)` Required: Header for the create order request. |\n| `order` | `object (`[Order](/assistant/df-asdk/transactions/reference/physical/rest/v3/Order)`)` Required: Order to be created. Note: 1. Following fields are always required to create a valid order: order.create_time, order.merchant_order_id, order.contents.line_items, order.contents.line_items.id 2. Order must have at-least 1 line item and line item must have defined vertical/extension. 3. All extensions (both at order level and line_item level) must map to 1 vertical type ie. an order is not a valid order if it represents more than 1 vertical. \u003cbr /\u003e |\n| `userToken` | `string` Required: Encrypted token provided to partner by Google via asynchronous channel. |\n\n### Response body\n\nIf successful, the response body contains an instance of [Order](/assistant/df-asdk/transactions/reference/physical/rest/v3/Order)."]]