An API key is a secret code that identifies your website or app when it talks to a service. With a payment gateway, your server sends the key with every request, and the gateway uses it to know which account and store the request belongs to and what it is allowed to do.
Anyone who has the key can act as your store: create invoices, read balances and, depending on the key, send payouts. That is why it belongs on your server only. Never put it in a web page, a mobile app or a public code repository, where visitors can read it. If a key may have leaked, replace it at once.
On AywaPay each store has its own keys. The key goes only in the Authorization header of a request, never in the URL. Keys are stored encrypted and shown only after a fresh two-factor check, and you can let only your own servers' IP addresses use a store's key. A separate test key lets you build and try everything before going live.
Common questions
Can I use my API key in the browser?
No. Code that runs in the browser can be read by anyone. Call the API from your server and send only the result, such as the payment page link, to the browser.
What should I do if my API key leaks?
Create a new key, put it on your server and delete the old one. Turning on an IP allowlist for the store also stops a stolen key from working anywhere else.