Listen for purchase events
Retrieve API key
Go to the Coinflow Admin Dashboard. On the automation tab, you’ll find your API Key. If you don’t have one yet, generate a new one to get started. Copy the key for use in the next step.
Configure webhook settings
Enter your API route that will receive notifications. Ensure the version is set to version 2 (Coinflow’s recommended version) and the ‘Settled’ box is checked. If you care to listen to other events, feel free to check more event boxes.
Create a POST request
In your server, create a route that accepts a POST request on the same route you configured in your admin dashboard. This route will receive notifications.
Extract data from the request
The request body will contain the event type, timestamp and data of the notification. The data object will depend on the event type.
Validate authorization
Make sure the Authorization header in this request is equal to your API Key to validate that this request is coming from Coinflow
Pass in ‘webhookInfo’ on frontend
To provide extra data to your webhook, add a ‘webhookInfo’ param to the CoinflowPurchase component on the frontend. This can also be passed in a purchase API request.
Return status 200
Ensure to return status 200 from your endpoint or Coinflow will keep retrying for 36 hours

