Prerequisites
- A verified cNGN merchant account with dashboard access
- Your server’s public IP address
- An Ed25519 SSH key pair (used to encrypt API responses to you)
1. Generate your API key
From the merchant dashboard, generate an API key for the environment you want to use:2. Whitelist your IP address
The API rejects requests from IP addresses that are not whitelisted with a403 IP address not whitelisted error. Add every server IP that will call the API in your dashboard’s security settings.
3. Upload your Ed25519 public key
Generate an Ed25519 key pair and upload the public key to your dashboard for the matching environment:cngn_api_key (private; keep it secret) and cngn_api_key.pub (public; upload it). The API encrypts every response payload to this public key; only your private key can decrypt it. Each environment (test/live) has its own SSH key slot; a request fails with No Test SSH Key found / No Live SSH Key found if the key for that environment is missing.
4. Make your first request
GET /balance requires no request body, so no request encryption is needed, which makes it a good first call:
data field is an encrypted base64 string:
5. Decrypt the response
Decryptdata with your Ed25519 private key (see the Encryption guide for full implementations). The decrypted payload:
6. Encrypt request bodies
EveryPOST/PUT endpoint requires the JSON body to be AES-256-CBC encrypted and wrapped as:
Missing encryption data, key, or IV. See Encryption for step-by-step code, or use an official SDK which handles this automatically.
Next steps
Authentication
How API keys, environments, and IP whitelisting work.
Encryption
Encrypt requests and decrypt responses.
API Reference
Explore every endpoint.
Errors
Understand and handle error responses.