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. คำสั่งซื้อต้องมีรายการโฆษณาอย่างน้อย 1 รายการ และรายการโฆษณาต้องกำหนดประเภทธุรกิจ/ส่วนขยายไว้ 3. ส่วนขยายทั้งหมด (ทั้งที่ระดับคำสั่งซื้อและระดับรายการโฆษณา) ต้องแมปกับประเภทธุรกิจ 1 ประเภท ได้แก่ คำสั่งซื้อไม่ใช่คำสั่งซื้อที่ถูกต้องหากแสดงประเภทธุรกิจมากกว่า 1 รายการ
|
userToken |
string
ต้องระบุ: โทเค็นที่เข้ารหัสที่ Google มอบให้พาร์ทเนอร์ผ่านช่องทางแบบอะซิงโครนัส
|
เนื้อหาการตอบกลับ
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีอินสแตนซ์ Order
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-09-12 UTC
[null,null,["อัปเดตล่าสุด 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"]]