---
updatedAt: 2026-11-24T00:10:12.000Z
agentTools:
  projectIndex: https://apidocs.taxbit.com/llms.txt
---

# Curing integration guide

Resolve specific W-8 validation issues with a focused component — without re-collecting the full form.

The [Questionnaire integration guide](https://apidocs.taxbit.com/docs/integration-guide) collects tax documentation. This guide covers the post-submission counterpart: clearing specific W-8 validation issues with `<TaxbitCuringDocumentation />` — a separate component from `<TaxbitQuestionnaire />`.

After a W-8 is submitted, validation can flag issues — a US address on a foreign filer, a treaty country that doesn't match the residency, an unsupported PO Box. The curing component is a focused remediation flow that surfaces only the open issues and gathers the specific evidence and explanation needed to clear each one, instead of re-collecting the entire form.

If you've already integrated the questionnaire and handle `needsResubmission`, you have most of what this guide builds on. The token flow, stylesheet, and webhook are the same — the only new pieces are one component and one hook signal.

| You already have                                 | Curing adds                                                  |
| ------------------------------------------------ | ------------------------------------------------------------ |
| Account Owner token flow                         | — same token                                                 |
| `@taxbit/react-sdk` + a stylesheet import        | — same import; shared `taxbit-*` namespace                   |
| `ACCOUNT_OWNER_TAX_DOCUMENTATION_STATUS` webhook | — same event drives the curing entry point                   |
| `<TaxbitQuestionnaire />`                        | `<TaxbitCuringDocumentation />` + `needsCuringDocumentation` |

# When to reach for curing

The curing widget is the right surface when all three are true:

* The user has a prior W-8 submission (`dataCollectionStatus: "COMPLETE"`).
* The submission has at least one issue with `status: "OPEN"` that the curing flow can resolve.
* You'd rather have the user fix the specific issue than walk the whole questionnaire again.

If the submission isn't complete, or the issue isn't curable, route the user back through `<TaxbitQuestionnaire />` with `config.rules.adaptiveMode` set to `"skipEdit"` instead.

## Curable issue types

Curable issues are W-8 only — W-9 submissions don't surface curable issues today. Which types apply depends on the document type:

| Issue type                  | W-8BEN | W-8BEN-E | W-8IMY |
| --------------------------- | :----: | :------: | :----: |
| `US_INDICIA`                |    ✓   |     ✓    |    ✓   |
| `TREATY_COUNTRY_MISMATCH`   |    ✓   |     ✓    |    —   |
| `CARE_OF_PERMANENT_ADDRESS` |    —   |     ✓    |    ✓   |
| `PO_BOX_PERMANENT_ADDRESS`  |    —   |     ✓    |    ✓   |

**Watch for:** address-shape issues on individual W-8BEN surface in `statusData.wFormQuestionnaire.issues` but aren't resolvable through curing. Route those filers back through the questionnaire. See the [Component and hook reference](https://apidocs.taxbit.com/docs/component-and-hook-reference#curing-types) for the full `CurableIssueType` definition.

## Issue status

| Status      | Surfaces in curing?                                                            |
| ----------- | ------------------------------------------------------------------------------ |
| `OPEN`      | Yes — actionable; user can submit a cure.                                      |
| `IN_REVIEW` | No — a prior cure is pending tax-manager review. The user cannot submit again. |
| `RESOLVED`  | No — already cleared.                                                          |

# Set up locally

A dry run renders the component against the issues you name and stores nothing. Without a token it makes no network calls. Assumes you've already installed the SDK and imported a stylesheet per the [Questionnaire integration guide](https://apidocs.taxbit.com/docs/integration-guide#set-up-locally).

```jsx
import { TaxbitCuringDocumentation } from '@taxbit/react-sdk';

<TaxbitCuringDocumentation
  dryRun={{
    issueTypes: ['US_INDICIA', 'TREATY_COUNTRY_MISMATCH'],
    accountOwnerType: 'INDIVIDUAL', // W-8BEN; 'ENTITY' (W-8BEN-E, default) or 'INTERMEDIARY' (W-8IMY)
  }}
  onSubmit={(submission, file) => console.log(submission, file)}
/>
```

`dryRun.issueTypes` takes any subset of `CurableIssueType` (none by default, which renders the no-issues state). Status is assumed `OPEN` for every issue. `dryRun.accountOwnerType` picks which W-8 is cured; use `'INDIVIDUAL'` to see the reasonable-explanation section, which only individual W-8BEN filers get. `onSubmit` receives the same `ClientCuringSubmission` shape it does in a real session, so test harnesses don't special-case form state.

# Gate the mount

The widget is conditional, not a permanent page. Gate it on `useTaxbit().needsCuringDocumentation`, reusing the same Account Owner token you mint for the questionnaire.

```jsx
import { useTaxbit, TaxbitCuringDocumentation } from '@taxbit/react-sdk';

function CuringPage({ bearerToken }) {
  const { needsCuringDocumentation, isLoading } = useTaxbit({
    bearerToken,
    questionnaire: 'W-FORM',
  });

  if (isLoading) return <Spinner />;
  if (!needsCuringDocumentation) return null;

  return (
    <TaxbitCuringDocumentation
      bearerToken={bearerToken}
      onSuccess={() => router.push('/done')}
      onError={(err) => Sentry.captureException(err)}
    />
  );
}
```

**Check `isLoading` first.** The predicate is `false` while `statusData` is `undefined`, so without the loading check there's a brief flash where the widget hides before the real answer arrives. The component also fail-safes to `null` when there's no `OPEN` curable issue (with a dev-mode warning), but gating first saves a status-fetch round-trip.

Two places this mount tends to live: a user-facing remediation page ("your tax documentation needs attention" badge in settings or the payout area), or a re-collection inbox triggered by your `ACCOUNT_OWNER_TAX_DOCUMENTATION_STATUS` webhook handler when the new state has an `OPEN` curable issue.

# Render with real data

The component takes the same `config` groups as `<TaxbitQuestionnaire />`: `locale`, `display` and `connection`. Requests go to a region (the default) or through your proxy.

## Region (default)

```jsx
<TaxbitCuringDocumentation
  bearerToken={accountOwnerToken}
  config={{
    connection: { region: 'US' },      // or 'EU'
    locale: { language: 'en-us' },
    display: { poweredByTaxbit: true, screens: { loading: () => <Spinner /> } },
  }}
  onSuccess={(submission) => { /* server confirmed receipt */ }}
  onError={(err) => { /* report */ }}
  onSettled={(submission) => { /* fires after success or error */ }}
/>
```

## Through a proxy

```jsx
<TaxbitCuringDocumentation
  bearerToken={accountOwnerToken}
  config={{
    connection: {
      proxyDomain: 'https://taxbit-proxy.your-corp.com',
      proxyHeaders: { 'x-correlation-id': '...' },
    },
  }}
  onSuccess={...}
  onError={...}
  onSettled={...}
/>
```

`authorization` and `content-type` are reserved on `proxyHeaders` — your proxy must strip and re-add them. `region` and `proxyDomain` are mutually exclusive. The curing component doesn't send usage telemetry, so curing alone doesn't need `telemetry/events` on your proxy. If the same proxy also serves `<TaxbitQuestionnaire />`, add that path for the questionnaire. Full prop tables are in the [Component and hook reference](https://apidocs.taxbit.com/docs/component-and-hook-reference#taxbitcuringdocumentation-props).

## Optional: collectSignatureName

`collectSignatureName?: boolean` (defaults to `false`). When set to `true`, the SDK skips the prior-submission fetch on mount and renders a required signature-name input on the review step for the user to type themselves. Only affects individual W-8BEN cures involving `US_INDICIA` — the only cure that collects a signature.

```jsx
<TaxbitCuringDocumentation
  bearerToken={accountOwnerToken}
  collectSignatureName={true}
  onSuccess={...}
  onError={...}
/>
```

## Languages and loading

As with the questionnaire, the component downloads only the language it is showing. The loading screen (`config.display.screens.loading`, or Taxbit's) covers both the status fetch and the first language download.

## Check before it's stored

`onSubmit` is called in every session, with the curing documentation and the uploaded file, **before anything is stored**. The SDK waits for it. Return a rejected promise to stop the submit — for example, if your own file scan fails. `onError` then receives the error and the curing documentation.

```jsx
<TaxbitCuringDocumentation
  bearerToken={accountOwnerToken}
  onSubmit={async (submission, file) => {
    await scanUpload(file); // throw to stop the submit
  }}
  onSuccess={...}
/>
```

# What the user sees

A single page with sections rendered in this order:

1. **Intro + issue summary** — a short explanation and a per-issue list of what's open against this submission.
2. **Step 1 — Upload documentary evidence.** One file picker. Every curable issue type asks for the file.
3. **Step 2 — Reasonable explanation.** Visible only to individual W-8BEN filers with an open `US_INDICIA` issue. W-8BEN-E and W-8IMY filers cure `US_INDICIA` with documentary evidence alone. The user picks one of six categories; two reveal extra fields:
   * `DO_NOT_MEET_SUBSTANTIAL_PRESENCE_TEST` reveals the substantial-presence-test calculation (current-year, first- and second-preceding-year day counts; the widget shows the weighted total live as the user types).
   * `CLOSER_CONNECTION_EXCEPTION` reveals closer-connection certification (a certification checkbox, country, free-text reason).
   * `STUDENT`, `TEACHER_OR_TRAINEE`, `DIPLOMAT`, and `SPOUSE_OR_CHILD` need no extra fields.
4. **Step 3 — Review and consent.** A final confirmation block before submit.

You receive the result as `ClientCuringSubmission` in `onSubmit`, `onSuccess` and `onSettled` — the same shape in a dry run and a real session. See the [reference](https://apidocs.taxbit.com/docs/component-and-hook-reference#curing-types) for the full payload.

# Handle the result

`onSuccess` fires when Taxbit's server accepts the multipart POST — **not** when the cure has been re-reviewed. A tax manager still has to mark the issue `RESOLVED`; expect minutes to days. An `OPEN` issue submitted via curing flips to `IN_REVIEW`; while `IN_REVIEW` the widget renders `null` and the filer can't submit again. The status then moves to `RESOLVED` (cleared) or back to `OPEN` (rejected, can be submitted again).

The hook reads status once on mount, so after a successful submit call `useTaxbit().refresh()` before reading derived state:

```jsx
const { refresh } = useTaxbit({ bearerToken, questionnaire: 'W-FORM' });

<TaxbitCuringDocumentation
  bearerToken={bearerToken}
  onSuccess={async () => {
    await refresh();
    router.push('/account');
  }}
/>
```

For reading statuses across the hook, the status endpoint server-to-server, and the `ACCOUNT_OWNER_TAX_DOCUMENTATION_STATUS` webhook — including systematic backend reads of who has submitted a cure — see [Reading curing statuses](https://apidocs.taxbit.com/docs/reading-curing-statuses).

# What's not supported

* **W-9 curing** — W-9 submissions don't surface curable issues today; route W-9 users with issues back through `<TaxbitQuestionnaire />`.
* **Address-shape issues on individual W-8BEN** — `CARE_OF_PERMANENT_ADDRESS` and `PO_BOX_PERMANENT_ADDRESS` appear as issues on individual W-8BEN submissions but aren't resolvable through this flow.
* **`onProgress`** — there's no step-by-step progress callback. The form is short and section-based.
* **PDF download** — curing submissions don't have a separate downloadable PDF. `useTaxbit().canGetDocumentUrl` still reflects the underlying W-8 PDF, not the curing submission.
* **Usage telemetry** — only `<TaxbitQuestionnaire />` sends usage events. The curing component sends none and has no `telemetry` setting.

# Styling

Uses the same `taxbit-*` CSS namespace as `<TaxbitQuestionnaire />`. The same imported stylesheet (`inline.css`, `basic.css`, or `minimal.css`) styles both widgets — no separate CSS file. Curing layout lives under the shared `.taxbit-section*` classes, so brand overrides you've already written apply automatically.

The `--taxbit-color-*` tokens you set on `:root` with `inline.css` or `basic.css` theme both widgets. Rules you've written for `.taxbit-required-marker` and for `[aria-disabled='true']` buttons also apply wherever the curing form renders those elements. See [Customizing look and feel](https://apidocs.taxbit.com/docs/customizing-look-and-feel#theme-with-color-tokens).

# Next steps

* [Reading curing statuses](https://apidocs.taxbit.com/docs/reading-curing-statuses) — read OPEN / IN\_REVIEW / RESOLVED from the hook, server, and webhooks
* [Component and hook reference](https://apidocs.taxbit.com/docs/component-and-hook-reference#taxbitcuringdocumentation-props) — every curing prop, hook return value, and type
* [Webhooks Guide](https://apidocs.taxbit.com/docs/webhooks-guide) — full event taxonomy
* [Questionnaire integration guide](https://apidocs.taxbit.com/docs/integration-guide) — the primary collection flow this guide extends
* [Customizing look and feel](https://apidocs.taxbit.com/docs/customizing-look-and-feel) — one stylesheet covers this component and the questionnaire

# Sub pages

* [Reading curing statuses](https://apidocs.taxbit.com/docs/reading-curing-statuses.md)

# Sibling pages

* [How the SDK works](https://apidocs.taxbit.com/docs/how-the-sdk-works.md)
* [Questionnaire integration guide](https://apidocs.taxbit.com/docs/integration-guide.md)
* [Customizing look and feel](https://apidocs.taxbit.com/docs/customizing-look-and-feel.md)
* [Handling token expiration](https://apidocs.taxbit.com/docs/handling-token-expiration.md)
* [Component and hook reference](https://apidocs.taxbit.com/docs/component-and-hook-reference.md)
* [Upgrade guide](https://apidocs.taxbit.com/docs/upgrade-guide.md)

# Sub pages

* [Reading curing statuses](https://apidocs.taxbit.com/docs/reading-curing-statuses.md)

# Sibling pages

* [How the SDK works](https://apidocs.taxbit.com/docs/how-the-sdk-works.md)
* [Questionnaire integration guide](https://apidocs.taxbit.com/docs/integration-guide.md)
* [Customizing look and feel](https://apidocs.taxbit.com/docs/customizing-look-and-feel.md)
* [Handling token expiration](https://apidocs.taxbit.com/docs/handling-token-expiration.md)
* [Component and hook reference](https://apidocs.taxbit.com/docs/component-and-hook-reference.md)
* [Upgrade guide](https://apidocs.taxbit.com/docs/upgrade-guide.md)