Get started
API keys
Two keys per app, sent in two headers. They stay on your server, always.
Base URL and formats
https://tchin.tech/api/v1| What | Format |
|---|---|
| Requests | JSON, with Content-Type: application/json (form data is accepted too). |
| Responses | JSON in UTF-8. Send Accept: application/json so validation errors come back as JSON. |
| CFA amounts | integers, no decimals: 25000. |
| Crypto amounts | decimal numbers, up to 6 decimals: 12.5. |
| Dates | ISO 8601 in UTC: 2026-11-23T14:05:12+00:00. |
| Countries | two-letter ISO codes: TG, BJ, BF. |
Always call over HTTPS: an http:// URL is redirected, and a redirected POST loses its body.
Headers
| Header | Value |
|---|---|
TCHIN-PUBLIC-KEY | your app’s public key (tchin_pk_…) |
TCHIN-PRIVATE-KEY | its secret key (tchin_sk_…) |
Content-Type | application/json (for a POST) |
Accept | application/json |
A call with your keys
curl https://tchin.tech/api/v1/balance \
-H "TCHIN-PUBLIC-KEY: $TCHIN_PUBLIC_KEY" \
-H "TCHIN-PRIVATE-KEY: $TCHIN_PRIVATE_KEY" \
-H "Accept: application/json"$ch = curl_init('https://tchin.tech/api/v1/balance');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
'TCHIN-PUBLIC-KEY: '.getenv('TCHIN_PUBLIC_KEY'),
'TCHIN-PRIVATE-KEY: '.getenv('TCHIN_PRIVATE_KEY'),
'Accept: application/json',
],
]);
$solde = json_decode(curl_exec($ch), true);const r = await fetch('https://tchin.tech/api/v1/balance', {
headers: {
'TCHIN-PUBLIC-KEY': process.env.TCHIN_PUBLIC_KEY,
'TCHIN-PRIVATE-KEY': process.env.TCHIN_PRIVATE_KEY,
'Accept': 'application/json',
},
});
const solde = await r.json();import os, requests
r = requests.get('https://tchin.tech/api/v1/balance', timeout=30, headers={
'TCHIN-PUBLIC-KEY': os.environ['TCHIN_PUBLIC_KEY'],
'TCHIN-PRIVATE-KEY': os.environ['TCHIN_PRIVATE_KEY'],
'Accept': 'application/json',
})
solde = r.json()Viewing your keys
- Open tchin.tech/api and tap your app.
- Tap View keys (or the key icon on the app’s row).
- Confirm with your Tchin PIN or biometrics: it is asked every time.
- Each app has its own pair. An operation created with one pair belongs to that app only: another app’s token returns
404. - The same keys work in test and live mode: the
envfield of each create call decides. - Editing the app (image, methods, fees) does not change the keys: your code stays the same.
Keeping them safe
- In your server’s environment variables or its secrets manager. Never in a web page, a mobile app, a Git repository, a message or a screenshot.
- In your logs: the time, the endpoint, the HTTP code and the
message. Never the keys. - Your page and your mobile app only ever receive a
token.
If a key leaks
- Create a new app with the same methods, fees and webhook URL.
- Put its keys on your server.
- Delete the old app: its keys stop working immediately.
Warning
Nobody at Tchin will ever ask for your secret key, by WhatsApp or email. Never share it.