Verify API · Ghana

OTP API for Ghana

Send and check one-time codes for logins, sign-ups and payments with two API calls, over SMS, WhatsApp, voice or email, with automatic fallback between them.

  • Fallback across WhatsApp, SMS, voice and email
  • Verification fee only when a code is verified
  • Expiry, attempt limits and rate limiting built in
POST /v1/otp/request
curl -X POST https://api.sendexa.co/v1/otp/request \
  -H "Authorization: Basic $SENDEXA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": { "value": "0244123456" },
    "sender": "MyBrand",
    "channel": ["whatsapp", "sms"],
    "code": { "length": 6, "type": "NUMERIC" },
    "expiry": { "amount": 10, "duration": "minutes" }
  }'

From $0.05 per verification

Charged only on successful verification, plus the SMS or WhatsApp channel fee.

Pricing

One-time codes without building the plumbing

Two calls, no code storage

POST /v1/otp/request sends the code and POST /v1/otp/verify checks it. Sendexa generates, stores and expires the code, so you never keep OTPs in your own database.

Fallback across channels

Pass channels in order, such as ["whatsapp", "sms"]. If one can't be sent, the next is tried, so a missing WhatsApp account doesn't block a login.

SMS, WhatsApp, voice or email

One endpoint for every channel. Voice reads the code out for customers who can't receive SMS; email works for sign-ups without a phone.

Pay for verifications that succeed

The verification fee is charged only when a code is verified successfully. SMS and WhatsApp sends carry their normal per-message channel fee.

Built-in limits against abuse

Set how many wrong attempts are allowed (1 to 10) and how long a code lives (1 to 1,440 minutes or hours). Requests are rate limited automatically.

Codes that fit your flow

Numeric, alphanumeric or letters only, 4 to 10 characters long, with your own message template and sender ID.

How the flow works

  1. Your app calls POST /v1/otp/request with the customer's number. Sendexa generates a code and sends it on the first channel that works.
  2. The customer types the code into your app.
  3. Your app calls POST /v1/otp/verify with the number, the code and the OTP ID. You get back whether it matched.

Full request options are in the Verify docs.

SMS or WhatsApp for OTP in Ghana?

SMS reaches every phone, including feature phones and customers without data, and costs less per message in Ghana. WhatsApp shows your business name and works over Wi-Fi, but only for customers who use it. Listing ["whatsapp", "sms"] gives you both: WhatsApp first, SMS when it can't be used. We compare the two in WhatsApp OTP vs SMS OTP.

Frequently asked questions

How much does OTP verification cost in Ghana?+

Verification starts from $0.05 per successful verification, plus the channel fee for SMS or WhatsApp sends (an SMS to Ghana is billed at the normal SMS rate). Voice and email have no separate channel fee. See the pricing page for current rates.

Am I charged if the customer never enters the code?+

The verification fee is charged only when a code is verified successfully. The SMS or WhatsApp message itself is billed when it is sent.

What happens if WhatsApp isn't available for a number?+

If you pass a list of channels such as ["whatsapp", "sms"], Sendexa tries them in order until one send succeeds. WhatsApp needs an approved authentication template on your account.

How long is a code valid?+

You choose: between 1 and 1,440, in minutes or hours. Ten minutes is a common choice for logins and payments.

Can I resend a code?+

Yes. Call the resend endpoint, POST /v1/otp/resend/:id, with the OTP's ID.

Which networks are supported in Ghana?+

SMS codes reach MTN, Telecel, AirtelTigo and Glo numbers. WhatsApp and email work for any customer who has those accounts.