Skip to content
Loading keys…

Identity

Check an IBAN's checksum and resolve a mobile number to its channel.

Identity answers questions about a destination before you send money to it. Two endpoints, both POST, both synchronous, both free of side effects.

MethodEndpointWhat it does
POST/identity/validateChecks an IBAN's structure, length and mod-97 checksum.
POST/identity/resolveResolves a mobile number to its channel and account holder.

Validate an IBAN

This runs entirely on our side, no bank is contacted. It checks three things in order: the format (two letters, two digits, then alphanumerics), the length expected for that country, and the ISO 13616 mod-97 checksum. A valid checksum means the IBAN is well-formed, not that the account exists.

POSThttps://api.wajub.com/identity/validate
ibanstringrequired
The IBAN, up to 42 characters. Spaces are stripped and letters upper-cased before checking.
typestringoptional
Optional. Only iban is accepted today.
curl https://api.wajub.com/identity/validate \
-H "Authorization: $WAJUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "iban": "FR14 2004 1010 0505 0001 3M02 606" }'

The response is flat, with no envelope. iban comes back normalised, which is the form you should store:

Response · 200 OK
{
"valid": true,
"iban": "FR1420041010050500013M02606"
}

When the IBAN is rejected, message names the reason so you can put it straight in front of the user:

Response · 200 OK, rejected
{
"valid": false,
"iban": "FR1420041010050500013M02607",
"message": "IBAN checksum is invalid."
}

The five possible messages:

messageCause
IBAN is too short.Fewer than four characters.
IBAN format is invalid (expected 2 letters, 2 digits, then alphanumeric).Wrong shape.
IBAN length must be N characters for country XX.Known country, wrong length.
IBAN length must be between 15 and 34 characters.Country not in our length table.
IBAN checksum is invalid.Shape and length fine, mod-97 fails.

A rejection is still a 200

valid: false is a successful call with a negative answer, not an error. Branch on valid, not on the status code.

Resolve a mobile number

Resolve takes a number and a channel and returns the payment method it would create: the resolved channel, a provisional method id, and the account holder's name. issuer is present only when the channel records one, so read it defensively.

POSThttps://api.wajub.com/identity/resolve
account_numberstringrequired
The mobile number. Cameroonian formats are accepted bare, others need their country prefix.
channelstringrequired
A channel slug such as cm.mtn or cm.orange, or cm.mobile to let Wajub pick between the two from the number itself.
countrystringrequired
ISO 3166-1 alpha-2 country code.
typestringrequired
Only mobile is accepted today.
curl https://api.wajub.com/identity/resolve \
-H "Authorization: $WAJUB_SANDBOX_KEY" \
-H "Content-Type: application/json" \
-d '{
  "account_number": "670000000",
  "channel": "cm.mobile",
  "country": "CM",
  "type": "mobile"
}'

cm.mobile was resolved to cm.mtn here, from the number's prefix:

Response · 200 OK
{
"channel": "cm.mtn",
"id": "pm.9fK2mQ7vB4nL6hR1",
"name": "Sandbox Account Holder",
"country": "CM",
"type": "mobile_money",
"account_number": "+237670000000"
}

A number whose operator we cannot identify is a 422:

Response · 422 Unprocessable Content
{
"code": 422,
"status": "Unprocessable Content",
"message": "Carrier not supported for this number.",
"errors": {
"account_number": [
"Carrier not supported for this number."
]
}
}

POST /identity/validate has no such restriction: the mod-97 check is arithmetic and works identically in both environments.

What did you think of this content?