Skip to main content

Setup: Get API Keys & Make Your First Call

Get your NextAPI credentials and make your first authenticated API call to start integrating with our payment platform.

Getting Your API Keys​

1. Sign Up for NextAPI​

Create your account at https://dashboard.nextapi.com

2. Navigate to API Settings​

Go to Settings → API Keys in your dashboard

3. Generate Your Keys​

  • Sandbox Key: For testing and development
  • Production Key: For live transactions

API Key Types​

  • Public Key: Used for client-side operations (payment links, checkout)
  • Secret Key: Used for server-side operations (payouts, wallet management)
  • Webhook Secret: For verifying webhook signatures

Making Your First API Call​

Test Your Connection​

curl -X GET "https://api.nextapi.com/v1/health" \
-H "Authorization: Bearer YOUR_SANDBOX_API_KEY"

Get Account Information​

curl -X GET "https://api.nextapi.com/v1/account" \
-H "Authorization: Bearer YOUR_SANDBOX_API_KEY"

Environment Configuration​

Development (Sandbox)​

const config = {
baseURL: 'https://api-sandbox.nextapi.com',
apiKey: 'sk_test_your_sandbox_key_here',
webhookSecret: 'whsec_your_webhook_secret'
};

Production​

const config = {
baseURL: 'https://api.nextapi.com',
apiKey: 'sk_live_your_production_key_here',
webhookSecret: 'whsec_your_production_webhook_secret'
};

Best Practices​

  • Never expose secret keys in client-side code
  • Use environment variables for API keys
  • Rotate keys regularly for security
  • Use sandbox keys for development and testing
  • Implement proper error handling for API responses

Common Response Codes​

  • 200: Success
  • 401: Invalid API key
  • 403: Insufficient permissions
  • 429: Rate limit exceeded
  • 500: Server error

Next Steps​

  • [Try Postman integration](./setup-using-nextapi-with-postman
  • [Send your first payout](./your-first-payout
  • [Create payment links](./create-your-first-payment-link