Webhooks allow Braintree to push messages to your servers when you configure a webhook endpoint URL. If you support new Braintree account signups in your Braintree Auth integration, you can subscribe to webhooks that provide status on important changes to the connected merchant's account.

We currently provide two webhooks for new Braintree merchant accounts created via Braintree Auth: underwriting status and PayPal account linking status.

We plan to develop several other webhooks in the future.

Before you get started

If you are not using webhooks already, follow the general webhooks guide to configure webhooks in your gateway.

note

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

Connected merchant underwriting status

This webhook notifies you when a connected merchant's underwriting status has changed or they have submitted an application:

PHP
Click to copy
Copied
$gateway = new Braintree\Gateway([
    'privateKey' => 'PRIVATE_KEY',
    'publicKey' => 'PUBLIC_KEY',
    'merchantId' => 'MERCHANT_ID',
    'environment' => 'sandbox'
]);

$notification = $gateway->webhookNotification()->parse(
    $btSignature,
    $btPayload
);

$notification->kind
// Braintree_WebhookNotification::CONNECTED_MERCHANT_STATUS_TRANSITIONED;

$notification->connectedMerchantStatusTransitioned->status;
// "approved"

$notification->connectedMerchantStatusTransitioned->merchantPublicId;
// "merchant_public_id"

$notification->connectedMerchantStatusTransitioned->oauthApplicationClientId;
// "oauth_application_client_id"

The following status transitions trigger a webhook:

Status Description
approved A merchant has been approved for a Braintree account. All funds from settled transctions will be disbursed to the merchant's bank account.
denied A merchant has been denied. All settled transactions will be refunded.
application_submitted A merchant has submitted their application to Braintree. The merchant can now accept payments to a limit - 25 transactions or up to $2500. Funds will not be disbursed until the merchant is approved.
under_review A merchant application is being reviewed.
inactive A merchant decided to not move forward with the underwriting process. This also occurs if a trial merchant has not submitted an application within 30 days of processing their first payment.

PayPal account status changed

This webhook notifies you when a connected merchant's PayPal account has been successfully linked or unlinked to their Braintree gateway.

PHP
Click to copy
Copied
$gateway = new Braintree\Gateway([
    'privateKey' => 'PRIVATE_KEY',
    'publicKey' => 'PUBLIC_KEY',
    'merchantId' => 'MERCHANT_ID',
    'environment' => 'sandbox'
]);

$notification = $gateway->webhookNotification()->parse(
    $btSignature,
    $btPayload
);

$notification->kind
// Braintree_WebhookNotification::CONNECTED_MERCHANT_PAYPAL_STATUS_CHANGED;

$notification->connectedMerchantPayPalStatusChanged->action;
// "link"

$notification->connectedMerchantPayPalStatusChanged->merchantPublicId;
// "merchant_public_id"

$notification->connectedMerchantPayPalStatusChanged->oauthApplicationClientId;
// "oauth_application_client_id"

The following linking actions trigger a webhook:

Action Description

See also

Next: Merchant API →

Still have questions?

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