TQ API · for developers
Sell from your own app.
We’ll handle the money.
Your website, booking system or WhatsApp bot takes the order. One API call sends a mobile-money prompt to the buyer’s phone — and TQ collects, issues the tickets and pays you out.
- No licenceTQ is merchant of record
- One requestto start a payment
- Signed webhooksthe moment it lands
curl -X POST https://tqcodes.com/api/v1/checkout \
-H "Authorization: Bearer $TQ_KEY" \
-H "Content-Type: application/json" \
-d '{
"publication_id": 101,
"buyer": {"name": "Jane Doe", "email": "[email protected]",
"phone": "0772123456"},
"items": [{"type": "ticket", "item_id": 24, "quantity": 2}]
}'
{
"reference": "TQ-OR-101-1788843738-5456",
"status": "pending",
"amount": 50000,
"currency": "UGX",
"prompt_sent_to": "256772123456",
"message": "Approval prompt sent to the buyer."
}
One payment, end to end
Your app
site · bot · till
TQ
checkout · fulfilment
Buyer’s phone
approves the prompt
What people build with it
If it can make an HTTPS request from a server, it can sell through TQ.
Your event website
Sell tickets on your own site, in your own design. TQ issues the QR tickets and emails them.
A WhatsApp or USSD bot
Take the order in the chat, send one request, and the buyer approves on the same phone.
A till or booking system
Charge at the counter or the gate without a card machine — the buyer pays from their phone.
Contributions & dues
Schools, churches and associations collect any amount into a TQ donation page.
Digital products
Sell downloads, or unlock a whole audio or flipbook page, from inside your own app.
Products & merch
Sell from your shop catalogue with stock kept in step across your app and your TQ page.
How it works
-
1
Create a key
API Keys in your dashboard. Tick only the scopes you need — the one that takes payments is never granted by default.
-
2
Set up what you sell
Create the event, shop or download in TQ. Prices and stock live there, so nobody can change a price from the outside.
-
3
Start the payment
POST /checkout with the buyer and the items. The buyer gets an approval prompt on their phone.
-
4
Get told
A signed order.completed webhook reaches your server the moment it lands. No polling needed.
-
5
Nothing else to do
Tickets, receipts and download links go out automatically, and the sale joins your normal payout.
An example, in shillings
An organiser’s website sells two early-bird tickets to a jazz night.
- 2 × Early bird at UGX 25,000
- UGX 50,000
- Platform fee (5%)
- − UGX 2,500
- Joins your payout
- UGX 47,500
- Jane approves UGX 50,000 plus the 4.9% service fee on her phone.
- Two QR tickets land in her inbox, ready to scan at the gate.
- The organiser’s server gets
order.completedwith the net amount.
Know the moment it lands
Payment is asynchronous — the buyer has to reach for their phone — so TQ tells you when it’s done. Every delivery is signed with your secret and retried for more than a day if your server is down.
-
order.completedPayment confirmed for an order -
order.fulfilledTickets issued / download links minted -
order.failedPayment attempt failed or was declined
$body = file_get_contents('php://input');
parse_str(strtr($_SERVER['HTTP_TQ_SIGNATURE'] ?? '', ',', '&'), $sig);
$expected = hash_hmac('sha256', $sig['t'] . '.' . $body, getenv('TQ_WEBHOOK_SECRET'));
if (!hash_equals($expected, $sig['v1'] ?? '')) { http_response_code(400); exit; }
if (abs(time() - (int)$sig['t']) > 300) { http_response_code(400); exit; }
http_response_code(200); // acknowledge fast, then do the work
$event = json_decode($body, true); // order.completed, order.fulfilled, order.failed
What it costs
200
credits per API key, per month
5%
platform fee per sale
No setup fee, no contract. The fee is the same one every sale on your TQ page carries, and buyers pay a 4.9% service fee on top, never more than UGX 5,000. We email you before a key’s monthly charge if your balance is running low.
See credit prices →Good to know first
- TQ is the merchant of record. Money is collected into the TQ account and paid out to you. It can’t collect into your own merchant account.
- Your catalogue lives in the dashboard. The API sells what you’ve set up there, at the price stored there.
- Server to server. Keep the key on your backend, never in a browser or app bundle.
- Mobile money, in UGX. The buyer approves on their own phone.
Questions developers ask
Ready when your code is.
Create a key, set up what you sell, and take your first payment today. The full reference is in your dashboard under API Docs.