availability

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

Notification kinds

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

  • WebhookNotification.Kind.OAUTH_ACCESS_REVOKED

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.

Attributes

getKind() enum

The kind of webhook notification.

getTimestamp() date

The UTC date/time at which the webhook was triggered.

getMerchantId() string

The ID of the connected merchant.

getOauthApplicationClientId() string

The OAuth application client ID.

OAuth access revoked

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

Java
Copy
Copied
BraintreeGateway gateway = new BraintreeGateway(
  Environment.SANDBOX,
  "use_your_merchant_id",
  "use_your_public_key",
  "use_your_private_key"
);

WebhookNotification notification = gateway.webhookNotification().parse(
  btSignature,
  btPayload
);

notification.getKind()
// WebhookNotification.Kind.OAUTH_ACCESS_REVOKED

notification.getOAuthAccessRevocation().getMerchantId()
// "merchant_id"

Still have questions?

If you can’t find an answer, contact us