# POST /api/v1/credit/cards/stripe-issuing/setup

> Activate Stripe Issuing capability, ToS, webhooks, and default cardholder

- **Tag:** credit
- **Operation ID:** `setup_stripe_issuing`

## Description

Submits missing Stripe Issuing `business_profile` fields (`annual_revenue`, `estimated_worker_count`), records `settings.card_issuing.tos_acceptance`, requests the `card_issuing` capability, subscribes `/api/v1/webhooks/stripe` to all `issuing_*` events, and optionally creates a default `Cardholder` (`ich_...`) on an owned credit program. Live business operator action (an API token receives `403`); sandbox businesses are refused before Stripe calls. Defaults to the business connection. Platform access and platform webhook changes require a signed-in superuser.

## Authentication

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

## Request body

Schema: `CreditStripeIssuingSetupRequest`

- `stripe_account_id` (string) — Owned Stripe account ID (`acct_...`); defaults to the business's canonical Stripe connection. Other accounts require Stripe metadata proving business and credit-line ownership. `platform`, or fallback when no business connection exists, requires a signed-in platform superuser; API tokens cannot use it.
- `annual_revenue_cents` (integer) — Preceding fiscal year gross annual revenue in cents (`business_profile.annual_revenue.amount`).
- `annual_revenue_currency` (string) — Currency code for `annual_revenue_cents` (`business_profile.annual_revenue.currency`).
- `fiscal_year_end` (string) — Fiscal year end date (`YYYY-MM-DD`) for `business_profile.annual_revenue.fiscal_year_end`; omitted from the Stripe update when not provided.
- `estimated_worker_count` (integer) — Estimated worker count (`business_profile.estimated_worker_count`).
- `accept_tos` (boolean) — Record acceptance of the Stripe Issuing terms of service (`settings.card_issuing.tos_acceptance`).
- `tos_ip` (string) — IP address to record for Issuing ToS acceptance; defaults to the caller's request IP.
- `request_card_issuing` (boolean) — Request the `card_issuing` capability on the Stripe account.
- `configure_webhooks` (boolean) — Subscribe the platform's enabled `/api/v1/webhooks/stripe` endpoints to Issuing events. Applied only for signed-in platform superusers; skipped for ordinary business operators.
- `create_default_cardholder` (boolean) — Create a default company `Cardholder` (`ich_...`) and bind it to `program_id`.
- `program_id` (string) — Owned credit program ID to store `default_cardholder_id` on; required when create_default_cardholder is true. Any supplied program is checked for business ownership before Stripe mutations.
- `cardholder_name` (string) — Display name (up to 24 chars) for the default Stripe Cardholder.
- `billing_address` (object) — Billing address (`line1`, `city`, `state`, `postal_code`, `country`) for the created Cardholder.

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_CreditStripeIssuingStatusResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (CreditStripeIssuingStatusResponse)

### 400 — Bad Request - Invalid input

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 401 — Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 403 — Forbidden - Insufficient permissions

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 404 — Not Found - Resource does not exist

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 422 — Validation Error

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/credit/cards/stripe-issuing/setup' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "stripe_account_id": "string",
  "annual_revenue_cents": 0,
  "annual_revenue_currency": "string",
  "fiscal_year_end": "string",
  "estimated_worker_count": 0,
  "accept_tos": false
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/credit/cards/stripe-issuing/setup', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "stripe_account_id": "string",
  "annual_revenue_cents": 0,
  "annual_revenue_currency": "string",
  "fiscal_year_end": "string",
  "estimated_worker_count": 0,
  "accept_tos": false
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {'stripe_account_id': 'string',
 'annual_revenue_cents': 0,
 'annual_revenue_currency': 'string',
 'fiscal_year_end': 'string',
 'estimated_worker_count': 0,
 'accept_tos': False}

response = httpx.post("https://api.ondayzero.com/api/v1/credit/cards/stripe-issuing/setup", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/credit/setup-stripe-issuing
- OpenAPI slice: https://www.ondayzero.com/docs/reference/credit/setup-stripe-issuing/openapi.json
- Other endpoints in **credit**: https://www.ondayzero.com/docs/reference/credit (markdown bundle: https://www.ondayzero.com/docs/reference/credit.md, OpenAPI: https://www.ondayzero.com/docs/reference/credit/openapi.json)
- Endpoint catalog: https://www.ondayzero.com/docs/reference/index.md
