Muhammed Fayaz
Muhammed Fayaz

Reputation: 55

How to create custom webhook in shopify

I need to create a custom webhook to send the order request. As like the response which I sending from other Woocommerce

Response below:

"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": "Free shipping", "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": "", "postcode": "", "country": "", "formated_country": "", "email": "", "phone": "" }, "shipping_address": { "first_name": "", "last_name": "", "company": "", "address_1": "", "address_2": "", "city": "", "state": "", "formated_state": "", "postcode": "", "country": "", "formated_country": "" }, "note": "", "customer_ip": "", "customer_user_agent": "", "customer_id": 29, "view_order_url": "", "line_items": [ { "id": , "subtotal": "", "subtotal_tax": "", "total": "", "total_tax": "", "price": "", "quantity": 1, "name": "", "product_id": 10072, "variation_id": 0, "product_url": "", "product_thumbnail_url": "", "sku": "", "meta": "" } ], "shipping_lines": [ { "id": , "method_id": "free_shipping", "method_title": "Free shipping", "total": "0" } ], "tax_lines": [], "fee_lines": [], "coupon_lines": [] } }

Upvotes: 0

Views: 571

Answers (1)

David Lazar
David Lazar

Reputation: 11427

Shopify has two available webhooks for you. The first is "orders/create" which is a webhook sending you the order when it is first created. The second is "orders/paid" which sends you the order once it has been marked as paid.

You therefore do not "create" your own order webhook, so much as you subscribe to or turn on, webhooks available in Shopify API.

Upvotes: 0

Related Questions