# Mollie payment received notifications on your phone

> Get a push notification with the amount, method and customer every time a Mollie payment is paid.

- Company: Mollie (https://www.justpush.io/recipes/mollie)
- Event: `payment.paid` (payment.paid)
- Tags: Finance, Payments
- Install: https://studio.justpush.io/recipes/mollie/payment-paid
- Web page: https://www.justpush.io/recipes/mollie/payment-paid

## Setup

1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
2. In the Mollie Dashboard, go to Developers > Webhooks and create a new webhook.
3. Paste your webhook URL (shown in Studio after install) as the URL and select the payment.paid event.
4. Choose the full payload (so the payment details are included) and save.
5. This recipe needs a **next-gen** webhook (Developers > Webhooks), set to send the **full payload**. Classic webhooks (the `webhookUrl` you pass when creating a payment) only send the payment ID, so they can't produce a useful notification.
6. Mollie signs next-gen webhooks with an `X-Mollie-Signature` header, but JustPush doesn't check it yet, so keep your endpoint URL private.

## Code

Studio calls `handleRequest(request)` with the incoming webhook (`{ method, headers, body, query, raw }`) and sends the message object it returns. Returning `null` sends nothing.

```js
// Mollie → payment.paid
// Fires when a payment is paid.
// Docs: https://docs.mollie.com/reference/webhooks-new
//
// Needs a next-gen Mollie webhook (Developers > Webhooks) for the "payment.paid" event,
// set to send the full payload, pointing at the integration's endpoint URL.

// Mollie amounts are objects with a decimal string: { value: "10.00", currency: "EUR" }.
// Returns null when there's no amount.
function money(amount) {
    const value = Number(amount?.value)

    if (amount?.value == null || !Number.isFinite(value) || !amount.currency) return null

    try {
        return new Intl.NumberFormat("en-GB", { style: "currency", currency: amount.currency }).format(value)
    } catch {
        return `${amount.value} ${amount.currency}`
    }
}

// Friendlier names for Mollie's payment method IDs.
const METHODS = {
    ideal: "iDEAL",
    creditcard: "card",
    bancontact: "Bancontact",
    paypal: "PayPal",
    applepay: "Apple Pay",
    banktransfer: "bank transfer",
    directdebit: "direct debit",
    klarna: "Klarna",
    in3: "iDEAL in3",
    twint: "TWINT",
    blik: "BLIK",
    przelewy24: "Przelewy24",
    eps: "EPS",
}

function handleRequest(request) {
    const event = request.body

    // Guard: only handle this event type, so other Mollie events on this integration stay quiet.
    if (event?.resource !== "event" || event.type !== "payment.paid") {
        console.log(`Ignoring Mollie event "${event?.type ?? "unknown"}"`)
        return null
    }

    // Next-gen webhooks only include the object when "full payload" is chosen.
    const entity = event._embedded?.entity

    if (!entity) {
        console.log("No embedded entity — set the webhook to send the full payload")
        return null
    }

    const method = entity.method ? ` via ${METHODS[entity.method] ?? entity.method}` : ""
    const who = entity.details?.consumerName ?? entity.details?.cardHolder
    const test = entity.mode === "test" ? " (test mode)" : ""
    const dashboard = entity._links?.dashboard?.href

    return {
        title: "💰 Payment received",
        message:
            (money(entity.amount) ?? "A payment") +
            method +
            (who ? ` from ${who}` : "") +
            (entity.description ? ` — ${entity.description}` : "") +
            test,
        topic: "Mollie",
        priority: 0, // Normal — money in is good news, not an emergency
        sound: "cashregister",
        buttons: dashboard ? [{ cta: "View payment", url: dashboard }] : [],
    }
}
```

## Mollie payment.paid webhook payload (sample)

```json
{
  "id": "event_GvJ8WHrp5isUdRub9CJyH",
  "type": "payment.paid",
  "_links": {
    "documentation": {
      "href": "https://docs.mollie.com/reference/webhooks-new",
      "type": "text/html"
    }
  },
  "entityId": "tr_7UhSN1zuXS",
  "resource": "event",
  "_embedded": {
    "entity": {
      "id": "tr_7UhSN1zuXS",
      "mode": "live",
      "_links": {
        "self": {
          "href": "https://api.mollie.com/v2/payments/tr_7UhSN1zuXS",
          "type": "application/hal+json"
        },
        "dashboard": {
          "href": "https://my.mollie.com/dashboard/org_12345678/payments/tr_7UhSN1zuXS",
          "type": "text/html"
        }
      },
      "amount": {
        "value": "49.95",
        "currency": "EUR"
      },
      "method": "ideal",
      "paidAt": "2026-09-28T09:29:47+00:00",
      "status": "paid",
      "details": {
        "consumerBic": "ABNANL2A",
        "consumerName": "J. Jansen",
        "consumerAccount": "NL91ABNA0417164300"
      },
      "metadata": {
        "order_id": "12345"
      },
      "resource": "payment",
      "createdAt": "2026-09-28T09:28:11+00:00",
      "profileId": "pfl_QkEhN94Ba",
      "description": "Order #12345",
      "amountRefunded": {
        "value": "0.00",
        "currency": "EUR"
      }
    }
  },
  "createdAt": "2026-09-28T09:29:48.0Z"
}
```

## FAQ

### Does this work on iPhone and Android?

Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.

### Do I need to write code?

No. Install the recipe in Studio, paste your webhook URL into Mollie and you are done. The code is there if you want to change the text, the sound or the buttons.

### Can I change what the notification says?

Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.

### What does it cost?

JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.
