Skip to main content
POST
/
charges
/
Create a charge
curl --request POST \
  --url https://sandboxapi.kelviq.com/api/v1/charges/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "planIdentifier": "lifetime-access",
  "chargePeriod": "ONE_TIME",
  "customerId": "cust_789",
  "features": [
    {
      "identifier": "seats",
      "quantity": 5
    }
  ],
  "currencyCode": "USD",
  "ipAddress": "103.154.35.20"
}
'
import requests

url = "https://sandboxapi.kelviq.com/api/v1/charges/"

payload = {
"planIdentifier": "lifetime-access",
"chargePeriod": "ONE_TIME",
"customerId": "cust_789",
"features": [
{
"identifier": "seats",
"quantity": 5
}
],
"currencyCode": "USD",
"ipAddress": "103.154.35.20"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
planIdentifier: 'lifetime-access',
chargePeriod: 'ONE_TIME',
customerId: 'cust_789',
features: [{identifier: 'seats', quantity: 5}],
currencyCode: 'USD',
ipAddress: '103.154.35.20'
})
};

fetch('https://sandboxapi.kelviq.com/api/v1/charges/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://sandboxapi.kelviq.com/api/v1/charges/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'planIdentifier' => 'lifetime-access',
'chargePeriod' => 'ONE_TIME',
'customerId' => 'cust_789',
'features' => [
[
'identifier' => 'seats',
'quantity' => 5
]
],
'currencyCode' => 'USD',
'ipAddress' => '103.154.35.20'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://sandboxapi.kelviq.com/api/v1/charges/"

payload := strings.NewReader("{\n \"planIdentifier\": \"lifetime-access\",\n \"chargePeriod\": \"ONE_TIME\",\n \"customerId\": \"cust_789\",\n \"features\": [\n {\n \"identifier\": \"seats\",\n \"quantity\": 5\n }\n ],\n \"currencyCode\": \"USD\",\n \"ipAddress\": \"103.154.35.20\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://sandboxapi.kelviq.com/api/v1/charges/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"planIdentifier\": \"lifetime-access\",\n \"chargePeriod\": \"ONE_TIME\",\n \"customerId\": \"cust_789\",\n \"features\": [\n {\n \"identifier\": \"seats\",\n \"quantity\": 5\n }\n ],\n \"currencyCode\": \"USD\",\n \"ipAddress\": \"103.154.35.20\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://sandboxapi.kelviq.com/api/v1/charges/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"planIdentifier\": \"lifetime-access\",\n \"chargePeriod\": \"ONE_TIME\",\n \"customerId\": \"cust_789\",\n \"features\": [\n {\n \"identifier\": \"seats\",\n \"quantity\": 5\n }\n ],\n \"currencyCode\": \"USD\",\n \"ipAddress\": \"103.154.35.20\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "7c2f3a91-2d4e-4a8b-9b1c-6f0a2e5d9c11",
  "startDate": "2026-06-20",
  "endDate": null,
  "billingPeriodStartTime": null,
  "billingPeriodEndTime": null,
  "amount": "49.00",
  "recurrence": "",
  "currency": "USD",
  "status": "active",
  "product": {
    "name": "Invoice Test",
    "id": "88e437b8-6017-405b-9328-e0f4e140bb79",
    "identifier": "invoice-test"
  },
  "plan": {
    "name": "Lifetime Access",
    "identifier": "lifetime-access"
  },
  "features": [],
  "trialDaysRemaining": 0,
  "customerId": "geojacob",
  "billingType": "ONE_TIME",
  "recurrenceUnit": null,
  "recurrenceType": null
}
{
"detail": "A payment method is required to complete this payment."
}
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 plan being purchased as a one-time payment.

Example:

"lifetime-access"

chargePeriod
enum<string>
required

Must be ONE_TIME. Any other value is rejected.

Available options:
ONE_TIME
Example:

"ONE_TIME"

customerId
string
required

The ID of the customer being charged. The customer must already have a default payment method on file.

Example:

"cust_789"

features
object[] | null

A list of features and their desired quantities.

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

Optional ISO 4217 currency code to charge in. Must match the customer's currency if they already have one set.

Example:

"USD"

ipAddress
string | null

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

Example:

"103.154.35.20"

Response

Charge created

id
string<uuid>

The unique identifier of the created charge record.

Example:

"7c2f3a91-2d4e-4a8b-9b1c-6f0a2e5d9c11"

startDate
string<date>

The date the one-time payment was created.

Example:

"2026-06-20"

endDate
string<date> | null

Always null for one-time payments.

Example:

null

billingPeriodStartTime
string<date-time> | null

Not applicable for one-time payments.

Example:

null

billingPeriodEndTime
string<date-time> | null

Not applicable for one-time payments.

Example:

null

amount
string

The amount charged.

Example:

"49.00"

recurrence
string

Empty for one-time payments.

Example:

""

currency
string

The currency of the payment.

Example:

"USD"

status
string

The status of the resulting record.

Example:

"active"

product
object
plan
object
features
any[]

List of features included in the purchase.

trialDaysRemaining
integer

Always 0 for one-time payments.

Example:

0

customerId
string

The customer identifier associated with this payment.

Example:

"geojacob"

billingType
string

The billing type of the record.

Example:

"ONE_TIME"