Automations
Each event type has its own automation—a JavaScript function that runs when the event fires. You write the logic; Pulsify handles execution.
The handler function
Every automation follows the same pattern:
function handle(event, context) { // Your logic here return context; }
The function receives two arguments and returns the modified context.
The event object
The event object contains the notification data from Amazon.
Its shape depends on the event type, but common properties include:
-
event.type— notification type (e.g.,ANY_OFFER_CHANGED) event.asin— the affected ASIN-
event.marketplace— marketplace identifier (e.g.,ATVPDKIKX0DERfor US) event.timestamp— when the event occurred
For pricing events like ANY_OFFER_CHANGED:
event.buyBoxPrice— current Buy Box price in cents-
event.isWinner— whether you currently hold the Buy Box -
event.offers— array of competing offers with price, condition, and fulfillment channel event.lowestPrice— lowest offer price-
event.learnedPrice— Amazon's recommended competitive price (when available)
The context object
The context object contains your listing data and tools for
taking action. Modify it and return it to apply changes.
context.listing
Your listing's current state and settings:
context.listing.price— current price in cents-
context.listing.floor— minimum allowed price (guardrail) -
context.listing.ceiling— maximum allowed price (guardrail) context.listing.asin— the listing's ASINcontext.listing.sku— the listing's SKUcontext.listing.fba— whether fulfilled by Amazon
To change the price, call
context.listing.set({ price: newPrice }). Pulsify enforces
floor and ceiling automatically.
context.campaign
Control associated advertising campaigns:
-
context.campaign.enabled— whether the campaign is active context.campaign.enable()— enable the campaigncontext.campaign.pause()— pause the campaign
context.webhook
Send data to external systems:
-
context.webhook.post(data)— send a POST request to your configured webhook URL
Example
A simple repricing strategy that matches the Buy Box price when you're not winning:
function handle(event, context) { if (event.isWinner) { return context; // Already winning, do nothing } // Match Buy Box price if within guardrails if (event.buyBoxPrice >= context.listing.floor) { context.listing.set({ price: event.buyBoxPrice }); } return context; }
Templates
We provide starter templates for common strategies. Use them as-is or customize to match your needs. Templates are available in the automation editor when you create or edit an automation.