Authentication
NogorPay authenticates every API request with a secret API key. Live keys start with sk_live_.
Create an API key
Section titled “Create an API key”- Sign in to the NogorPay dashboard.
- Open Integrations → Connection settings.
- Select Generate API Key, give the key a name (for example
Production server), and confirm. - Copy the key and store it in your server’s environment variables or secret manager.
Send the key with each request
Section titled “Send the key with each request”Put the key in the NOGORPAY-API-KEY header:
curl https://api.nogorpay.com/api/v1/charge/methods \ -H "NOGORPAY-API-KEY: sk_live_xxxxxxxxxxxxxxxx"The header name is not case-sensitive. NogorPay also accepts the key in an X-API-Key header.
Authentication errors
Section titled “Authentication errors”| Status | message |
Cause |
|---|---|---|
401 |
Not authorized: Missing NOGORPAY-API-KEY header |
The request has no API key header. |
401 |
Invalid API Key provided |
The key does not exist or has been revoked. |
403 |
Your merchant account has been deactivated. Please contact support. |
The merchant account that owns the key is inactive. |
Keep keys safe
Section titled “Keep keys safe”- Use the key only on your server. Anyone who has the key can create charges and read payment status for your account.
- Don’t commit keys to Git. Load them from environment variables.
- If a key leaks, revoke it in Integrations → Connection settings and generate a new one. Revoking takes effect within about a minute.
