Overview
Purchases additional credits for your tenant. Credits draw from the saved payment method on file. Credits are added immediately and do not expire within the current calendar year.
Required role: admin
Your tenant must have a valid payment method saved before purchasing credits. Credits purchased in excess of your plan limit are carried into the next period.
JWT Bearer token. Format: Bearer <your-jwt>.
Request body
Type of credits to purchase. One of: investigations, events.
Number of credits to purchase. Minimum: 100 for investigations, 10000 for events.
Response
Returns 201 Created.
{
"purchaseId": "pch_01HX9VTPQR3KF8MZWBYD5N6JCE",
"creditType": "investigations",
"quantity": 500,
"amountUsd": 49.00,
"newBalance": 750,
"purchasedAt": "2024-04-01T14:30:00Z"
}
| Field | Type | Description |
|---|
purchaseId | string | Unique purchase transaction ID |
creditType | string | The type of credits purchased |
quantity | integer | Credits purchased |
amountUsd | number | Amount charged in USD |
newBalance | integer | Updated credit balance after purchase |
purchasedAt | string | ISO 8601 timestamp |
Error responses
| Status | Error code | Description |
|---|
400 | validation_error | Invalid creditType or quantity below minimum |
401 | unauthorized | Missing or invalid JWT |
403 | forbidden | Caller lacks admin role |
402 | payment_failed | Charge declined — update payment method in dashboard |
409 | no_payment_method | No payment method on file |
Examples
curl https://api.causeflow.ai/v1/billing/credits/purchase \
-X POST \
-H "Authorization: Bearer eyJhbGc..." \
-H "Content-Type: application/json" \
-d '{
"creditType": "investigations",
"quantity": 500
}'
Credits balance
View current credit balance
Usage
Monitor quota burn rate