3 maja 2023 roku wycofamy interfejs Transakcje (przed 13 czerwca 2023 r. wycofujemy funkcje Conversational Actions). Więcej informacji znajdziesz w artykule
Wycofanie czynności konwersacyjnych.
Method: orders.createWithCustomToken
Tworzy i zwraca nowe zamówienie przy użyciu niestandardowego tokena wygenerowanego przez Google. Deweloperzy korzystający z tej metody powinni ustawić w żądaniu token użytkownika przekazany przez Google. Jest ona używana w przypadkach, gdy deweloperzy lub sprzedawca bezpośrednio zapisują zamówienia w Google w imieniu zamówienia (a nie w przypadku transakcji i procesu AMP).
Żądanie HTTP
POST https://actions.googleapis.com/v3/orders:createWithCustomToken
Adres URL używa składni transkodowania gRPC.
Treść żądania
Treść żądania zawiera dane o następującej strukturze:
Pola |
header |
object (OrderRequestHeader )
Wymagane: nagłówek żądania utworzenia zamówienia.
|
order |
object (Order )
Wymagany: zamówienie do utworzenia. Uwaga: 1. Do utworzenia prawidłowego zamówienia wymagane są zawsze te pola: order.create_time, order.merchant_order_id, order.contents.line_items, order.contents.line_items.id 2. Zamówienie musi zawierać co najmniej 1 element zamówienia, a element zamówienia musi mieć określoną branżę/rozszerzenie. 3. Wszystkie rozszerzenia (zarówno na poziomie zamówienia, jak i elementu zamówienia) muszą odpowiadać jednemu typowi branży, tj. zamówienie jest nieprawidłowe, jeśli dotyczy więcej niż 1 branży.
|
userToken |
string
Wymagane: zaszyfrowany token przekazany partnerowi przez Google za pomocą kanału asynchronicznego.
|
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi obejmuje wystąpienie elementu Order
.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-09-12 UTC.
[null,null,["Ostatnia aktualizacja: 2024-09-12 UTC."],[[["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"]]