---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://truto.one/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Add a tax ID

> Source: https://truto.one/docs/api-reference/admin/billing/add-tax-id/

`POST /billing/account/{team_id}/tax-id`

Resource: **Billing**

**Adds a tax ID to the team's Stripe customer** (created first for a self-serve team that has none) and answers the re-synced account. Stripe checks the type and value; its message is the `400`.

## Path parameters

- **`team_id`** _(string, required)_

## Request body

- **`type`** _(string)_
  Stripe tax ID type, for example `eu_vat` or `us_ein`.
- **`value`** _(string)_

## Response body

- **`team_id`** _(string)_
- **`stripe_customer_id`** _(string)_
- **`has_stripe_customer`** _(boolean)_
- **`has_payment_method`** _(boolean)_
- **`billing_status`** _(string)_
  Informational; nothing is enforced on it today.
  Allowed: `active`, `past_due`, `suspended`, `exempt`
- **`usage_payment`** _(string)_
  How usage is paid. `prepaid` teams (self-serve signups) pay usage from a prepaid balance topped up in $50 steps; `invoice` teams get usage invoices.
  Allowed: `invoice`, `prepaid`
- **`balance_state`** _(string)_
  State of the prepaid balance. `past_due` means a top-up failed and is being retried; `action_required` means the card needs to be replaced or authenticated; `restricted` (14 days unpaid) refuses new connections only; `review` (30 days unpaid) is with Truto staff. Existing traffic and inbound webhooks keep running in every state. Always `active` for `invoice` teams.
  Allowed: `active`, `recharging`, `past_due`, `action_required`, `restricted`, `review`
- **`balance_state_reason`** _(string)_
  Why the balance is in its state, for example a decline code or `stripe_unavailable`.
- **`spend_limit_cents`** _(integer)_
  The team's own monthly cap on usage spend, in cents. Null for no cap. Alerts at 80% and 100%.
- **`spend_limit_hard_stop`** _(boolean)_
  When true, outbound API calls get `429 spend_limit_reached` once the month's spend reaches `spend_limit_cents`, until the month ends. Inbound webhooks are always accepted.
- **`auto_top_up_below_cents`** _(integer)_
  The team's own auto top-up trigger, in cents. A top-up is charged when the prepaid balance falls below it. Null for the default, max($15, 3 days of usage).
- **`auto_top_up_amount_cents`** _(integer)_
  The team's own auto top-up amount, in cents, charged as set plus any negative balance. Null for the default, max($50, 7 days of usage) in $50 steps. A default amount is raised to the trigger when the trigger is higher, so one top-up always lifts the balance over it.
- **`billing_email`** _(string)_
- **`billing_name`** _(string)_
  The name on invoices (Stripe customer name).
- **`currency`** _(string)_
- **`payment_method_summary`** _(object)_
  - **`stripe_payment_method_id`** _(string)_
  - **`type`** _(string)_
  - **`brand`** _(string)_
  - **`last4`** _(string)_
  - **`exp_month`** _(integer)_
  - **`exp_year`** _(integer)_
- **`billing_address`** _(object)_
  - **`name`** _(string)_
  - **`line1`** _(string)_
  - **`line2`** _(string)_
  - **`city`** _(string)_
  - **`state`** _(string)_
  - **`postal_code`** _(string)_
  - **`country`** _(string)_
- **`tax_ids`** _(array<object>)_
  - **`id`** _(string)_
    Stripe tax ID (`txi_…`); pass it to `DELETE /billing/account/{team_id}/tax-id/{tax_id}`. Absent on a row cached before ids were stored, until the next sync.
  - **`type`** _(string)_
  - **`value`** _(string)_
- **`last_synced_at`** _(string)_
- **`last_payment_failed_at`** _(string)_

## Errors

| Status | Description |
| :----- | :---------- |
| `400` | Missing field, or Stripe refused the type or value (its message) |
| `403` | Forbidden if the caller is not an admin of the team |
| `404` | The team has no Stripe customer |

## Code examples

### curl

```bash
curl -X POST 'https://api.truto.one/billing/account/{team_id}/tax-id' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "your_type",
  "value": "DE123456789"
}'
```

### JavaScript

```javascript
const body = {
  "type": "your_type",
  "value": "DE123456789"
};

const response = await fetch('https://api.truto.one/billing/account/{team_id}/tax-id', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

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

### Python

```python
import requests

url = "https://api.truto.one/billing/account/{team_id}/tax-id"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "type": "your_type",
    "value": "DE123456789"
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())
```
