Skip to main content
Every request you make to the PayGood API must include your API key as a Bearer token in the Authorization header. PayGood rejects any request that is missing this header or that presents an invalid key.

Authorization header format

Include the following header in every API request, replacing the placeholder with your actual key:

Authenticated request examples

The examples below show how to make an authenticated GET /payments request across common HTTP clients.

Authentication failures

If your request is missing the Authorization header or your key is invalid, expired, or has been revoked, the API returns a 401 Unauthorized response:
Check that you are using the correct key for the environment you are targeting — your sandbox key will be rejected by the production environment, and vice versa. If you continue to receive 401 errors after verifying your key, rotate your key and try again.
Always read your API key from an environment variable rather than hardcoding it in your source. This prevents accidental exposure in version control and makes it easy to swap keys between environments without changing your code. See Set Up Your PayGood API Keys for instructions.