> This page is for Revenue Guard.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://revenue-docs.creliohealth.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://revenue-docs.creliohealth.com/_mcp/server.

# Quickstart

This guide walks through the full integration path: create a sandbox API key, look up a payer, submit an order, and read the validation result. Everything here uses the public API with sandbox data, so you can run it without touching live traffic.

```text
https://public-rg-api.crelio.solutions

```

All public paths include `/public/v1`.

#### Create a sandbox API key

In the Revenue Guard dashboard, open **API Keys** and create a key while the environment switcher is set to **Sandbox**. Sandbox keys start with `rg_test_`. Grant the `order:create` and `payer:read` scopes so the key can both look up payers and submit orders.

Copy the key when it is shown. The plaintext value is returned only once.

> **Note**
>
> The API key alone determines whether a request reads and writes sandbox or live data. Do not send a separate environment header.

#### Store the key as an environment variable

```bash
export REVENUE_GUARD_API_KEY="rg_test_your_sandbox_key"
```

#### Find a payer ID

Payers are passed to the order endpoint by ID. List the payers available in your environment:

```bash
curl https://public-rg-api.crelio.solutions/public/v1/payers \
  -H "X-API-Key: $REVENUE_GUARD_API_KEY"
```

Each item includes an `id`, `name`, and `category`. Use an `id` in the next step.

#### Submit an order

Send the order, patient, insurance, and ordered tests. The response returns immediately with a `202` while validation runs asynchronously.

```bash
curl https://public-rg-api.crelio.solutions/public/v1/orders \
  -H "X-API-Key: $REVENUE_GUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "order_id": "ORD-1001",
    "payer_ids": ["00000000-0000-0000-0000-000000000000"],
    "patient_info": {
      "patient_uid": "PAT-123",
      "first_name": "Jane",
      "last_name": "Doe",
      "dob": "1985-04-12",
      "sex": "F"
    },
    "insurance_info": {
      "insurance_name": "Example Health",
      "policy_number": "POL-99887"
    },
    "ordered_tests": [
      {
        "short_name": "CBC",
        "test_name": "Complete Blood Count",
        "test_code": "CBC-01",
        "cpt_codes": ["85025"],
        "icd_codes": ["D64.9"]
      }
    ]
  }'
```

The response confirms how the order was recorded:

```json
{
  "orderId": "rg_order_...",
  "externalOrderId": "ORD-1001",
  "version": 1,
  "orderVersionId": "rg_order_version_...",
  "status": "created",
  "environment": "sandbox",
  "livemode": false
}
```

Re-sending the same `order_id` updates the existing order and creates a new version instead of a duplicate.

#### Review the validation result

Validation runs in the background. Open **Orders** in the dashboard to see the verdict, triggered rules, and suggested fixes for the order you just submitted. To be notified automatically instead of polling, subscribe a [webhook](/webhooks) to the `validation.completed` event.

## What you built

You authenticated with a scoped, environment-bound API key, resolved a payer ID, submitted an order for classification, and saw the result surface in the dashboard. From here:

* Read the [API reference](/api-reference) for exact request and response fields.
* Learn how classification works in [How Revenue Guard works](/how-it-works).
* Set up [webhooks](/webhooks) so your systems react to validation results in real time.
* When your workflows are verified end to end, switch to a live key (`rg_live_`) as described in [Environments](/environments).

> **Note**
>
> Need help with a Revenue Guard integration? Contact your CrelioHealth implementation or account team with the endpoint, timestamp, and request trace details.