Skip to main content
POST
Create a subscription
Click the base URL in the API playground and select the Sandbox host for test data or the Production host for live data. Use credentials from the same environment.

Authorizations

Authorization
string
header
required

The Server API Key obtained from the kelviq application. Pass as a Bearer token in the Authorization header. Example: 'Authorization: Bearer YOUR_API_KEY'

Body

application/json
planIdentifier
string
required

The identifier of the specific plan the customer is subscribing to.

Example:

"plan-pro-monthly"

chargePeriod
enum<string>
required

The billing cycle for the subscription. If the plan is free, pass ONE_TIME as the chargePeriod.

Available options:
ONE_TIME,
MONTHLY,
YEARLY,
WEEKLY,
DAILY,
TWENTY_EIGHT_DAYS,
THREE_MONTHS,
SIX_MONTHS
Example:

"MONTHLY"

customerId
string | null
required

The ID of the customer creating the subscription.

Example:

"cust_789"

successUrl
string<url> | null

The URL to which the user will be redirected after a successful subscription creation. Optional.

Example:

"https://kelviq.com/subscription/success"

features
object[] | null

A list of features and their desired quantities.

Example:
ipAddress
string | null

The IP Address of the customer, used for location-based pricing.

Example:

"103.154.35.20"

Response

Subscription Created

id
string<uuid>

The unique identifier of the created subscription.

Example:

"520ca8a5-9fc0-4d6a-bc7a-2ba331595441"

startDate
string<date>

The start date of the subscription.

Example:

"2026-02-07"

endDate
string<date> | null

The end date of the subscription, if applicable.

Example:

null

billingPeriodStartTime
string<date-time>

The start time of the current billing period.

Example:

"2026-02-07T06:02:05Z"

billingPeriodEndTime
string<date-time>

The end time of the current billing period.

Example:

"2026-02-08T06:02:05Z"

amount
string

The subscription amount.

Example:

"2000.00"

recurrence
string

The recurrence interval of the subscription.

Example:

"month"

currency
string

The currency of the subscription.

Example:

"USD"

status
string

The current status of the subscription.

Example:

"trialing"

product
object
plan
object
features
any[]

List of features included in the subscription.

trialDaysRemaining
integer

Number of trial days remaining.

Example:

1

customerId
string

The customer identifier associated with this subscription.

Example:

"geojacob"

files
object[]

Downloadable files attached to the subscription's plan.

External links attached to the subscription's plan.

license
object[]

Issued licenses associated with the subscription.