Skip to content

Search documentation

Find a page of the Sovgate documentation and jump straight to it.

Manage your API keys

Create secret, restricted and publishable keys, limit them to your servers' addresses, and roll or expire them safely.

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

KeyStarts withWhat it can do
Publishablesov_pk_Safe in a browser or an app: it can only collect payment details, for payments your server makes.
Secretsov_sk_Every permission. Keep it on your servers, never in an app or a browser.
Restrictedsov_rk_Only the permissions you give it. The safest key for each service you run.
A live secret key can do everything

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.