Orders Feed Example
A boilerplate app implementing an event handler receiving status updates from OMS Feed. This is the method for using Feed v3 Hook inside VTEX IO.
How to Use
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 theallStates
handler doesReceive a selection of status changes where the
currentState
equals thetopic
, as thesomeStates
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 this documentation.
Last updated