Orders/paid vs orders/updated

I’m using the webhook orders/create to receive new orders. I have to change it to process only paid orders. I was planning to add orders/update to my webhooks and filter the order received by financial_status = 'paid' to process it.

Am I able to get all paid orders only by switching my webhook from orders/create to orders/paid?

  • To get orders created as paid
  • To get orders updated to paid
1 Like

This is what I received when I thought to try asking the .dev Assistant about it because the documentation was a bit unclear…

The orders/create webhook is triggered whenever a new order is created, regardless of its payment status. On the other hand, the orders/paid webhook is specifically triggered when an order is marked as paid.

I get that it does not exactly provide a clear answer. I’m unsure if an order with automatic payment capture would send both payloads when a customer places an order. Maybe you could test it on your end. If that does occur then I believe that the orders/paid should be sufficient in your case.

Alternatively, you can use managed webhooks to filter the orders/create webhook to only fire when the financial status is paid.

[[webhooks.subscriptions]]
  topics = [ "orders/create" ]
  uri = "https://example.com/api/webhooks/orders_paid"
  filter = "financial_status:PAID"

(please double check if it’s PAID or paid)

2 Likes

It depends on your needs.
If you only want orders once they are paid and only care about the state of the order at this point you can use the orders/paid webhook. ERP or WMS integration that use webhooks tend to use this one.

If you want continual updates of an order from the point they are paid, you could use a webhook on orders/updated with a filter on the financial status.

1 Like

Added orders-and-returns