How to watch promotion changes?

Hi, I need a way to “watch” for changes in promotions, as in having a webhook being called when one is created or update, or something of the sort. In my case, the client needs some side effects to happen automatically when they update their promotions, is there a way to do that?

Hi @matheus.goulart

Unfortunately, VTEX doesn’t natively support webhooks for promotions.

You can periodically poll the VTEX API for promotion data using a custom scheduler and detect changes by comparing the results.

Step 1: Use VTEX’s Pricing API to list the current promotions
Step 2: Store a snapshot of the current promotions in a database
Step 3: Compare the latest API response with the previous snapshot
Step 4: Once a change is detected, invoke your custom logic to handle it.

1 Like