Callbacks

Listen for callback events on your API integrations so that you get notified when statuses of pending actions are updated.

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.

Begin using Xfers callbacks by:

  1. Creating a callback endpoint on your server.
  2. Registering the endpoint with Xfers on the Dashboard Developer Tools section.

When to use callbacks?

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.

Key considerations

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.

Also, make sure to securely receive callbacks from Xfers by checking against the signing secret for your account.


Did this page help you?