Configures filtering rules applied to orders hook. Learn more with the orders hook guide.
There are two types of filtering that can be used. The FromWorkflow
type filters orders by status, whereas the FromOrders
type uses JSONata expressions to filter orders according to any property in the orders JSON document. This enables stores to filter delivered orders and orders in which products have been added or removed, for example.
To learn more, access the JSONata documentation and test filtering JSONata expressions with our expressions API.
Learn more with the Feed v3 guide.
Status avaible to filter |
---|
order-created |
on-order-completed |
payment-pending |
waiting-for-order-authorization |
approve-payment |
payment-approved |
request-cancel |
waiting-for-seller-decision |
authorize-fulfillment |
order-create-error |
order-creation-error |
window-to-cancel |
ready-for-handling |
start-handling |
handling |
invoice-after-cancellation-deny |
order-accepted |
invoice |
invoiced |
replaced |
cancellation-requested |
cancel |
canceled |
Learn more about Order Status in VTEX Help.
Response codes
200 - Success
400 - Bad Request - "Unable to check address" / "Only https scheme is accepted"
403 - The credentials are not enabled to access the service
404 - Value not found
429 - Too many requests
The status event will be removed, if it can't deliver a message more than 100 times, 4 days progressively.
Request body examples
FromWorkflow
{
"filter": {
"type": "FromWorkflow",
"status": ["order-completed", "handling", "ready-for-handling", "waiting-ffmt-authorization", "cancel"]
},
"hook": {
"url": "https://endpoint.example/path",
"headers": {
"key": "value"
}
}
}
FromOrders
{
"filter": {
"type": "FromOrders",
"expression": "status = \"payment-pending\"",
"disableSingleFire": false
},
"hook": {
"url": "https://endpoint.example/path",
"headers": {
"key": "value"
}
}
}
Response body example
{
"Domain": "Fulfillment",
"OrderId": "v52277740atmc-01",
"State": "ready-for-handling",
"LastState": "window-to-cancel",
"LastChange": "2019-08-14T17:11:39.2550122Z",
"CurrentChange": "2019-08-14T17:12:48.0965893Z",
"Origin": {
"Account": "automacaoqa",
"Key": "vtexappkey-appvtex"
}
}