What is the Theteller API?
The Theteller API lets your website or app take mobile money payments in Ghana. Your server sends the amount, the customer's network and their wallet number; the customer gets a prompt on their phone and approves the payment with their PIN. Payment links made on your dashboard also take Visa and Mastercard cards on a secure checkout page. See the API documentation.
Which payment methods can my customers use?
Through the API: MTN Mobile Money, Telecel Cash (formerly Vodafone Cash), AirtelTigo Money, G-Money and Zeepay. Through payment links: the same mobile money networks, plus Visa and Mastercard cards. The network codes are listed under Cards and Mobile Money.
How do I get my API keys?
Sign up for a merchant account. Your Merchant ID, API Username and two API keys (a test key and a production key) are created straight away and shown under My Account on your dashboard. Each key is shown once; you can regenerate it at any time. Keys are 48 characters long and start with TTK-.
What is the difference between the test key and the production key?
Payments made with the test key are simulated: no money moves and no prompt is sent, and the test numbers give predictable results. The production key takes real payments once your account has been approved. Both keys use the same addresses and the same API Username.
Why does the API answer code 600 "waiting for approval"?
Your merchant account has not been approved yet, so the production key cannot take real payments. The test key works meanwhile, so you can build and test your integration while you wait.
How is the API authenticated?
With HTTP Basic authentication (RFC 7617): your API Username and API Key, joined by a colon and base64-encoded, in the Authorization header. Keep the key on your server and never put it in a web page or mobile app.
Can I call the API from JavaScript in my web page?
No. Browsers block it, because the API does not accept cross-origin requests (CORS), and it would show your API key to everyone who opens the page. Your page sends the customer's network and number to your own server, and your server calls the API: the complete website example does exactly that.
Can I take card payments through the API?
No. Card details should not pass through merchants' servers: the card industry's security standard, PCI DSS, sets strict rules for every system that handles them. Send the customer a payment link instead; they enter their card on the secure checkout page.
Why did my customer not get the payment prompt?
With the test key no prompt is sent: use the production key for real customers. With the production key, check that r-switch matches the customer's network and that the number is a registered mobile money wallet. Prompts expire quickly (about 15 seconds on Telecel Cash), so the phone should be unlocked and ready; an expired prompt ends with code 103 and the customer can try again with a new payment. More in Common Errors.
How do I know a payment succeeded?
Check it with the status endpoint every few seconds until the result is final. Only fulfil the order when the code is 000 (status approved) and the amount matches.
Why do I get code 909?
Every payment needs a new 12-digit transaction_id; 909 means the one you sent was used before. The code samples in the documentation make a random one each time.
Can I use one merchant account for several websites?
Yes, for websites of the same business: the same credentials work on any site. All payments appear on one dashboard, so put the site's name in desc, and make sure transaction IDs never repeat across the sites. Different businesses should each have their own merchant account.
How do I receive my money?
Add your payout details, a mobile money wallet or a bank account, on the Payouts page of your dashboard. The payouts made to you are listed on the same page.
Is there a WooCommerce or WordPress plugin?
Not yet. Every platform can integrate with the REST API, using the code samples for PHP, Node.js, Python, Java and C# in the documentation. See Plugins.
Who regulates mobile money payments in Ghana?
The Bank of Ghana, under the Payment Systems and Services Act, 2019 (Act 987).
Still have a question?
Read the API documentation, see the integration guides, or contact support.
