PaymonetraDocs

Card quickstart

Five calls against a test key. No real cards and no real money.

#1. Add test money

POSThttps://api.paymonetra.com/v1/sandbox/card_fundingTest secret key only
Terminal
curl https://api.paymonetra.com/v1/sandbox/card_funding \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{ "currency": "NGN", "amount": 50000 }'

POST /sandbox/card_funding with currency and amount. NGN arrives at your test funding account and USD at your test USDT address, like real deposits.

#2. Verify a cardholder

POSThttps://api.paymonetra.com/v1/cardholdersSecret key

BVN 22222222222 passes with any name in test mode.

Terminal
curl https://api.paymonetra.com/v1/cardholders \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "user-1001",
    "first_name": "Tunde",
    "last_name": "Bakare",
    "dob": "1990-05-14",
    "phone": "08031234567",
    "email": "tunde@example.com",
    "address": {
      "line1": "12 Allen Avenue",
      "city": "Ikeja",
      "state": "Lagos",
      "postal_code": "100271"
    },
    "id_type": "bvn",
    "id_number": "22222222222"
  }'

Keep the cardholder_ref that comes back. Every card is issued against one.

#3. Issue a naira card

POSThttps://api.paymonetra.com/v1/cardsSecret key
Terminal
curl https://api.paymonetra.com/v1/cards \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "cardholder_ref": "chd_51c0e9a3f7d2b8",
    "currency": "NGN",
    "reference": "card-1001",
    "controls": { "web": true, "pos": true }
  }'
Response
{
  "card_ref": "crd_8a31f0c2d9b4e7",
  "reference": "card-1001",
  "cardholder_ref": "chd_51c0e9a3f7d2b8",
  "holder_name": "Tunde Bakare",
  "currency": "NGN",
  "brand": "verve",
  "last4": "4821",
  "expiry": "11/29",
  "status": "active",
  "frozen_reason": null,
  "balance": null,
  "controls": { "web": true, "pos": true, "atm": false },
  "next_fee_at": "2026-12-06",
  "fee_unpaid_since": null,
  "mode": "live",
  "created_at": "...",
  "issued_at": "...",
  "terminated_at": null
}

#4. Make a payment happen

POSThttps://api.paymonetra.com/v1/cards/{card_ref}/simulateTest secret key only
Terminal
curl https://api.paymonetra.com/v1/cards/crd_8a31f0c2d9b4e7/simulate \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{ "amount": 12500, "channel": "pos", "outcome": "approve" }'

It runs the real approval against your test NGN balance and sends the real webhooks.

#5. Take the webhook

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 }
  }
}

Verify the signature over the raw bytes before you trust the body:

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);

Answer any 2xx. Card webhooks has the event list and the retry schedule.

#Then

  • Run it again with decline_after_approval, so your ledger is right the first time a payment comes back.
  • Read card prices. Every fee is its own statement line.
  • Ask us to review your test calls. Live follows.