API
POST /api/billing/topup
Create Topup
POST /api/billing/topup
Create Topup
Authentication: Authorization: Bearer <key> or X-API-Key: <key>. Create keys at developers.cognitivx.io/keys.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Org-ID | header | string | null | No | - |
Request body
A JSON request body is required.
| Field | Type | Required | Description |
|---|---|---|---|
amount_usd | integer | Yes | - |
intent_to_switch | boolean | No | Defaults to false. |
Example request
curl -X POST https://api.cognitivx.io/api/billing/topup \
-H "Authorization: Bearer icog_..." \
-H "Content-Type: application/json" \
-d '{
"amount_usd": 1,
"intent_to_switch": false
}'Example response
200 application/json
{
"client_secret": "string",
"payment_intent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}Responses
| Status | Description |
|---|---|
200 | Success. Returns the response body shown below. |
422 | Request validation failed. detail lists each offending field. |