Skip to content

Authentication

Authentication methods for the GoPayLocal API.

GoPayLocal supports multiple authentication methods depending on the endpoint and use case.

Public endpoints (banner config, banner script) use public API keys passed as URL parameters or headers. No session or OAuth is required.

GET https://api.gopaylocal.com/v1/banner/config/gpl_pk_live_abc123

Public keys (prefix gpl_pk_) can only access read-only banner configuration endpoints. They are safe to use in client-side code.

For server-side API access (creating products, managing campaigns, etc.), use secret API keys in the Authorization header:

Terminal window
curl -X GET https://api.gopaylocal.com/v1/products \
-H "Authorization: Bearer gpl_sk_live_xyz789" \
-H "Content-Type: application/json"

The GoPayLocal dashboard uses Better Auth session cookies for authentication. This is not relevant for API integrations but is documented for completeness.

  1. User visits app.gopaylocal.com/login
  2. Better Auth creates a session cookie
  3. All dashboard API calls include the session cookie automatically

The dashboard supports social login:

ProviderSign In URL
GooglePOST /api/auth/signin/google
GitHubPOST /api/auth/signin/github

Returned when no valid authentication is provided:

{
"error": "unauthorized",
"message": "Invalid or missing API key"
}

Returned when the API key does not have permission for the requested operation:

{
"error": "forbidden",
"message": "Public keys cannot access this endpoint. Use a secret key."
}

API requests are rate-limited per API key:

PlanRate Limit
Free100 requests/minute
Pro500 requests/minute
Business2,000 requests/minute

Rate limit headers are included in every response:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1234567890

When rate-limited, you receive a 429 Too Many Requests response:

{
"error": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 30 seconds.",
"retryAfter": 30
}