API keys let your server create payments, payment links and refunds. Each key is a secret.
lyn_test_keys create test payments. No real money moves.lyn_live_keys charge real cards.
Create a key
- Open Developers in the dashboard and choose Create key.
- Give it a name you will recognize, for example the server or app that uses it.
- Copy the key and store it in your server's environment variables or secrets manager. It is shown only once.
If two-factor authentication is on, you may be asked for a code. In live mode, you need two-factor authentication before you can create keys. See Two-factor authentication.
Use a key
Send it in the Authorization header as Bearer lyn_test_.... Full examples are in the developer docs.
Keep keys safe
- Use keys from your server only, never in a browser, a mobile app or a public repository.
- Use one key per app or server, so you can revoke one without breaking the others.
- Never send a key to anyone, including Lynent support.
Revoke a key
In Developers, revoke the key. Requests with it fail right away. Create a new key and update your server.
Common errors
missing_api_key: theAuthorizationheader is missing.invalid_api_key: the key is wrong, or was copied with extra spaces.api_key_revoked: the key was revoked. Create a new one.api_key_mode_mismatch: a test key was used against live mode, or the reverse.
Every error response has a request_id. Include it when you open an issue, but never include the key.