Skip to main content
POST
/
checkout
Create a checkout session
curl --request POST \
  --url https://api.kelviq.com/api/v1/checkout/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "planIdentifier": "plan-pro-monthly",
  "successUrl": "https://kelviq.com/checkout/success",
  "chargePeriod": "MONTHLY",
  "customerId": "cust_789",
  "features": [
    {
      "identifier": "seats",
      "quantity": 5
    }
  ],
  "ipAddress": "103.154.35.20"
}
'
{
  "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_test_b1sNi7D6u9iMCUFV1UZi9ZaiXKdOOmr3DCUW6XdCZIr5Id1F7#fid...",
  "checkoutSessionId": "cs_test_b1sNi7D6u9iMCUFV1UZi9ZwerfaiXKdOOmr3DCUW6XdCZIr5Id1F7G"
}

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 checking out with.

Example:

"plan-pro-monthly"

successUrl
string<url>
required

The URL to which the user will be redirected after a successful checkout.

Example:

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

chargePeriod
enum<string>
required

The billing cycle for the subscription.

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

"MONTHLY"

customerId
string | null

The ID of the customer initiating the checkout. If not provided, a new customer may be created depending on server logic.

Note: Even if a unique customer ID is provided, if the email address already exists in the system, the subscription will be created for that existing email — not the new customer ID. This is to preserve the uniqueness of the email address.

Example:

"cust_789"

features
object[] | null

A list of features and their desired quantities. SDK documentation notes this as 'Required', but usage may vary based on examples.

Example:
[{ "identifier": "seats", "quantity": 5 }]
ipAddress
string | null

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

Example:

"103.154.35.20"

Response

201 - application/json

Checkout Session Created

checkoutUrl
string<url>

The URL that the customer should be redirected to complete the payment.

Example:

"https://checkout.stripe.com/c/pay/cs_test_b1sNi7D6u9iMCUFV1UZi9ZaiXKdOOmr3DCUW6XdCZIr5Id1F7#fid..."

checkoutSessionId
string

The unique ID for the created checkout session.

Example:

"cs_test_b1sNi7D6u9iMCUFV1UZi9ZwerfaiXKdOOmr3DCUW6XdCZIr5Id1F7G"