Webhooks

OAuthanchor

availability

OAuth is in closed beta in production, and open beta in sandbox. Contact us to express interest in the production beta release.

Notification kindsanchor

The notification kind, returned by calling Kind on the notification object, reveals what triggered the webhook. The WebhookNotification.Kind for OAuth webhooks will be one of the following:

  • WebhookKind.OAUTHACCESSREVOKED

The following table describes the conditions that trigger each kind of webhook.

Notification Type Description
oauth_access_revocation

A connected merchant has revoked API access.

Attributesanchor

Kindenum

The kind of webhook notification.

Timestampdate

The UTC time at which the webhook was triggered.

MerchantIdstring

The ID of the connected merchant.

OauthApplicationClientIdstring

The OAuth application client ID.

OAuth access revokedanchor

Below is a full example of how to trigger a webhook when a connected merchant has revoked access to their account.

  1. C#
var gateway = new BraintreeGateway
{
  Environment = Braintree.Environment.SANDBOX,
  MerchantId = "use_your_merchant_id",
  PublicKey = "use_your_public_key",
  PrivateKey = "use_your_private_key"
};

WebhookNotification notification = gateway.WebhookNotification.Parse(
  btSignature,
  btPayload
);

notification.kind;
// WebhookKind.OAUTH_ACCESS_REVOKED

notification.OAuthAccessRevocation.MerchantId
// "merchant_id"