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

# Creem

> Connect Creem as a payment provider in PayGlue.

Creem is a merchant of record — it handles tax collection and compliance on your behalf. When a customer completes a checkout or a subscription event happens in Creem, PayGlue automatically creates or updates the matching Ghost member.

## Prerequisites

* A Creem account at [creem.io](https://www.creem.io) with at least one product created
* A Ghost blog connected in PayGlue ([Connect Ghost](/ghost/connect))

## Steps

<Steps>
  <Step title="Create an API key">
    In your Creem dashboard, go to **Developers > API Keys** and create a new key.

    > \[Screenshot — Creem Developers → API Keys: Create key button and resulting key field]

    Copy the key — it starts with `creem_`.
  </Step>

  <Step title="Add a webhook endpoint">
    Go to **Developers > Webhooks**, click **Add endpoint**, and paste the webhook URL from your PayGlue Creem connection page:

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

    Replace `YOUR-SLUG` with your PayGlue organization slug.

    Select the checkout and subscription events (`checkout.completed`, `subscription.paid`, `subscription.active`, `subscription.canceled`, `subscription.expired`).

    > \[Screenshot — Creem Developers → Webhooks: Add endpoint form with URL and events selected]
  </Step>

  <Step title="Copy the signing secret">
    After saving the endpoint, Creem shows a **signing secret**. Copy it — you will need it in the next step.

    > \[Screenshot — Creem: saved webhook endpoint with signing secret field visible]
  </Step>

  <Step title="Enter credentials in PayGlue">
    In your PayGlue dashboard, go to **Connection > Creem** and fill in:

    * **API Key** — from Step 1
    * **Webhook Secret** — the signing secret from Step 3

    Tick **This is a Creem sandbox/test connection** if you're testing against Creem's sandbox environment. PayGlue then uses `test-api.creem.io` instead of `api.creem.io` for API calls.

    > \[Screenshot — PayGlue dashboard: Creem connection page with API Key, Webhook Secret, and sandbox checkbox]

    Click **Save credentials**.
  </Step>

  <Step title="Run a health check">
    Click **Run health check** to confirm PayGlue can reach your Creem account. A green "Connection established" banner means everything is working.
  </Step>

  <Step title="Create a mapping">
    Go to **Buy Button**, **Paywall**, or **Pricing Table** in your PayGlue dashboard and select your Creem product from the dropdown. Choose which Ghost newsletter to subscribe the buyer to and which welcome email to send, then save.
  </Step>

  <Step title="Test your setup">
    Make a test purchase or subscription on one of your Creem products. Then open **Analytics > Webhook Events** in your PayGlue dashboard — the event should appear with status **Processed** and the buyer's email should appear as a new member in Ghost Admin.
  </Step>
</Steps>

## Supported events

| Creem event             | PayGlue action                          |
| ----------------------- | --------------------------------------- |
| `checkout.completed`    | Create Ghost member (one-time purchase) |
| `subscription.paid`     | Confirm active Ghost member (renewal)   |
| `subscription.active`   | Grant Ghost membership                  |
| `subscription.canceled` | Revoke Ghost membership                 |
| `subscription.expired`  | Revoke Ghost membership                 |

## Sandbox mode

Tick the sandbox checkbox on the Creem connection page when testing. PayGlue then talks to `test-api.creem.io` instead of the live API, and expects sandbox checkout/subscription events from the same webhook endpoint. Remove test members from Ghost Admin before switching to live credentials.

## Troubleshooting

**Health check fails after saving credentials**

Confirm the API key was copied in full from **Developers > API Keys** and that the sandbox checkbox matches the key's environment (a live key will fail the health check while sandbox mode is ticked, and vice versa).

**Webhook shows as Failed in Analytics**

Creem signs every webhook delivery with the `creem-signature` header — unlike some other providers, PayGlue treats a missing or invalid signature as a hard failure. Check that the Webhook Secret in PayGlue matches the signing secret shown on the endpoint in Creem exactly.

**Ghost member is not created after purchase**

Confirm there is an active mapping for the Creem product in the Buy Button, Paywall, or Pricing Table editor. PayGlue receives the event but takes no action without a mapping.

***

## Webhook signature verification

Creem signs every webhook delivery with an HMAC-SHA256 signature over the raw request body, sent in the `creem-signature` header. PayGlue verifies this signature using your Webhook Secret and rejects any delivery with a missing or mismatched signature.
