MPPFinanceDocsv0.1
Guides/Webhooks

Webhooks

MPPFinance fires signed webhook events on every card and charge action. Register an endpoint to receive real-time notifications.

Register endpoint

webhooks.ts
await client.registerWebhook({
  url: 'https://your-app.com/api/mpp-webhook',
  events: ['charge.approved', 'charge.declined', 'card.revoked'],
  secret: process.env.WEBHOOK_SECRET!,
})
Every request is signed with WEBHOOK_SECRET using HMAC-SHA256. Always verify the signature before processing.

Event types

EventDescription
charge.approvedA charge on a card was approved
charge.declinedA charge was declined (rule violation or revoked)
card.issuedA new card was issued
card.revokedA card was revoked
card.expiredA card reached its TTL

Payload example

webhook-payload.json
{
  "event": "charge.approved",
  "cardId": "card_9x2kj7...",
  "amount": 4999,
  "merchant": "aws.com",
  "timestamp": 1712345678
}