PaymonetraDocs

Card webhooks

Card events go to the same webhook URL and are signed the same way as the rest of the API.

What we post
{
  "event": "card.transaction.approved",
  "mode": "live",
  "created_at": "2026-11-20T14:02:11+01:00",
  "data": {
    "id": "ctx_4f1c9a20b7e3d518",
    "card_ref": "crd_8a31f0c2d9b4e7",
    "card_reference": "card-1001",
    "cardholder_ref": "chd_51c0e9a3f7d2b8",
    "amount": 12500,
    "fee": "...",
    "currency": "NGN",
    "merchant": { "name": "SHOPRITE LEKKI", "category": "5411", "country": "NG" },
    "channel": "pos",
    "status": "approved",
    "card_balance": { "spendable": 737485 }
  }
}

#The events

EventWhen
card.createdA card is active
card.failedA card we were confirming (202 pending_confirmation) couldn't be created; everything taken for it is back in your balance
card.transaction.approvedA payment was approved
card.transaction.declinedA payment was declined, or "reversed": true when declined after approval and the money came back
card.transaction.refundedA shop refunded a payment
card.fundedA dollar load landed
card.withdrawnA dollar withdrawal landed in your USD balance
card.frozenA card was frozen, with reason
card.terminatedA card was closed, with returned
card.otpAn online payment needs a one-time code: code, card_ref, card_reference, cardholder_ref, last4. Sent once
card_balance.fundedMoney arrived in a card balance, with amount (what arrived), fee (your top-up fee), net (what was credited) and, for bank deposits, the payer and session_id
balance.lowSpendable fell below your alert line, with the currency

#Verifying it

Card events go to the webhook URL you set on the dashboard, signed the same way as your other webhooks (HMAC-SHA512 of the body with your webhook secret). Answer with a 2xx. We retry anything else for about a day, so the same event can arrive twice: use the transaction or card id to ignore repeats.

PHP
$secret = getenv('PAYMONETRA_WEBHOOK_SECRET');
$raw = file_get_contents('php://input');
$sent = $_SERVER['HTTP_X_PAYMONETRA_SIGNATURE'] ?? '';

$expected = hash_hmac('sha512', $raw, $secret);

// Compare in constant time, and never decode the body first.
if (!hash_equals($expected, $sent)) {
    http_response_code(401);
    exit;
}

$event = json_decode($raw, true);
// $event['data']['customer_reference'] is your own id for the customer.
http_response_code(200);

#Which to handle first

  • card.transaction.approved and card.transaction.declined are the two your users will ask you about.
  • card.created is how a 202 finishes. Nothing is usable until it arrives.
  • balance.low is the one that prevents declines. Fund on it.

The signature header and the retry schedule are the same as webhooks.