Orders Feed Example
Last updated
Last updated
A boilerplate app implementing an event handler receiving status updates from OMS Feed. This is the method for using inside VTEX IO.
This app handles events sent by the app vtex.orders-broadcast
, as you can see by looking at node/service.json
.
You have two ways of consuming changes in status:
Receive all events subscribing to the order-status-updated
topic, as the allStates
handler does
Receive a selection of status changes where the currentState
equals the topic
, as the someStates
handler does. This option is the preferred one, when you know ahead of time, what types of events, you want to listen to.
Normally vtex.orders-broadcast
sends events only in master
workspace. If you want to use it in a developer workspace, do the following:
Create your development workspace by running vtex use {workspaceName}
Go to https://{accountName}.myvtex.com/admin/apps/vtex.orders-broadcast/setup
Change the Target Workspace
variable to the name of the workspace you have created previously.
Now you can link this app (vtex.orders-feed-example
) in your desired workspace and receive order status updates.
Here is an example body that you can expect to receive:
If you want to understand further how Feed v3 works, check out .