API Keys
Managing public and secret API keys in the GoPayLocal dashboard.
GoPayLocal uses two types of API keys for different purposes.
Key Types
Section titled “Key Types”| Type | Prefix | Purpose | Safe for Client? |
|---|---|---|---|
| Public Key | gpl_pk_* | Banner script, SDK initialization | Yes |
| Secret Key | gpl_sk_* | Server-side API access | No |
Public Keys
Section titled “Public Keys”Public keys are used in the banner script and SDK initialization. They can only read banner configuration data and are safe to include in client-side code.
<!-- Public key in script tag — safe --><script src="https://api.gopaylocal.com/v1/banner/script.js?key=gpl_pk_live_abc123" async></script>// Public key in React — safe<GoPayLocalProvider apiKey="gpl_pk_live_abc123">Secret Keys
Section titled “Secret Keys”Secret keys provide full CRUD access to the GoPayLocal API. They must be kept on your server and never exposed to the client.
# Secret key in server-side code — keep securecurl -H "Authorization: Bearer gpl_sk_live_xyz789" \ https://api.gopaylocal.com/v1/productsManaging Keys
Section titled “Managing Keys”Generate a Key
Section titled “Generate a Key”- Go to app.gopaylocal.com > Settings > API Keys
- Click Generate Key
- Choose the key type (Public or Secret)
- Give it a descriptive name (e.g., “Production Banner”, “CI/CD Pipeline”)
- Copy the key — it is only shown once
List Keys
Section titled “List Keys”View all active keys with their names, types, creation dates, and last-used timestamps.
Revoke a Key
Section titled “Revoke a Key”Click Revoke next to any key to permanently disable it. Revoked keys cannot be re-enabled.
Key Rotation
Section titled “Key Rotation”To rotate keys safely:
- Generate a new key
- Update your code to use the new key
- Deploy the changes
- Verify the new key works
- Revoke the old key
Environment-Specific Keys
Section titled “Environment-Specific Keys”Use different keys for different environments:
| Environment | Key Name | Prefix |
|---|---|---|
| Development | Dev Banner | gpl_pk_test_* |
| Staging | Staging Banner | gpl_pk_test_* |
| Production | Production Banner | gpl_pk_live_* |
Test keys (gpl_pk_test_*) use sandbox data and do not count against your API quota.