Developers, API keys lists the keys your code calls the Sovgate API with, in the mode you're in. Test keys contain _test_ and live keys _live_.
Kinds of key
| Key | Starts with | What it can do |
|---|---|---|
| Publishable | sov_pk_ | Safe in a browser or an app: it can only collect payment details, for payments your server makes. |
| Secret | sov_sk_ | Every permission. Keep it on your servers, never in an app or a browser. |
| Restricted | sov_rk_ | Only the permissions you give it. The safest key for each service you run. |
Anyone who holds it can take payments, refund them and pay out your balance. For a service that needs only part of that, use a restricted key.
Create a key
Start
Choose New key and pick its Type.
Name it
Name it after what uses it, such as "Order service". Where it's kept says where the key lives, such as the name of a vault: never the key itself.
Give it permissions
For a restricted key, give it only what the service using it needs, area by area, such as Payments, Checkout sessions, Refunds, Customers or Webhook endpoints. Write includes read. A request for anything it wasn't given is refused.
Limit where it's used
Allowed IP addresses: limit it to your servers' addresses, and a leaked key can't be used anywhere else. A request from any other address is refused, even with the right key.
Choose when it expires
Never, or in 30 days, 90 days or 1 year.
Save the secret
The secret is shown once, when the key is made. Store it safely, then tick I've saved the secret somewhere safe. Only its last four characters are kept.
Roll a key
Rolling makes a new key like the old one and stops the old one. Choose Roll key, then:
- Replacing it on schedule: the old key works on for the time you choose (in 1 hour, 24 hours, 3 days or 7 days), so your code can move to the new one.
- It may have been exposed: the old key stops at once. Anything still using it fails until it has the new key.
Lost a secret? Roll the key to get a new one: a secret can't be shown again.
Expire a key
Expire key stops it. For a live key, type its name to confirm: your production may depend on it. A key is Active, Expiring within 7 days of its end or while it's rolled, or Expired.
A key's page shows when it was Last used, and View request logs shows the requests made with it. Each mode can have up to 50 secret and restricted keys working at once.