Dodo Payments

Connect Dodo Payments as a payment provider in PayGlue.

A
André
Written By AndréLast updated about 5 hours ago

Dodo Payments is a merchant of record: it charges and files the tax for each buyer's country and pays you out once. When a reader buys a product or a subscription changes in Dodo, PayGlue creates or updates the matching Ghost member.

Prerequisites

Steps

1. Open the Dodo connection in PayGlue

In your PayGlue dashboard, go to Connections > Dodo Payments. Keep the page open: it shows the webhook URL you need in step 3, and the setup steps on the right side.

The Dodo Payments connection page in PayGlue, webhook key blacked out

2. Create an API key

In Dodo, go to Developer > API Keys and click Create New Key.

Dodo API Keys page with the Create New Key button

Give the key a name, for example PayGlue, and set Products to Read. Leave everything else on None. PayGlue only reads your products, to check the key and to list them in the buy button, paywall and pricing table editors.

Create API Key dialog with only Products set to Read

Click Create Key and copy the key. Dodo shows it only once.

3. Add a webhook endpoint

Go to Developer > Webhooks and click Add endpoint. Paste the webhook URL from your PayGlue connection page:

https://api.payglue.io/webhooks/dodo?tenant=YOUR-SLUG&key=YOUR-KEY

Copy it from PayGlue rather than typing it, the key at the end belongs to your organization.

Under Subscribed events, select these five:

  • payment.succeeded
  • subscription.active
  • subscription.renewed
  • subscription.cancelled
  • subscription.expired
Add endpoint dialog with the PayGlue URL and the five events selected

Click Create endpoint.

4. Copy the signing secret

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

Signing secret on the Dodo endpoint page

5. Enter the credentials in PayGlue

Back on the PayGlue connection page, fill in:

  • API Key, from step 2
  • Webhook Secret, the signing secret from step 4

Click Save credentials. Both fields show dots afterwards. Use Update next to a field to replace it.

6. Run a health check

Click Run health check. A green "Connection established" banner means PayGlue can read your Dodo account. The message also says whether the key is a test or a live key.

7. Offer your products

Go to Buy Button, Paywall or Pricing Table and pick your Dodo product from the dropdown. Choose the Ghost tier it unlocks and save. That creates the mapping PayGlue uses when the purchase arrives.

8. Test your setup

Buy one of your products in Dodo's test mode. Open Analytics > Webhook Events in PayGlue: the event should show as Processed, and the buyer should appear in Ghost Admin with the payglue-test label.

Supported events

Dodo event

PayGlue action

payment.succeeded

Grant access for a one-time purchase

subscription.active

Grant access when a subscription starts

subscription.renewed

Keep access after a renewal

subscription.cancelled

End access if the cancellation is effective now, otherwise nothing until the period ends

subscription.expired

End access

A subscription payment also arrives as payment.succeeded. PayGlue skips it, because the subscription events already carry it, and the event log shows it as Skipped.

Events you did not select, such as subscription.on_hold or subscription.paused, do not change access. Failed payments in particular never remove anybody, see Member lifecycle.

Cancellations

How a cancellation behaves depends on what you choose in Dodo:

  • Cancel at the end of the billing period: the reader keeps access until the paid period runs out. subscription.expired ends it then.
  • Cancel immediately: access ends as soon as subscription.cancelled arrives.

Test mode and live mode

Dodo keeps test and live mode apart, each with its own API keys and its own webhook endpoints. PayGlue recognises the mode from the API key, so there is no checkbox to set.

When you go live, switch Dodo to Live Mode, create a new API key and a new webhook endpoint there, and replace both values on the PayGlue connection page. Test members can be removed from Ghost Admin by filtering for the payglue-test label, see Test members.

Troubleshooting

Health check fails

Check that the key was copied in full and that it has Products: Read. A key without access to products fails the check.

Webhook shows as Failed in PayGlue

PayGlue rejects any delivery whose signature does not match. Most often the Webhook Secret in PayGlue belongs to a different endpoint, for example the test endpoint while the live one is sending. Copy the signing secret again from the endpoint that actually delivers.

In Dodo, Developer > Webhooks, open the endpoint to see every delivery attempt and the response PayGlue sent. Resend delivers a single event again.

Message attempts on a Dodo endpoint, with Resend buttons

Ghost member is not created after a purchase

Check that the product is offered in a buy button, paywall or pricing table. Without a mapping, PayGlue receives the event but has nothing to grant.


Webhook signature verification

Dodo signs webhooks with the Standard Webhooks scheme: an HMAC-SHA256 over the webhook-id, the webhook-timestamp and the raw body, sent in the webhook-signature header. PayGlue verifies it with your Webhook Secret, rejects deliveries older than five minutes, and uses the webhook-id to process each event only once.

Was this helpful?

Your feedback shapes what we write next.