ב-3 במאי 2023 נוציא משימוש את Transactions API, לפני ההוצאה משימוש של Conversations Actions ב-13 ביוני 2023.
כאן תוכלו לקרוא מידע נוסף על ההוצאה משימוש של 'פעולות שיחה'.
Method: orders.createWithCustomToken
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
יצירה ומחזירה את ההזמנה החדשה באמצעות אסימון מותאם אישית שהוטבע על ידי Google. מפתחים המשתמשים בשיטה זו צריכים להגדיר את אסימון המשתמש שמועבר על ידי 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. כל התוספים (גם ברמת ההזמנה וגם ברמת הפריט) חייבים למפות לסוג אנכי אחד, כלומר. הזמנה אינה הזמנה חוקית אם היא מייצגת יותר מתחום מסוים.
|
userToken |
string
נדרש: אסימון מוצפן שמסופק לשותף על ידי Google דרך ערוץ אסינכרוני.
|
גוף התשובה
אם הפעולה בוצעה ללא שגיאות, גוף התגובה יכלול מופע של Order
.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\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)."]]