Get started
Authentication
Every request is signed with an API key. A key belongs to one organisation, holds a list of permissions you choose, and can be revoked at any moment without touching your other keys.
Create a key
Open Settings, then Integrations
You need the permission to manage integrations, which administrators have.
Create an API key
Give it a name that says where it runs (
Website checkout,Billing server) and tick only the permissions that system needs. You can set a date after which it stops working.Copy it now
The key is shown once. RadiPay stores only a fingerprint of it, so nobody, including RadiPay, can show it to you again. If you lose it, revoke it and create another.
Send the key
Put the key in the Authorization header as a bearer token. X-Api-Key is accepted as well, for tools that cannot set the first.
curl https://prod.pay.radingtechnologies.co.ke/wallet \
-H "Authorization: Bearer $RADIPAY_API_KEY"Authorization: Bearer rtk_XXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X-Api-Key: rtk_XXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXA key always starts with rtk_, followed by a 12-character prefix and a 40-character secret. The prefix is what you see in the list of keys in the app, so you can tell which key is which without exposing the secret.
What a key may do
A key can do only what its permissions say, and only on endpoints built for integrations. The full list is on the Permissions page. Three rules apply to every key:
- You can only give what you hold. A key cannot have a permission that the person creating it does not have.
- A key can never manage people or other keys. Roles, team members, API keys and webhook endpoints are managed by a signed-in person in the app.
- A key cannot move money out unless that is switched on. Approving, paying out, withdrawing and sending to another wallet are for people in the app, who confirm with a code from their authenticator. Collecting money and reading are always available to keys.
A key stops working the moment it is revoked, when it passes its expiry date, or when the person who created it leaves the organisation.
When a key is refused
| Status | Code | Why |
|---|---|---|
| 401 | API_KEY_INVALID | The key is wrong, revoked or expired, or its creator is no longer an active member. |
| 403 | API_KEY_NOT_ALLOWED | The endpoint is not open to API keys at all. It is for a signed-in person. |
| 403 | PERMISSION_REQUIRED | The endpoint is open to keys, but this key does not hold the permission it needs. The message names the missing permission. |
{
"error": {
"code": "API_KEY_INVALID",
"message": "This API key is not valid (wrong, revoked or expired)."
}
}Keeping keys safe
A key is a password for your organisation
- Store keys in your host's secret store or an environment variable, never in code.
- Use one key per system, with the fewest permissions that system needs. If one leaks you revoke one.
- Use a separate key for the sandbox and for live. They are different organisations at different addresses (see Sandbox and going live).
- The list of keys in the app shows when each was last used. Revoke the ones that have gone quiet.