> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thewo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript example

> Call ClaimReady safely from a trusted server using TypeScript.

# TypeScript example

Keep your Developer API key in a trusted server environment. This synthetic
example submits one physical-product warranty claim and parses the response
without assuming that network data is valid.

```ts theme={"theme":"github-dark-default"}
const apiBaseUrl = process.env.THE_WO_API_BASE_URL ?? "https://api.thewo.io";
const apiKey = process.env.THE_WO_API_KEY;

if (!apiKey) {
  throw new Error("THE_WO_API_KEY is required");
}

const response = await fetch(`${apiBaseUrl}/v1/product-claims/triage`, {
  method: "POST",
  headers: {
    "content-type": "application/json",
    "x-api-key": apiKey,
    "Idempotency-Key": "blender-warranty-001",
  },
  body: JSON.stringify({
    claimDomain: "physical_product",
    claimType: "warranty",
    product: { name: "Example blender", model: "B-100" },
    issue: { description: "The motor stops during normal use." },
    purchase: { purchasedAt: "2026-02-10", seller: "Example Shop" },
    language: "en",
  }),
});

const body: unknown = await response.json();

if (!response.ok) {
  const errorCode =
    typeof body === "object" && body !== null && "error" in body ? body.error : undefined;

  throw new Error(`ClaimReady request failed (${response.status}): ${String(errorCode)}`);
}

console.log(body);
```

Send the request only from your server. Do not expose the key in browser or
mobile code. Reuse the same idempotency key only when retrying the same
material request. The operation is currently **Coming Soon**; docs do not grant
entitlement. See the [Quickstart](https://docs.thewo.io/claim-ready/quickstart.md),
[triage contract](https://docs.thewo.io/claim-ready/guides/triage-contract.md), and
[Errors](https://docs.thewo.io/claim-ready/guides/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.