Authentication

API keys

YnoPay uses bearer token authentication. Include your secret key in every request:

Authorization: Bearer sk_test_abc123...

Key types

PrefixModeDescription
sk_test_TestNo real payments. Safe for development.
sk_live_LiveReal payments. Keep secret.

Security best practices

  • Never expose secret keys in client-side code or public repos
  • Use environment variables to store keys
  • Rotate keys periodically from the dashboard
  • Use test keys during development

Error responses

Invalid or missing keys return 401 Unauthorized:

{
  "error": {
    "type": "authentication_error",
    "code": "invalid_api_key",
    "message": "Invalid API key provided."
  }
}