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

# Refund Account

> Issue a full refund and cancel the subscription for a TikTok account

## Request Body

<ParamField body="accountId" type="string" required>
  The unique account ID to refund. Retrieve this from the [Get Accounts](/partners/accounts/list) endpoint.
</ParamField>

<ParamField body="reason" type="string">
  Optional reason for the refund request (e.g., "Shadowban", "Service issue").
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Returns `true` if the refund was successfully issued.
</ResponseField>

<ResponseField name="refundId" type="string">
  The Stripe refund ID for reference.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.infinipost.co/v1/partners/refund \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "accountId": "acc_9n2x7yp0dg",
      "reason": "Account was shadowbanned"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.infinipost.co/v1/partners/refund', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      accountId: 'acc_9n2x7yp0dg',
      reason: 'Account was shadowbanned'
    })
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.infinipost.co/v1/partners/refund',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'accountId': 'acc_9n2x7yp0dg',
          'reason': 'Account was shadowbanned'
      }
  )

  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "refundId": "re_1234567890abcdef"
  }
  ```
</ResponseExample>

## Refund Details

* A full refund is issued for the most recent billing period
* The subscription is cancelled immediately
* The account status is updated to `cancelled`

<Warning>
  **This action is irreversible.** Once a refund is issued the subscription is cancelled and cannot be reactivated. Use the [Replace Account](/partners/accounts/replace) endpoint if the user needs a new account instead.
</Warning>

## Error Responses

```json Invalid API Key theme={null}
{
  "error": "This API key does not have partner access"
}
```

```json Missing Required Fields theme={null}
{
  "error": "accountId is required"
}
```

```json Account Not Found theme={null}
{
  "error": "Account not found"
}
```

```json Already Refunded theme={null}
{
  "error": "This account has already been refunded"
}
```

```json No Charge Found theme={null}
{
  "error": "No charge found to refund"
}
```
