Skip to content

Search API reference

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

Quick start

Take your first test payment: open a checkout session, pay it with a test card, and confirm it from your server.

This guide takes a test payment end to end. Nothing here moves real money.

Get a test secret key

In the Dashboard, switch to test mode and open Developers › API keys. Create a secret key, or a restricted key with Checkout sessions on Write, and keep it in your server's environment. It starts with sov_sk_test_ or sov_rk_test_.

Open a checkout session

When your customer clicks to pay, your server opens a session with what it sells. Read the prices from your own records, never from the browser.

Send your customer to pay

Redirect the customer's browser to the session's url. In test mode, pay with the test card 4242 4242 4242 4242, any future expiry date and any security code.

Get told it was paid

Add a webhook endpoint for checkout.session.completed in Developers › Webhooks. Sovgate sends the event to your server once the customer has paid.

Confirm, then fulfil

Check the event's signature, read the session back, check that payment_status is paid, then fulfil the order by its client_reference_id, once.

Open the session

Create a checkout session
bash
curl -X POST https://api.sovgate.com/v1/checkout/sessions \  -H "Authorization: Bearer sov_sk_test_your_key" \  -H "Idempotency-Key: 7d3c2f10-9b4e-4f8a-a1c2-5e6f7a8b9c0d" \  -H "Content-Type: application/json" \  -d '{  "mode": "payment",  "line_items": [    {      "quantity": 1,      "price_data": {        "currency": "usd",        "unit_amount": 4000,        "product_data": { "name": "Pottery workshop" }      }    }  ],  "client_reference_id": "order_8812",  "success_url": "https://shop.example.com/thanks?session_id={CHECKOUT_SESSION_ID}"}'

The answer holds the session, with its url:

Response
json
{  "id": "cs_test_...",  "object": "checkout_session",  "status": "open",  "payment_status": "unpaid",  "amount_total": 4000,  "url": "https://pay.sovgate.com/..."}

Read it back

Retrieve the session
bash
curl https://api.sovgate.com/v1/checkout/sessions/cs_test_... \  -H "Authorization: Bearer sov_sk_test_your_key"

When status is complete and payment_status is paid, the money is yours. The same event can arrive more than once, so fulfil each order once.

Go live

Verify your business in the Dashboard, put your live key in your server's environment in place of the test one, add a live webhook endpoint, and add your success page's domain to your allowed return addresses. Live and test mode keep their own keys, endpoints and sessions.