Hi Folks,
I was wondering what is the best practice for using the data that arrives in the webhook payload.
Below is a sample of what I receive when an order is created (no payment yet). As you can see from this, there is one create event and two update. Why are there two updates after the create? What use are they?
{ "merchants": { "XXXXX": [ { "type": "CREATE", "ts": 1453829584344, "objectId": "O:ZZZZZZZZZZ" }, { "type": "UPDATE", "ts": 1453829584765, "objectId": "O:ZZZZZZZZZZ" }, { "type": "UPDATE", "ts": 1453829585037, "objectId": "O:ZZZZZZZZZZ" } ] }, "appId": "BBBBBBBBB" }
When a payment is received the following is received. I understand that the same order id can be tracked, but again, why the updates to the order before the payment event is created?
{ "merchants": { "XXXXX": [ { "type": "UPDATE", "ts": 1453830144608, "objectId": "O:ZZZZZZZZZZ" }, { "type": "UPDATE", "ts": 1453830145072, "objectId": "O:ZZZZZZZZZZ" }, { "type": "CREATE", "ts": 1453830145072, "objectId": "P:EVRSKSBHTGQ6M" } ] }, "appId": "1X2NPBGXKPK18" }
Lastly, what would be the best way to store these orders and payments relationally in a database?
--
Thanks in advance!
JP