Issuing cards
A card belongs to one cardholder. Naira cards spend from your balance, dollar cards from their own.
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 }
}'const url = 'https://api.paymonetra.com/v1/cards'
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Bearer ' + process.env.PAYMONETRA_SECRET_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
cardholder_ref: 'chd_51c0e9a3f7d2b8',
currency: 'NGN',
reference: 'card-1001',
controls: {
web: true,
pos: true,
},
}),
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)$ch = curl_init('https://api.paymonetra.com/v1/cards');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('PAYMONETRA_SECRET_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'cardholder_ref' => 'chd_51c0e9a3f7d2b8',
'currency' => 'NGN',
'reference' => 'card-1001',
'controls' => [
'web' => true,
'pos' => true,
],
]),
]);
$result = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($result['error']['message']);
}For a dollar card, add "currency": "USD" and "amount_usd": 10 (the first load, at least your min_load). The create fee, the load and its load fee come from your USD balance.
Pick the scheme with brand. Naira cards are verve (the default) or afrigo; dollar cards are mastercard (the default) or visa. A brand the currency doesn't have answers 422 invalid_request with field: "brand", and one that isn't on your programme answers 409 brand_unavailable.
{
"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
}#What the answer can be
202 pending_confirmationmeans we asked for the card and are confirming it. Don't retry with a new reference. You getcard.createdwhen it's ready, orcard.failedwith everything returned.502 provider_errormeans the card wasn't created and nothing was taken.422 cardholder_refusedmeans the card issuer's own identity check turned this cardholder down, so no card was made and nothing was taken. Don't retry for this cardholder; contact us. If the issuer turns a card down shortly after it was created, you getcard.failedand everything it cost comes back.- Naira cards have no balance of their own: each payment comes straight from your NGN balance, so
balanceis null. Dollar cards carry their ownbalance. statusispending,active,frozen,terminatedorfailed.
#The rest of the routes
| Route | Body | Answer |
|---|---|---|
GET /cards/{card_ref} | the card (a dollar card's balance is read live) | |
GET /cards?cardholder_ref=&status=¤cy= | { cards, limit, offset } | |
POST /cards/{card_ref}/freeze | the card | |
POST /cards/{card_ref}/unfreeze | the card (409 fee_unpaid if frozen for an unpaid fee) | |
POST /cards/{card_ref}/controls | any of web, pos, atm | the card |
POST /cards/{card_ref}/terminate | { card, returned: { amount, currency } } | |
POST /cards/{card_ref}/fund | dollar cards: amount_usd, reference | { fund, card }, or 202 pending_confirmation |
POST /cards/{card_ref}/withdraw | dollar cards: amount_usd, reference | { withdrawal, card } |
GET /cards/{card_ref}/transactions | { transactions, limit, offset } | |
POST /cards/{card_ref}/details_link | { url, expires_at } |
#Dollars on and off a card
- Loads are between your
min_loadandmax_load(fromGET /cards/pricing), plus your load fee, from your USD balance. A live load counts once the card network confirms it. If that takes longer than the call, it answers202 pending_confirmationwith the loadpending: don't retry with a new reference.card.fundedfollows when it lands, usually within minutes. If it never lands, the load and its fee come back to your USD balance. - Withdrawals return money from a dollar card to your USD balance, less any withdrawal fee on your prices. A small amount stays on the card, so a withdrawal never returns the whole balance.
GET /cards/{card_ref}shows what is left. A live withdrawal answers202 pending_confirmation: the money leaves the card at once and reaches your USD balance when the card network confirms it, usually within 10 minutes, withcard.withdrawn. - Closing a dollar card returns its balance to your USD balance. A live card can't be closed in its first 24 hours, or while it's still waiting on its number (
409 not_yet). A card that can't be finished is refunded in full automatically, withcard.failed. - One at a time. A load, withdrawal or close on a card while another is still going through on the same card answers
409 card_busy. Try again a moment later. - Dollar card payments are decided from the card's own balance at the network, so they reach your transactions and webhooks within about five minutes rather than at the moment of payment. Naira card payments come through as they happen.
curl https://api.paymonetra.com/v1/cards/crd_8a31f0c2d9b4e7/fund \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{ "amount_usd": 50, "reference": "load-7001" }'const url = 'https://api.paymonetra.com/v1/cards/crd_8a31f0c2d9b4e7/fund'
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Bearer ' + process.env.PAYMONETRA_SECRET_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount_usd: 50,
reference: 'load-7001',
}),
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)$ch = curl_init('https://api.paymonetra.com/v1/cards/crd_8a31f0c2d9b4e7/fund');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('PAYMONETRA_SECRET_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'amount_usd' => 50,
'reference' => 'load-7001',
]),
]);
$result = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($result['error']['message']);
}#Showing your user their card
Card details. We never send the full card number or CVV through the API. details_link gives a link on our site, good once for 5 minutes, that shows your user their number, CVV and expiry. Open it in your app or browser for them. Ten links per card an hour.