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

# Order lifecycle

> Create an order, inspect searches, and prepare webhook handling.

# Order lifecycle

<p>
  <a href="/assets/downloads/guides/demo-flow.pdf" download="demo-flow.pdf">Download this guide</a>
</p>

Use this flow after you have a Bearer token.

## 1. Create an order

Start with [Create order](/api-reference/endpoints/create-order). The endpoint page includes a complete JSON body you can send with cURL or your HTTP client.

```http theme={null}
POST https://sandbox.theary.com/background-check/v1/orders
Authorization: Bearer <token>
Content-Type: application/json
```

The response returns:

```json theme={null}
{
  "verificationOrderId": "ord_...",
  "searchIds": ["search_..."]
}
```

## 2. Inspect searches

Use the order ID to list associated searches:

```http theme={null}
GET https://sandbox.theary.com/background-check/v1/orders/{verificationOrderId}/searches
Authorization: Bearer <token>
```

For one search:

```http theme={null}
GET https://sandbox.theary.com/background-check/v1/orders/{verificationOrderId}/searches/{searchId}
Authorization: Bearer <token>
```

Searches are asynchronous. Use search state and `activity` as your operational view while work progresses.

## 3. Handle completion with webhooks

Production integrations should handle `verification.completed` and `verification.action_required` webhooks. Configure `webhookConfig` on the order or use tenant-level defaults.

```json theme={null}
{
  "webhookConfig": {
    "enabled": true,
    "secret": "webhook-secret-for-hmac-validation",
    "fallbackEndpoint": "https://your-app.com/webhooks/verification"
  }
}
```

Validate `X-Webhook-Signature` before processing events. See [Webhook integration](/api-reference/guides/webhook-integration).

## Related

* [Quickstart](/quickstart)
* [Create order](/api-reference/endpoints/create-order)
* [Webhook integration](/api-reference/guides/webhook-integration)
