Configure Webhooks

Last updated: Aug 15th, 7:47am

Webhooks are HTTP callbacks that receive notification messages for events. To create a webhook at PayPal, users configure a webhook listener and subscribe it to events. A webhook listener is a server that listens at a specific URL for incoming HTTP POST notification messages that are triggered when events occur. PayPal signs each notification message that it delivers to your webhook listener.

After you configure a listener, you can use a sample payload to simulate a webhook event. When you simulate an event, the simulator validates that your listener can successfully receive event data without any connectivity issues and generates mock event data to show you how webhook events look. You cannot verify these mock events.

After you validate your listener, you can subscribe your listener to events. When you subscribe your listener to events, you define:

A list of eventsAn event can be a payment authorization, a payment state change, and so on. To determine to which events to subscribe, review the supported webhook event names.
Your webhook listener URLA webhook listener is a server that you configure at a specific web URL to listen for incoming HTTP POST notification messages that are triggered when those events occur. PayPal signs each notification message that it delivers to your web URL.

Finally, verify the notifications that your listener receives when events occur.

Webhooks are asynchronous, their order is not guaranteed, and idempotency might lead to a duplicate notification of the same event type.

Integration steps

To configure your webhook listener to receive notification messages for payment state changes and other events:

1.RequiredSet up your development environment.
2.RequiredConfigure a webhook listener.
3.OptionalValidate your listener configuration with mock webhook events.
4.RequiredSubscribe to events.
5.RequiredVerify event notifications.

Set up your development environment

Before you can integrate Webhooks, you must set up your development environment. After you get a token that lets you access protected REST API resources, you create sandbox accounts to test your web and mobile apps. For details, see Get started.

Then, return to this page to integrate Webhooks.

Configure a webhook listener

A webhook listener is a server that listens at a specific URL for incoming HTTP POST notification messages that are triggered when events occur. After you configure a listener, note the URL for the listener.

Use this URL to:

  • Simulate mock webhook events to validate your listener configuration.
  • Subscribe your webhook listener to events.

Next, optionally validate your listener configuration with mock webhook events.

Validate your listener configuration with mock webhook events

After you configure a listener, you can use a sample payload to simulate a webhook event. When you simulate an event, the simulator:

  • Validates that your listener can successfully receive event data without any connectivity issues.

  • Generates mock event data to show you how webhook events look.

After the simulator queues one or more mock events, your webhook listener URL can listen for HTTP POST notification messages. Each test event appears in your logs in the order that your listener receives them. The simulator sends mock static event data and event headers, which contain the PayPal-generated asymmetric signature and information that you can use to validate the signature.

To simulate a webhook event, use either:


Next, subscribe your listener to events.

Subscribe to events

To subscribe your webhook listener to events, use either the Developer Dashboard or the Webhooks API.

To use the dashboard to subscribe to events

  1. Log in to the Developer Dasbhoard.

  2. Create an app to generate your API credentials and subscribe to webhook events. If you already have an app, proceed to the next step.

  3. In the REST API apps section, click the link for the app to which you want to subscribe events.

  4. In the webhooks section, click Add Webhook.

  5. Add the URL for your listener, which is the endpoint URL that listens for incoming HTTP POST notification messages triggered when events occur.

  6. From the Event types list, select the events to which to subscribe your app. You can select either all events or one or more individual events.

  7. Click Save. The dashboard shows your webhook listener URL, the ID for the webhook, and the events to which you subscribed your app.

    You can use this webhook ID to complete these Webhooks API operations:

Verify event notifications

You can verify webhook event notifications that your listener receives when events occur.

When you verify events, you can list webhook events by app. You can filter this list by date range, resource, and event type. You can also show status and details for an event and resend an event notification.

To verify webhook event notifications, use one of these methods:

To use the dashboard to verify event notifications

  1. Depending on your environment, go to either the Live Webhooks Events dashboard or the Sandbox Webhooks Events dashboard.

  2. Click Log In.

  3. From the drop-down list, select the app for which to view webhook events.

  4. Optionally, you can filter the list of webhook events by:

    • Date range. The range must be in the last 30 days.
    • A resource. Specify the ID for a sale, authorization, or other resource.
    • An event. From the drop-down list, select either all events or one or more individual events.

    The dashboard shows events for the app, date range, resource, and event or events.

  5. You can complete these actions on the Webhooks Events page:

    • View the status for events. Received events show a green check mark and pending events show a yellow exclamation point.
    • Resend a notification. Click Resend next to any webhook event in the list.
    • Navigate the results pages. Click the arrows adjacent to the page number at the bottom of the page.
    • View event details. Click an event. Details include event ID, resource type, and summary.

Webhooks events for Marketplaces and Platforms

When you send a transaction to PayPal for a seller who has not completed their account setup, the status of the transaction is set to pending. PayPal sends a PAYMENT.CAPTURE.PENDING webhook with the reason code seller_setup_pending.

Once the seller has completed PayPal account setup, PayPal sends these webhooks:

  • PAYMENT.CAPTURE.COMPLETED to indicate that the payment capture has changed from pending to completed.
  • MERCHANT.ONBOARDING.COMPLETED to indicate that the seller has completed account setup. You can subscribe to webhooks to be alerted when a seller's account setup is complete.

PayPal also sends the MERCHANT.PARTNER-CONSENT.REVOKED webhook when the seller account is closed, or the account setup consents have been revoked.

To see whether your seller has been granted the capability to accept credit card payments, you can subscribe to the merchant integration webhooks:

  • CUSTOMER.MERCHANT-INTEGRATION.PRODUCT-SUBSCRIPTION-UPDATED is triggered when a product subscription is updated.
  • CUSTOMER.MERCHANT-INTEGRATION.CAPABILITY-UPDATED is triggered when capabilities to an integration are updated.

For more information about these webhook events, see Webhook event names.

Webhooks events for Billing Agreements

The Billing Agreements API creates an agreement for a recurring PayPal or debit card payment for goods or services.

This integration includes 2 webhook events:

EventTriggerRelated method
BILLING_AGREEMENTS.AGREEMENT.CREATEDA reference transaction agreement is created.Create agreement
BILLING_AGREEMENTS.AGREEMENT.CANCELLEDA reference transaction agreement is cancelled.Cancel agreement

Subscribe to billing agreement webhooks

Make a POST call to the Webhooks API to subscribe to Billing Agreement webhook events:

    1curl -v -X POST https://api-m.paypal.com/v1/notifications/webhooks -H 'Content-Type: application/json' -H 'PayPal-Request-Id: UNIQUE-CALL-ID' -H 'Authorization: Bearer PARTNER-ACCESS-TOKEN' -H 'PayPal-Partner-Attribution-Id: BN-CODE' -d '[
    2 {
    3 "url": "https://example.com/example_webhook",
    4 "event _types": [
    5 {
    6 "name": "BILLING_AGREEMENTS.AGREEMENT.CREATED"
    7 },
    8 {
    9 "name": "BILLING_AGREEMENTS.AGREEMENT.CANCELLED"
    10 }
    11 ]
    12 }
    13]'

    More information

    We use cookies to improve your experience on our site. May we use marketing cookies to show you personalized ads? Manage all cookies