Check a printed card
Look up one of your printed cards before activating it: the product it loads, the amounts it accepts and whether it can be activated. Nothing changes.
POST
https://afropin.com/api/v1/reseller/cards/lookup
HMAC-signed request with a unique Idempotency-Key header. Authentication
With an SDK
PHP
$afropin->reseller->cards->lookup($params)Node.js
afropin.reseller.cards.lookup(params)Python
afropin.reseller.cards.lookup(params)Java
afropin.reseller().cards().lookup(params)Body parameters
card_number
string
Required
19 digits
The number printed on the card, with or without spaces. Card numbers start with 9; they are not PIN codes.
Response fields
card_mask, serial, order_referenceThe masked card number, its number within the order, and the order it was printed for.
statusinactive, activated or void.can_activate, reasonWhether the card can be activated now. When it can't, reason says why: already activated, cancelled, or its order hasn't shipped yet.
catalog_id, pin_type, currencyThe product the card loads. The PIN issued on activation is a PIN of this product.
min, max, denominationsThe amounts the card can be activated with: any amount between min and max, or, when denominations is not empty, one of those amounts.
pin_id, activated_atThe PIN issued from this card and when, once it has been activated; otherwise
null.Physical cards are live stock: use live API keys. Card numbers are checked against your own cards only, and repeated unknown numbers are limited, so this endpoint can't be used to guess numbers.
Request
{
"card_number": "9307 9280 2477 8142 827"
}
Response 200
{
"ok": true,
"data": {
"card_mask": "9307 **** **** **** 827",
"serial": 1,
"order_reference": "PVO-MWEFCT3D",
"status": "inactive",
"can_activate": true,
"reason": null,
"catalog_id": "7c1b0e5e-5d3f-4c2b-9a51-2f0d8b6f9e10",
"pin_type": "Grams Fresh Bakes",
"currency": "NGN",
"min": 2000,
"max": 2000000,
"denominations": [],
"pin_id": null,
"activated_at": null
}
}
Errors
Failed requests return a stable code with a translated message. Branch on code, never on the message.
422
validation_error
Some fields are missing or invalid
403
wrong_account_type
Your account type cannot use this endpoint
403
physical_vouchers_not_permitted
Printed cards are not switched on for your account. Contact support
404
physical_voucher_not_found
No printed card has this number
429
rate_limited
Too many requests. Wait a moment and try again
500
internal_error
Something went wrong on our side. Try again; if it keeps happening, contact support
{
"ok": false,
"error": {
"code": "physical_voucher_not_found",
"message": "No printed card has this number",
"fields": null
}
}
All error codes →