Skip to content

Search API reference

Find an endpoint or a guide of the Sovgate API reference and jump straight to it.

Authentication

Send a secret or restricted key with every request, and give each service only the access it needs.

Every request carries an API key in the Authorization header, as a bearer token. A key in the address, the query or the body is refused.

An authenticated request
bash
curl https://api.sovgate.com/v1/balance \  -H "Authorization: Bearer sov_sk_test_your_key"

Kinds of key

Make keys in the Dashboard, in Developers › API keys. Each key belongs to one business and one mode, fixed when it's made.

KeyStarts withWhat it can do
Secretsov_sk_live_, sov_sk_test_Every operation of the API. Keep it on your servers, never in a browser or an app.
Restrictedsov_rk_live_, sov_rk_test_Only the access you give it, resource by resource. The safest key for each service you run.
Publishablesov_pk_live_, sov_pk_test_Safe in a browser, but it calls no operation yet.
A live secret key can do everything

Anyone who holds it can take payments, refund them and read your balance. For a service that needs only part of that, use a restricted key.

Restricted keys

A restricted key has a level for each resource: None, Read or Write. Write includes read. A request for anything it wasn't given is refused, and the answer names the resource and the level it needs.

ResourceCovers
PaymentsPayments: read, capture, cancel and receipts.
Checkout sessionsSessions: create, read and expire.
RefundsRefunds.
DisputesDisputes and early fraud warnings, evidence and closing.
CustomersCustomers and their saved cards.
InvoicesInvoices.
SubscriptionsSubscriptions.
Products and pricesProducts, prices, coupons, promotion codes, shipping rates and tax rates.
UsageTelemetries, telemetry events and usage alerts; reading credit grants.
Payment linksPayment links.
BalanceThe balance and balance transactions. Read only.
PayoutsPayouts and bank accounts. Read only.
EventsEvents, for the resources the key can read. Read only.
Webhook endpointsReading endpoints. Read only.

A few operations need a secret key, whatever a restricted key holds: charging a saved card, and recording an invoice payment, which marks money as received that Sovgate didn't see.

Limit where a key works

Give a secret or restricted key up to 50 Allowed IP addresses or ranges: a request from anywhere else is refused, even with the right key. A key can also expire on its own, in 30 days, 90 days or a year.

Roll a key

Rolling makes a new key like the old one. Roll on a schedule, and the old key keeps working for the time you choose, so your code can move. Roll because it may have been exposed, and the old key stops at once. A secret is shown once, when it's made: if you lose it, roll the key.

When a key is refused

StatusCodeWhy
401api_key_expiredThe key has expired. A missing, unknown or wrong key is refused with 401 too.
403ip_not_allowedThe request came from an address not on the key's list.
403secret_key_requiredA publishable key was used.
403permission_missingA restricted key lacks the access this request needs.

Repeated failed attempts from one address are slowed down.