Get started
The Tchin API
Accept Mobile Money and crypto without your customer ever leaving your website or app. Send payouts, take in-store payments and track everything by webhook: one integration, the same keys.
How it works, in four steps
Every Tchin operation follows the same path. Once you understand it for a payment, you can do everything.
- Your server creates the operation. It calls the API with your two keys: the amount, a description, your webhook URL. Tchin replies with a
token, a short identifier that holds no secret. - Your page opens the Tchin sheet. With that token, the web kit (one script tag) or your mobile kit opens the sheet: a Tchin window that slides up over your page. The customer is never redirected.
- The customer pays in the sheet. Mobile Money or crypto: the sheet guides every step and shows your app’s name and image.
- Your server is notified. Tchin calls your
callback_urlwith a webhook signed with your secret key. That is where, and only where, you deliver.
token: even if copied, it can neither read your account nor move money.Key terms
| Term | What it is |
|---|---|
| App | your website or service as Tchin sees it: a name and an image (your customers see them), the accepted methods, who pays the fees, a webhook URL and a key pair. Create them on the API page of your account. |
| Public key | tchin_pk_…: identifies your app. Header TCHIN-PUBLIC-KEY. |
| Secret key | tchin_sk_…: proves the call comes from you and signs your webhooks. Header TCHIN-PRIVATE-KEY. It never leaves your server. |
| Token | the identifier of an operation (14 letters and digits for a payment: jtkkbphr7azsn3). It opens the sheet and is used to track the status. |
| Sheet | the Tchin window opened over your page by TchinPay.open() (pay) or TchinPay.receive() (receive). |
| Payment page | payment_url: the same thing as a full page, for a link in an email or a message. |
| Webhook | the call Tchin makes to your server when an operation changes status, signed with your secret key. |
| Test and live mode | "env": "test": everything works as in real life, with no money. "env": "live": real payments. The same keys work for both. |
| Balance | the money in your Tchin account: one balance per country in CFA francs (Togo, Benin, Burkina Faso) and one balance in your account’s crypto. |
What you can build
Countries and methods
Tchin collects and pays out in CFA francs (XOF) in three countries, and in crypto worldwide.
| Country | Mobile Money | Codes |
|---|---|---|
TG | Togo: Yas, Moov | t-money-togo, moov-togo |
BJ | Benin: MTN, Moov, Celtiis Cash | mtn-benin, moov-benin, celtiis-benin |
BF | Burkina Faso: Orange Money, Moov | orange-money-burkina, moov-burkina |
In crypto, the customer pays with the coin of their choice from their wallet; you receive it in your account’s crypto (TRX, BNB, SOL or GRAM). The live list, network by network, is available from GET /api/v1/methods.
Fees
Current rates are on tchin.tech/tarifs, and GET /api/v1/methods always returns those of your account (an account can have negotiated rates). In your app settings, you choose who pays the fees:
- On payments: the customer (fees are added to the price, you receive exactly your price) or you (the customer pays the price, fees are taken from what you receive). A single payment can also decide with
fees_on_customer. - On payouts: you (the recipient gets exactly the amount) or the recipient (fees are taken from the amount).
Security in short
- API calls are made from your server, over HTTPS, with your two keys. Never from a web page or a mobile app.
- A payment is only paid once your server confirms it: through the signed webhook, or
GET /api/v1/payments/{token}/status. The page callback (onSuccess) is for display only. - Webhooks are only sent to a public HTTPS URL, signed with HMAC-SHA256 using your secret key and timestamped: a replayed message is detected.
- A confirmed payment is final: Tchin does not refund. The sheet tells the customer before they pay.
Questions?
Message us on WhatsApp at +228 73 38 49 90, or ask Letou, the assistant in your Tchin account: it knows this documentation and writes the code with you. Service status is on statut.tchin.tech.