簡體   English   中英

如何在 shopify 中創建自定義 webhook

[英]How to create custom webhook in shopify

我需要創建一個自定義 webhook 來發送訂單請求。 就像我從其他 Woocommerce 發送的響應一樣

回復如下:

“params”:{“order_data”:{“id”:31502,“referring_site”:“”,“order_number”:“31502”,“created_at”:“2021-02-08 16:41:24”,“updated_at ": "2021-02-08 16:41:24", "completed_at": "", "status": "pending", "currency": "", "total": "", "subtotal": "" ,“total_line_items_quantity”:1,“total_tax”:“0”,“total_shipping”:“0”,“cart_tax”:“0”,“shipping_tax”:“0”,“total_discount”:“0”,“shipping_methods” : "免費送貨", "order_key": "", "payment_details": { "method_id": "", "method_title": "", "paid_at": "" }, "billing_address": { "first_name": " ", "last_name": "", "company": "", "address_1": "", "address_2": "", "city": "", "state": "", "formated_state": "" ,“郵政編碼”:“”,“國家/地區”:“”,“formated_country”:“”,“電子郵件”:“”,“電話”:“”},“運輸地址”:{“first_name”:“”,“姓氏:“”,“公司”:“”,“地址_1”:“”,“地址_2”:“”,“城市”:“”,“州”:“”,“格式化_州”:“”,“郵政編碼": "", "country": "", "formated_country": "" }, "note": "", "customer_ip": "", "customer_use r_agent": "", "customer_id": 29, "view_order_url": "", "line_items": [ { "id": , "subtotal": "", "subtotal_tax": "", "total": "" ,“total_tax”:“”,“價格”:“”,“數量”:1,“名稱”:“”,“product_id”:10072,“variation_id”:0,“product_url”:“”,“product_thumbnail_url” : "", "sku": "", "meta": "" } ], "shipping_lines": [ { "id": , "method_id": "free_shipping", "method_title": "免運費", "total ": "0" } ], "tax_lines": [], "fee_lines": [], "coupon_lines": [] } }

Shopify 有兩個可用的 webhook 供您使用。 第一個是“orders/create”,它是一個 webhook,它在首次創建時向您發送訂單。 第二個是“訂單/已付款”,一旦訂單被標記為已付款,它就會向您發送訂單。

因此,您不必“創建”自己的訂單 webhook,只要訂閱或打開 Shopify API 中可用的 webhook。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM