> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PayGlue

> Sell Ghost memberships and one-time access with Dodo Payments. PayGlue turns each Dodo Payments purchase into a Ghost member and removes access when a subscription ends.

## Introduction

[PayGlue](https://payglue.io) connects Dodo Payments to a [Ghost](https://ghost.org) publication, so you can sell memberships, subscriptions, and one-time access on Ghost with Dodo Payments as the Merchant of Record. When a reader buys, PayGlue creates or updates the matching Ghost member. When a subscription ends, PayGlue removes the paid access.

Ghost supports only Stripe for paid memberships. PayGlue adds Dodo Payments alongside it, so an existing Ghost and Stripe setup keeps working. Checkout runs on Dodo Payments, and PayGlue receives only the signed webhook events after each purchase.

## How It Works

PayGlue reads your products through a Dodo Payments API key and receives purchase events through a webhook endpoint:

1. You map each Dodo Payments product to a PayGlue buy button, paywall, or pricing table on your Ghost site.
2. A reader buys the product on Dodo Payments checkout.
3. Dodo Payments sends a signed webhook to PayGlue.
4. PayGlue verifies the signature and creates the Ghost member, or updates the member's access.

PayGlue verifies every delivery with the [Standard Webhooks](https://www.standardwebhooks.com/) signature, and uses the `webhook-id` header to process each event only once.

## Prerequisites

Before you start, you need:

* A [Dodo Payments account](https://app.dodopayments.com) with at least one product.
* A [PayGlue account](https://payglue.io) with your Ghost publication connected.

## Getting Started

**1. Open the Dodo Payments Connection in PayGlue**

In your PayGlue dashboard, go to **Connections → Dodo Payments**. Keep this page open. It shows the webhook URL you need in a later step.

**2. Create an API Key**

In the Dodo Payments dashboard, go to **Developer → API Keys** and click **Create New Key**. Name the key `PayGlue`, set **Products** to **Read**, and leave every other resource on **None**. PayGlue reads your products to check the key and to list them in its editors.

![Create API Key dialog in the Dodo Payments dashboard with the key named PayGlue and only Products set to Read](https://mintcdn.com/dodopayments/pyiD95-Isg2felHc/images/integrations/payglue/create-api-key.png?fit=max\&auto=format\&n=pyiD95-Isg2felHc\&q=85\&s=3581d62a3e6a6e357673519e3742b030)

Click **Create Key** and copy the key. Dodo Payments shows the key only once. For details, see [Authentication](https://docs.dodopayments.com/api-reference/introduction.md#authentication).

**3. Add a Webhook Endpoint**

Go to **Developer → Webhooks** and click **Add endpoint**. Paste the webhook URL from your PayGlue connection page. Copy the URL instead of typing it, because the key at the end belongs to your publication.

```text theme={null}
https://api.payglue.io/webhooks/dodo?tenant=YOUR-SLUG&key=YOUR-KEY
```

Under **Subscribed events**, select these five events, then click **Create endpoint**:

* `payment.succeeded`
* `subscription.active`
* `subscription.renewed`
* `subscription.cancelled`
* `subscription.expired`

![Add endpoint dialog in the Dodo Payments dashboard with the PayGlue webhook URL and the subscription events selected](https://mintcdn.com/dodopayments/pyiD95-Isg2felHc/images/integrations/payglue/add-endpoint.png?fit=max\&auto=format\&n=pyiD95-Isg2felHc\&q=85\&s=32ed686bf44023c5806be9e97e18fa68)

**4. Copy the Signing Secret**

Open the endpoint you created. Under **Signing secret**, click the copy icon. The secret starts with `whsec_`.

![Signing secret card on a Dodo Payments webhook endpoint with the secret masked and a copy icon](https://mintcdn.com/dodopayments/pyiD95-Isg2felHc/images/integrations/payglue/signing-secret.png?fit=max\&auto=format\&n=pyiD95-Isg2felHc\&q=85\&s=3dc8e9bcca3591a2398c732aa0c175c6)

**5. Save the Credentials in PayGlue**

On the PayGlue connection page, enter the API key in **API Key** and the signing secret in **Webhook Secret**. Click **Save credentials**.

**6. Run a Health Check**

Click **Run health check**. A green **Connection established** banner means PayGlue can read your Dodo Payments account. The banner also shows whether the key is a test mode or live mode key.

![Dodo Payments connection page in PayGlue showing the webhook URL, saved credentials, and the Connection established banner](https://mintcdn.com/dodopayments/pyiD95-Isg2felHc/images/integrations/payglue/connection.png?fit=max\&auto=format\&n=pyiD95-Isg2felHc\&q=85\&s=05b1ae85c7f388f25d20ec303eaa560b)

**7. Offer Your Products**

In PayGlue, go to **Features → Buttons**, **Paywall**, or **Pricing Table** and select your Dodo Payments product. Choose **One-time** or **Subscription**, set the newsletter and welcome email options, and save. This creates the mapping PayGlue uses when a purchase arrives.

**8. Test the Setup**

Buy one of your products in test mode.

> [!TIP]
>
> In PayGlue, open **Analytics → Webhook Events**. The event shows as **Processed**, and the buyer appears in Ghost Admin with the `payglue-test` label.

## Supported Events

PayGlue acts on each subscribed event as follows:

| Event | PayGlue action |
| :- | :- |
| `payment.succeeded` | Grants access for a one-time purchase |
| `subscription.active` | Grants access when a subscription starts |
| `subscription.renewed` | Keeps access after a renewal |
| `subscription.cancelled` | Ends access if the cancellation takes effect immediately |
| `subscription.expired` | Ends access |

A subscription purchase also sends `payment.succeeded`. PayGlue skips that event because the subscription events already cover it, and its event log shows it as **Skipped**. Events you don't subscribe to, such as `subscription.on_hold`, don't change access. A failed payment doesn't remove a member.

## Cancellations

Access after a cancellation follows the cancellation type in Dodo Payments:

* **Cancel at the end of the billing period**: The reader keeps access until the paid period ends. PayGlue removes access when `subscription.expired` arrives.
* **Cancel immediately**: PayGlue removes access when `subscription.cancelled` arrives.

## Going Live

Test mode and live mode have separate API keys and separate webhook endpoints. PayGlue detects the mode from the API key, so there is no mode setting in PayGlue.

To go live, turn on **Live Mode** in the Dodo Payments dashboard, then create a new API key and a new webhook endpoint with the same five events. Replace both the API key and the webhook secret on the PayGlue connection page. To remove test members, filter Ghost Admin by the `payglue-test` label.

## Troubleshooting

> **The health check fails**
>
> Check that you copied the full API key and that the key has **Read** access to **Products**. A key without access to products fails the check.

> **Webhooks show as Failed in PayGlue**
>
> PayGlue rejects any delivery with a signature that doesn't match. This usually means the webhook secret in PayGlue belongs to a different endpoint, such as the test mode endpoint while the live mode endpoint sends events. Copy the signing secret again from the endpoint that sends the events.
>
> To see each delivery attempt and PayGlue's response, open the endpoint in **Developer → Webhooks**. Use **Resend** to deliver a single event again.
>
> ![Message attempts table on a Dodo Payments webhook endpoint with delivery status, response codes, and Resend buttons](https://mintcdn.com/dodopayments/pyiD95-Isg2felHc/images/integrations/payglue/message-attempts.png?fit=max\&auto=format\&n=pyiD95-Isg2felHc\&q=85\&s=affe126ca136a1f8f222579e6fc76e40)

> **No Ghost member is created after a purchase**
>
> Check that the product is mapped to a buy button, paywall, or pricing table in PayGlue. Without a mapping, PayGlue receives the event but has no access to grant.

## Additional Resources

> **[PayGlue Dodo Payments Guide](https://docs.payglue.io/providers/dodo)**
>
> The setup guide in PayGlue's help center, with screenshots of each step.

> **[Subscription Webhooks](https://docs.dodopayments.com/developer-resources/webhooks/intents/subscription.md)**
>
> The subscription events Dodo Payments sends and their payloads.

> [!NOTE]
>
> For help with the integration, contact PayGlue at [team@payglue.io](mailto:team@payglue.io) or Dodo Payments support at [support@dodopayments.com](mailto:support@dodopayments.com).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.