We are using the orders.created webhook to monitor for online purchases and then update our WMS and trigger fulfillment. Over the last week (since 8/21, to the best of my knowledge), we’ve seen inconsistent behavior in these events.
We monitor orders and interrogate the state tag of the payload. If the state tag is “OPEN”, we accept the order and process it. If the state is “DRAFT”, we do not, since the same order will be published on the webhook as DRAFT first and then shortly after as OPEN.
Over the last week, we’ve started seeing a large number of orders that only have an entry with the state as DRAFT. An order with state equal to OPEN is never received. In our own testing, we have confirmed this occurs despite payment completing successfully.
An example of a payload with state equal to OPEN:
{
“merchant_id”: “MLBF9DKQDN81Q”,
“type”: “order.created”,
“event_id”: “a707034f-e7bf-339f-a903-468e21e427f5”,
“created_at”: “2024-08-26T20:22:47Z”,
“data”: {
“type”: “order”,
“id”: “Q0TlbtnnJJ698XcQNHOdRC5MT5JZY”,
“object”: {
“order_created”: {
“created_at”: “2024-08-26T20:22:47.332Z”,
“location_id”: “LBV8H9VDT5CV0”,
“order_id”: “Q0TlbtnnJJ698XcQNHOdRC5MT5JZY”,
“state”: “OPEN”,
“version”: 1
}
}
}
}
An example of a payload with state equal to DRAFT:
{
“merchant_id”: “MLBF9DKQDN81Q”,
“type”: “order.created”,
“event_id”: “80bc6a94-72d3-3924-9dbc-e99ba6c3efb8”,
“created_at”: “2024-08-26T20:20:15Z”,
“data”: {
“type”: “order”,
“id”: “sSFuHsibHyr5zK0y6XngZeMeQ6EZY”,
“object”: {
“order_created”: {
“created_at”: “2024-08-26T20:20:14.827Z”,
“location_id”: “LBV8H9VDT5CV0”,
“order_id”: “sSFuHsibHyr5zK0y6XngZeMeQ6EZY”,
“state”: “DRAFT”,
“version”: 1
}
}
}
}
Is there some other event we should be monitoring instead of orders.created? Why do some orders where payment is completed never publish an event with the order state set to OPEN?