# PUT /api/v1/advisory-firms/{firm_id}/stripe-customer

> Link Stripe customer

- **Tag:** advisory-firms
- **Operation ID:** `update_stripe_customer_api_v1_advisory_firms__firm_id__stripe_customer_put`

## Description

Link an advisory firm to a Stripe customer for billing.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `firm_id` (path, string, required)

## Request body

Schema: `UpdateStripeCustomerRequest`

- `stripe_customer_id` (string · required) — Stripe customer ID (e.g., cus_xxx)

## Responses

### 200 — Successful Response

Schema: `UpdateStripeCustomerResponse`

- `advisory_firm_id` (string · required) — Advisory firm ID
- `stripe_customer_id` (string · required) — Linked Stripe customer ID

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X PUT 'https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/stripe-customer' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "stripe_customer_id": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/stripe-customer', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "stripe_customer_id": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "stripe_customer_id": "string"
}

response = httpx.put("https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/stripe-customer", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/advisory-firms/update-stripe-customer
- OpenAPI slice: https://www.ondayzero.com/docs/reference/advisory-firms/update-stripe-customer/openapi.json
- Other endpoints in **advisory-firms**: https://www.ondayzero.com/docs/reference/advisory-firms
