question

spiceappmatt avatar image
spiceappmatt asked ·

Order ID for 'CREATE' event iterates ahead of 'UPDATE'?

I'm using an emulator to create orders and watching the webhook events that come through as I'm doing so. I've noticed that when I start adding items to an order, it generates an order ID with type 'UPDATE'. That's fine and expected behavior. However, when I save or pay for an order, generating an event of type 'CREATE', the order ID associated with the event is not the order ID associated with the updates. The order ID returned with the 'CREATE' event is the next order ID to be assigned instead of the one associated with the order just created.

Is this expected and typical behavior? I really want to ignore updates to an order until it is saved the first time, so I would watch for a 'CREATE' event, log the order ID as active, and watch for any changes to the order following the initial order creation. With the 'CREATE' event returning the next order ID value to be used, instead of the current order ID, this seems not possible without some workaround.

Any ideas? Thanks!

OrdersWebhooks
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
David Marginian avatar image
David Marginian answered ·

I am guessing the Orders app creates a new order (the next order) when you save/pay for the previous one.

"I'm using an emulator to create orders and watching the webhook events that come through as I'm doing so. I've noticed that when I start adding items to an order, it generates an order ID with type 'UPDATE'. That's fine and expected behavior."

You should be getting a create first (an order can't be updated until it has been created.

I would try using the API to create orders instead of the emulator.

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community