Get started
API keys and requests
Secret keys, test and live mode, idempotency keys and rate limits β the rules every request follows.
Secret keys
Send your secret key as a Bearer token on every request. Create keys in Developers βΊ API keys; each one is shown once and stored only as a hash, so copy it straight into your server's environment.
GET /v1/payments HTTP/1.1
Host: api.takaelo.com
Authorization: Bearer sk_live_51Hqβ¦| Prefix | Mode | Sees |
|---|---|---|
sk_test_ | Test | Only test payments. Checkouts can be paid with Simulate payment; success_url may be http://localhost. |
sk_live_ | Live | Only real payments, paid with real money into your wallet number. |
A missing header, a key that is made up, revoked, or from another account: every one gets 401 API_KEY_INVALID β the same reply whatever the reason, so nobody can probe which keys exist.
Base URL and format
- Base URL:
https://api.takaelo.com/v1. HTTPS only. - Send JSON with
Content-Type: application/json. Replies are always JSON. - Amounts are whole taka as numbers:
1250means ΰ§³1,250. Currency is alwaysBDT. - Times are unix seconds (
1791641454). - Every reply has
successandmessage. Successes carrydata; errors carry a stablecodeand arequest_idβ quote it when you write to support.
Idempotency keys
Every POST needs an Idempotency-Key header (1β255 characters). Use something that identifies the action in your system β order-4821-1 for the first checkout attempt of order 4821 (-2 for a new attempt after it failed or expired), refund-pay_β¦ for a refund. Then a retry after a timeout can never create a second checkout or refund twice, and a new attempt isn't answered with the old checkout (a key is remembered for 24 hours).
| You send | TakaElo replies |
|---|---|
| A new key | Does the work and remembers the reply for 24 hours. |
| The same key and the same body again | The first reply, unchanged, with the header Idempotent-Replayed: true. |
| The same key with a different body | 422 IDEMPOTENCY_KEY_REUSED β a bug in your code; nothing happens. |
| The same key while the first request is still running | 409 IDEMPOTENCY_IN_PROGRESS β wait a second and retry with the same key. |
| No key | 400 IDEMPOTENCY_KEY_REQUIRED. |
Rate limits
Each key may make 300 requests a minute. Above that you get 429 RATE_LIMITED with a Retry-After header in seconds. Normal shops never come close; if you sync payments in bulk, page through GET /v1/payments with limit=100 instead of fetching payments one by one.