Skip to main content

Overview

API keys allow you to interact with the PayGate Public API programmatically.

Creating API Keys

  1. Go to paygate.getaether.xyz
  2. Navigate to SettingsAPI Keys
  3. Click Create API Key
  4. Enter a label (e.g., “Production”, “Development”)
  5. Copy and securely store the key
API keys are shown only once. Store them securely - you cannot retrieve them later.

Key Format

pk_0234decff71667369ce0c6de873cad2a4ce88e470ea4d8afda2704391bf34df8
  • Prefix: pk_ (public key)
  • Length: 64 hex characters
  • Unique per account

Using API Keys

Header Authentication

Include the API key in the X-API-Key header:
curl -X GET "https://api-paygate.getaether.xyz/public/products" \
  -H "X-API-Key: pk_your_api_key_here" \
  -H "Content-Type: application/json"

TypeScript Example

const PAYGATE_API_KEY = process.env.PAYGATE_API_KEY;
const BASE_URL = 'https://api-paygate.getaether.xyz';

async function getProducts() {
  const response = await fetch(`${BASE_URL}/public/products`, {
    headers: {
      'X-API-Key': PAYGATE_API_KEY,
      'Content-Type': 'application/json'
    }
  });

  return response.json();
}

Available Endpoints

With a valid API key, you can access:
EndpointMethodDescription
/public/productsGETList all your products
/public/products/:idGETGet specific product
/public/statsGETGet payment statistics
/public/access/checkPOSTCheck wallet access
/public/verify/:txHashGETVerify transaction
/public/feature/verifyPOSTVerify access token
/public/feature/tokensGETList access tokens
/public/feature/revokePOSTRevoke access token

Rate Limits

TierRequests/minRequests/day
Free6010,000
Pro300100,000
Rate limit headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1704067260

Key Security

Best Practices

  1. Never expose in frontend - Only use on server-side
  2. Use environment variables - Don’t hardcode keys
  3. Rotate regularly - Create new keys periodically
  4. Limit scope - Use separate keys for dev/prod
  5. Monitor usage - Check for unusual activity

Environment Variables

.env
# Development
PAYGATE_API_KEY_DEV=pk_dev_key_here

# Production
PAYGATE_API_KEY_PROD=pk_prod_key_here
const apiKey = process.env.NODE_ENV === 'production'
  ? process.env.PAYGATE_API_KEY_PROD
  : process.env.PAYGATE_API_KEY_DEV;

Managing Keys

List Keys

View all keys in SettingsAPI Keys. Shows:
  • Key prefix (first 12 characters)
  • Label
  • Created date
  • Last used

Revoke Keys

  1. Go to SettingsAPI Keys
  2. Find the key to revoke
  3. Click Revoke
  4. Confirm
Revoking a key immediately invalidates it. Any applications using that key will stop working.

Error Responses

Invalid Key

{
  "error": "Invalid or expired API key",
  "code": "INVALID_API_KEY"
}

Missing Key

{
  "error": "API key required",
  "code": "MISSING_API_KEY"
}

Rate Limited

{
  "error": "Rate limit exceeded",
  "code": "RATE_LIMITED",
  "retryAfter": 60
}

Testing

With cURL

# Test your API key
curl -X GET "https://api-paygate.getaether.xyz/public/stats" \
  -H "X-API-Key: pk_your_key" \
  -H "Content-Type: application/json"
Expected response:
{
  "totalRevenue": 125.50,
  "totalTransactions": 47,
  "productCount": 5
}

Common Issues

IssueSolution
Invalid API keyCheck for typos, ensure key is active
API key requiredAdd X-API-Key header
Rate limitedWait and retry, or upgrade tier