Webhooks (Payments Brazil)

Check out how to set up a webhooks for our payment initiation solution!

A webhook is a web callback that Belvo uses to send notifications about a specific link.

📘

This article is about webhooks for our Payment Initiation solution. For information regarding our Aggregation and Enrichment webhooks, check out this article.

Set up webhooks

To set up a new webhook:

  1. In your Belvo dashboard, go to the payment webhooks section.

  2. In the Open Payments Webhooks tab, click +New webhook.

  3. Fill in the New webhook form with the required information.

    • URL: the URL to receive the webhook notifications.
    • Authorization: an optional bearer token to use if your URL is protected.
  4. Click Create webhook.

Webhook types

All webhook events come with a core payload (as described in the code example below).

{
  "webhook_id": "aadf41a1fc8e4f79a49f7f04027ac999",
  "webhook_type": "TRANSACTIONS",
  "webhook_code": "STATUS_UPDATE",
  "object_id": "16f68516-bcbc-4cf7-b815-c500d4204e28",
  "data": {
    "status": "FAILED",
    "failure_code": "consent_expired",
    "failure_message": "The payment consent was not accepted in time.",
    "end_to_end_id": "E432158152024081610416f2b595b056",
    "metadata": { "internal_reference_id": "GGq12345w2" }
  }
}

ParameterRequiredTypeDescriptionExample
webhook_idtruestringThe Belvo webhook ID.aadf41a1fc8e4f79a49f7f04027ac999
webhook_typetruestringThe resource that this webhook relates to.CHARGES
webhook_codetruestringThe event that triggered the webhook.STATUS_UPDATE
object_idtruestringThe ID of the object (charge, payment intent, or transaction) this webhook relates to.d2e40773-19f6-48d1-93c3-3590ec0c74df
datatrueobjectAn object containing specific data about the event. The fields returned in this object depend on the webhook_type and webhook_code.See following rows.
data.statusfalsestringThe status of the charge or payment intent.FAILED
data.failure_codefalsestringIn the case that the charge or payment intent failed, a unique code for the error.consent_expired
data.failure_messagefalsestringIn the case that the charge or payment intent failed, a human-readable description of the error.The payment consent was not accepted in time.
data.end_to_end_idfalsestringThe ID of the payment in Brazil's payment system.E432158152024081610416f2b595b056
data.metadatafalseobjectIf you provided any information in the metadata object when creating your payment, it is included in the webhook body.{ "internal_reference_id": "GGq12345w2" }

For information about the data specific to a given webhook, click on the webhook type in the table below.

TypeEventSent whenever...
CHARGESSTATUS_UPDATEThere is an update to the status of a payment intent
PAYMENT_INTENTSSTATUS_UPDATEThere is an update on the status of a payment intent.
TRANSACTIONSOBJECT_CREATEDThere is a new transaction created.

Webhook outbound IP addresses

You can receive webhook events from the following IP addresses:

  • 3.130.254.46
  • 18.220.61.186
  • 18.223.45.212

👍

We highly recommend you whitelist these IP addresses so that you can receive webhook events.


Client-side webhook response best practice

We highly recommend that once you receive a webhook you reply to Belvo with a 2XX status code within five seconds to confirm that you have received the webhook. Otherwise, our API will retry the request.

Webhook retry policy

If our system does not receive 2XX status code, it automatically tries to send the request again. This retry process will happen up to three times, with each attempt spaced 60 seconds apart. For example, if the first attempt fails, our system waits for 60 seconds before trying again and will continue this pattern until it either receives a successful response or reaches the maximum of three retries.