> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talkover.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Purchase Credits

> Purchase credits to top up your account balance

# Purchase Credits

Purchase credits to top up your account balance. The transaction is charged to the saved payment method.

<Info>
  This endpoint is part of the **Account API** and is authenticated with a user session token.
</Info>

## Endpoint

```
POST /api/v1/credits/purchase
```

## Request headers

<ParamField header="Authorization" type="string" required>
  User session token. Format: `Bearer <user_session_token>`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be set to `application/json`
</ParamField>

## Request body

<ParamField body="amount" type="number" required>
  Credit amount to purchase, in account currency. Must be greater than `0`.
</ParamField>

<ParamField body="payment_method_id" type="string">
  Optional payment method ID. If omitted, the default payment method is charged.
</ParamField>

## Examples

<RequestExample>
  ```bash theme={null}
  curl -X POST "https://app.talkover.ai/api/v1/credits/purchase" \
    -H "Authorization: Bearer your_user_session_token" \
    -H "Content-Type: application/json" \
    -d '{
      "amount": 100.00,
      "payment_method_id": "pm_uuid_1"
    }'
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "amount_charged": 100.00,
      "currency": "USD",
      "new_balance": 250.00,
      "transaction_id": "txn_uuid_1"
    }
  }
  ```
</ResponseExample>

## Error responses

### 402 — Payment Failed

<ResponseExample>
  ```json theme={null}
  {
    "success": false,
    "message": "Payment method declined",
    "code": "PAYMENT_FAILED"
  }
  ```
</ResponseExample>

## Notes

* For automated, recurring top-ups, use [Auto Topup](/api-reference/endpoints/get-auto-topup-settings) with an environment token instead.
