Skip to content

Search API reference

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

Create a credit grant

Give a customer credits for their usage.

POST/v1/billing/credit_grants

Give a customer credits for their usage.

A permission of its own

Granting credits gives money away, so a restricted key needs write access to credit grants, apart from usage.

Endpoint

http
POST /v1/billing/credit_grants

Request body

NameTypeRequiredDescription
customerstringRequiredWho it's for, cust_....
namestringRequiredShown on invoices.
categoryenumRequiredpaid or promotional.
currencystringRequiredusd.
amountintegerRequiredIn cents.
applicabilityobjectOptionalDefault: { "scope": "all" }.
priorityintegerOptionalLower is spent first. Default 50.
effective_attimestampOptionalDefault: now.
expires_attimestampOptionalDefault: never.

Example request

bash
curl -X POST https://api.sovgate.com/v1/billing/credit_grants \  -H "Authorization: Bearer sov_sk_test_your_key" \  -H "Idempotency-Key: 3b6661a4-4b2a-4c1d-9e3f-d2b61745753b" \  -H "Content-Type: application/json" \  -d '{  "customer": "cust_13ed3f69adfcfcb6289a5491",  "name": "Prepaid credits",  "category": "paid",  "currency": "usd",  "amount": 50000}'

Example response

json
{  "id": "cgrt_9f062f83df7727108a0c4e44",  "object": "credit_grant",  "livemode": false,  "customer": "cust_13ed3f69adfcfcb6289a5491",  "name": "Prepaid credits",  "category": "paid",  "currency": "usd",  "amount": 50000,  "applicability": {    "scope": "all"  },  "priority": 50,  "status": "granted",  "effective_at": "2026-11-27T09:00:00Z",  "expires_at": null,  "voided_at": null,  "created": "2026-11-27T09:00:00Z"}