Skip to content

Search API reference

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

Create a subscription

Start billing a customer on a schedule.

POST/v1/subscriptions

Creates a subscription. With charge_automatically, it charges the customer's saved card; a customer with none is incomplete until they add one, and nothing is billed meanwhile.

Endpoint

http
POST /v1/subscriptions

Request body

NameTypeRequiredDescription
customerstringRequiredWho it bills, cust_....
namestringRequiredWhat the customer sees.
currencystringRequiredusd.
line_itemsarrayRequiredUp to 20 recurring prices of the same interval, each with a quantity.
collectionenumRequiredcharge_automatically or send_invoice.
days_until_dueintegerOptionalFor send_invoice: 0, 7, 14 or 30.
start_datedateOptionalToday, or any day within a year. Default: today.
trial_daysintegerOptionalUp to 365.
end_datedateOptionalWhen it ends on its own.
tax_rate_bpsintegerOptionalIn basis points, added to each period.
descriptionstringOptionalOn invoices and receipts.

Example request

bash
curl -X POST https://api.sovgate.com/v1/subscriptions \  -H "Authorization: Bearer sov_sk_test_your_key" \  -H "Idempotency-Key: e6eb4274-4b2a-4c1d-9e3f-fe0b7240dd8c" \  -H "Content-Type: application/json" \  -d '{  "customer": "cust_13ed3f69adfcfcb6289a5491",  "name": "Studio membership",  "currency": "usd",  "line_items": [    {      "price": "price_d2fcc8475d89f661d674185c",      "quantity": 1    }  ],  "collection": "charge_automatically"}'

Example response

json
{  "id": "sub_2924bc30f433418e621960a1",  "object": "subscription",  "livemode": false,  "customer": "cust_13ed3f69adfcfcb6289a5491",  "name": "Studio membership",  "status": "active",  "currency": "usd",  "line_items": [    {      "price": "price_d2fcc8475d89f661d674185c",      "quantity": 1    }  ],  "amount": 2900,  "interval": {    "unit": "month",    "count": 1  },  "collection": "charge_automatically",  "days_until_due": null,  "start_date": "2026-11-01",  "trial_end": null,  "end_date": null,  "next_billing_date": "2026-12-01",  "cancel_at_period_end": false,  "canceled_at": null,  "paused_at": null,  "resumes_on": null,  "created": "2026-11-01T10:12:00Z"}