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.
Create the charge
SendPOST /api/v1/charges/ with the plan and customer identifiers. chargePeriod must be ONE_TIME.
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 returns201 Created with the charge record:
id with your own purchase record. You can also confirm the payment from Sales → Orders in the Kelviq dashboard.
Handle failed charges
The API returns400 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.