Skip to main content
Use the Create Charge API when an existing customer has agreed to a one-time purchase and already has a usable payment method saved in Kelviq. The payment is attempted immediately, so the customer does not need to complete another checkout session. Common examples include selling an add-on after the original checkout or collecting a one-time setup fee from an existing customer.
Create a charge from your backend only. It requires a Server API Key, which must never be exposed in browser or mobile-app code.

Before you start

Make sure all of the following are true:
  • The customer already exists in the same Kelviq environment as your API key.
  • The customer has a usable default payment method from a previous checkout or an active subscription.
  • The plan has a one-time price and you know its plan identifier.
  • You have the customer’s unique customerId.
Sandbox and production are isolated. A sandbox customer or payment method cannot be charged with a production key, and the reverse is also true.

Create the charge

Send POST /api/v1/charges/ with the plan and customer identifiers. chargePeriod must be ONE_TIME.
The features and currencyCode fields are optional. Include features when the customer is choosing a quantity, such as five seats. If the customer already has a currency, currencyCode must match it.

Handle the response

A successful request returns 201 Created with the charge record:
Store the returned id with your own purchase record. You can also confirm the payment from Sales → Orders in the Kelviq dashboard.

Handle failed charges

The API returns 400 Bad Request when Kelviq cannot complete the payment. The response includes a detail message describing the problem. Do not automatically retry a 400 response. If a request times out and the outcome is unclear, check Sales → Orders before sending it again to avoid charging the customer twice.

When to use checkout instead

Use a checkout session when the customer needs to:
  • enter a payment method for the first time;
  • complete card or bank authentication;
  • review and confirm the purchase in a hosted payment flow; or
  • start a recurring subscription.
For every request field and response property, see Create a charge API reference.