> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mixlayer.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mixlayer.com/_mcp/server.

# Disable automatic prepaid refills

DELETE https://api.mixlayer.com/v1/billing_accounts/{billing_account_id}/auto_refill

When authenticated with an API key, this operation requires `api-admin`.

Reference: https://docs.mixlayer.com/api-reference/platform-api/billing-accounts/disable-auto-refill-for-billing-account

## Authentication

- `Authorization` header (bearer token, required) — Console user session or Mixlayer API key supplied as a Bearer token.

## Request

### Path parameters

- `billing_account_id` (string, required) — Billing account ID

## Response

### 200

Disabled automatic refill configuration

- `data` (ApiDataResponseAutoRefillResponseData, required) — Result of enabling, updating, or disabling automatic refills.

## Errors

### 401 Unauthorized Error

Authentication is missing or invalid.

- `error` (ApiErrorBody, required) — Structured error details.

### 403 Forbidden Error

The authenticated principal cannot perform this operation.

- `error` (ApiErrorBody, required) — Structured error details.

### 404 Not Found Error

The requested resource is not visible to the authenticated principal.

- `error` (ApiErrorBody, required) — Structured error details.

### 409 Conflict Error

The billing account state prevents the requested operation.

- `error` (ApiErrorBody, required) — Structured error details.

### 500 Internal Server Error

An unexpected server or database error occurred.

- `error` (ApiErrorBody, required) — Structured error details.

## Types

### ApiDataResponseAutoRefillResponseData

Result of enabling, updating, or disabling automatic refills.

- `enabled` (boolean, required) — Whether automatic refills are enabled.
- `idempotency_key` (string, required) — Idempotency key associated with the configuration update.
- `recharge_to_cents` (long, optional, nullable) — Target balance after a refill, in cents.
- `threshold_cents` (long, optional, nullable) — Balance threshold that triggers a refill, in cents.

### ApiErrorBody

Structured error details returned by the platform API.

- `message` (string, required) — Human-readable error message.
- `code` (string, optional, nullable) — Stable machine-readable error code, when available.
- `details` (any, optional) — Error-specific structured context, when available.

## Examples

**Response**

```json
{
  "data": {
    "enabled": true,
    "idempotency_key": "string",
    "recharge_to_cents": 1,
    "threshold_cents": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.mixlayer.com/v1/billing_accounts/billing_account_id/auto_refill"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.mixlayer.com/v1/billing_accounts/billing_account_id/auto_refill';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.mixlayer.com/v1/billing_accounts/billing_account_id/auto_refill"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.mixlayer.com/v1/billing_accounts/billing_account_id/auto_refill")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.mixlayer.com/v1/billing_accounts/billing_account_id/auto_refill")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.mixlayer.com/v1/billing_accounts/billing_account_id/auto_refill', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```