Xfers uses callbacks to notify your application when an event happens relevant to one of your API integrations. Callbacks are particularly useful for asynchronous events like when a customer’s bank transfer payment is confirmed.
- Creating a callback endpoint on your server.
- Registering the endpoint with Xfers on the Dashboard Developer Tools section.
Many events that occur from Xfers API calls have synchronous results that respond immediately. For example, a successful request to create a payment method immediately returns a Payment Method object. Such requests don’t require callbacks, as the key information is already available.
However, there are events that occur from an Xfers API call that are asynchronous, where the results only happen at a later time and not directly in response to your code’s execution. Most commonly these involve:
- Payments that require additional actions from your customer
- Verification of customer details
With these and similar APIs, Xfers will need to notify your application about changes to the status of an object so your integration can take subsequent steps.
For each event occurrence, Xfers POSTs the callback data to your endpoint in JSON format. The full event details are included and can be used directly after parsing the JSON.
Please make sure that your callback endpoint is able to receive data through a POST request and confirm successful receipt of that data by returning a HTTP 200 response.
Also, make sure to securely receive callbacks from Xfers by checking against the signing secret for your account.
Updated about 1 month ago