Skip to content

API Keys

API keys authenticate your application to Nivatio's API for order-related operations.

Overview

Each Project in your merchant account has its own API key. Use this key in the x-api-key header for: - Creating orders - Retrieving order details - Updating order metadata


Creating an API Key

  1. Log in to Dashboard
  2. Navigate to ProjectsYour Project
  3. Click API Keys tab
  4. Click Generate New Key
  5. Set permissions and expiration
  6. Copy the key immediately - it won't be shown again!

Secure Your Keys

  • Never commit API keys to version control
  • Use environment variables to store keys
  • Rotate keys regularly
  • Restrict keys with minimal permissions

API Key Permissions

When creating a key, you can assign these permissions:

Permission Can Do
read GET /v1/orders/*
write POST /v1/orders, PATCH /v1/orders/*
admin All order operations + webhook config

Using API Keys

Creating an Order

curl -X POST https://api.nivat.io/v1/orders \
  -H "x-api-key: nv_sk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50000,
    "currency": "NUSD",
    "description": "Order #12345"
  }'

Retrieving an Order

curl https://api.nivat.io/v1/orders/order_abc123 \
  -H "x-api-key: nv_sk_live_abc123..."

Environment Variables

Store your API key securely:

# .env
NIVATIO_API_KEY=nv_sk_live_abc123...
// Using in your app
const response = await fetch('https://api.nivat.io/v1/orders', {
  headers: {
    'x-api-key': process.env.NIVATIO_API_KEY,
    'Content-Type': 'application/json'
  },
  // ...
});

Key Rotation

Rotate your API keys regularly for security:

  1. Generate a new key in the dashboard
  2. Update your application with the new key
  3. Test the integration works with new key
  4. Wait 24 hours for any cached requests
  5. Delete the old key from dashboard

Zero-Downtime Rotation

Generate the new key first, update your app, then delete the old key after confirming everything works.


Managing Multiple Environments

Use separate API keys for each environment:

Environment Key Prefix Base URL
Production nv_sk_live_ https://api.nivat.io
Sandbox nv_sk_test_ https://sandbox.nivat.io

Next Steps