Skip to content

Automatic Payment Notifications

Payment notification webhooks allow for automatic invoice payment updates from PayPal, Coinbase Commerce and Stripe.

Prerequisites

This guide is intended for advanced users only.

You will require:

  • a server with full root access;
  • be able to open ports on your server in order to allow external communication with the bots internal Rest API;
  • a valid SSL certificate (or a service that provides you one, like Cloudflare).

WARNING

If you can't expose the webhook (for any of the reasons outlined above), you will still be able to create & manage invoices, however their status won't update automatically.

You can update their status manually using /invoice refresh every once in a while.

If this solution is fine with you, you can skip this guide.

This guide assumes the basic installation & payment guides have been followed.

Terminology

Both PayPal and Coinbase Commerce send events (like updates to payments) to your bot's API via webhooks.

This means that the platform will send a POST request to your bot's URL, which will then update the invoice's status.

Read more about webhook-driven event updates 🡥

The bot's API must thus be enabled & open to the public and accessible from the internet. It must also run on HTTPS (SSL), as per PayPal's, Stripe's and Coinbase's requirements.

You can achieve this in multiple ways, for example by proxying the website through Cloudflare or providing your own key & certificate files.

Port Reference

By default, the bot exposes the API endpoint on port 2020 for HTTP and 2021 for HTTPS (using key.pem and cert.pem files). Ports can be configured in your config.yml file, under the api section.

We recommend setting up a reverse proxy using NGINX or Apache to proxy the bot's API to a subdomain.

Before configuring PayPal, Coinbase or Stripe webhooks make sure the API works by visiting the root endpoint (/) in your browser.

Set up

TIP

The endpoint for PayPal invoice updates is available at /ipn/paypal.

The endpoint for Coinbase Commerce payment updates is available at /ipn/coinbase.

The endpoint for Stripe payment updates is available at /ipn/stripe.

Configuration on PayPal:

  1. Go to the PayPal Developer Dashboard, switch the mode over to Live and click on Apps & Credentials.
  2. Select your app from the list.
  3. Create a webhook with the URL of your bot's API, followed by the endpoint, as shown: PayPal webhook example 1PayPal webhook example 2 When asked which events to track, select "All Events". PayPal webhook example 3

Configuration on Coinbase Commerce:

  1. Login to Coinbase Commerce.
  2. Navigate to Settings by clicking on your profile picture.
  3. Navigate the tab to "Notifications"
  4. Create a webhook with the URL of your bot's API, followed by the endpoint, as shown: Coinbase webhook example 1Coinbase webhook example 2

Configuration on Stripe:

  1. Go to the Stripe Dashboard and make sure the Test mode switch is Off.
  2. Navigate to the webhooks tab.
  3. Click "Add an endpoint".
  4. Insert the URL of your bot's API, followed by the endpoint, as shown: Stripe webhook example 1 When asked which events to listen to, find and select "invoice.paid". Stripe webhook example 2 Copy the webhook signing secret and insert it into your config.yml: Stripe webhook example 3