availability

This feature is only available if Braintree manages the funding for your merchant account. Contact our Support team to find out if your account is eligible.

Once you're set up to receive webhooks, you can collect information from them to create reports based on different triggers. For example, you could collect the information on notifications for:

  • Subscription Canceled to create a report for customer subscription cancelations
  • Dispute Opened and compare that to your transactions sales to create a report on your chargeback ratio
  • Disbursement to create a funding report

General workflow

  • Set up at least one destination URL to receive webhooks from the gateway
  • Parse the contents of the webhook notifications
  • Create logic to store the details of the WebhookNotification objects for a specific kind of trigger

Disbursements

Disbursement webhooks are a bit different from other webhooks. Each disbursement or disbursement exception webhook includes a disbursement object. This object can't be retrieved from the gateway in any other way, unlike transactions or subscriptions.

note

For triggering disbursement exceptions in sandbox, see Sandbox Disbursement Exceptions.

Transactions associated with a disbursement

note

The bt_signature and bt_payload variables in the code snippets below represent parameters received from the webhook POST request. For more information, read the documentation on parsing webhooks.

To find all transactions associated with a given disbursement, you can parse the disbursement webhook notification and use the data in the payload to perform a transaction search:

Ruby
Copy
Copied
webhook_notification = Braintree::WebhookNotification.parse(
  bt_signature,
  bt_payload
)

transactions = webhook_notification.disbursement.transaction_ids

search_results = Braintree::Transaction.search do |search|
  search.ids.in transactions
end

See Search Results for more information.

See also

Still have questions?

If you can’t find an answer, contact our Support team.