Authentication
Every request to the KingsPay API must be authenticated using your secret API key passed as a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEYMaking an authenticated request
Pass the header on every API call from your backend:
curl -X POST "https://api.kingsplatform.net/api/api/v1/payments/charges" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Replace YOUR_API_KEY with the secret key you copied when creating your API key.
For a full walkthrough on creating and managing API keys, see API Keys in the Documentation. For security best practices such as scoping permissions and restricting by IP, see Best Practices.
Error responses
| Status | Meaning |
|---|---|
401 Unauthorized | The Authorization header is missing or the API key is invalid. |
403 Forbidden | The API key is valid but does not have permission to perform the requested action. Check the key's permissions. |