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

# Sandbox

> Test Clearlayer using pre-seeded investors, wallets, and policies.

The sandbox lets you integrate and test Clearlayer without creating real investors, wallets, or policies. It is available at the same base URL as production — `https://clearlayer-api-production.up.railway.app` — and uses a dedicated test API key. All seed data is pre-loaded; no setup is required.

## Test API key

Use the following key for all sandbox requests:

```
cl_test_key_1234567890
```

Pass it in the `Authorization` header:

```bash theme={null}
Authorization: Bearer cl_test_key_1234567890
```

<Warning>
  Do not use the test API key in a production environment. It is publicly documented and grants access to shared seed data only.
</Warning>

## Seed data

The sandbox database is pre-seeded with three investors, three wallets, and one asset policy.

### Investors

| ID             | Name          | Type       | Country | KYC status | Accredited | Expected outcome        |
| -------------- | ------------- | ---------- | ------- | ---------- | ---------- | ----------------------- |
| `inv_seed_001` | Alice Johnson | individual | US      | verified   | true       | `allow`                 |
| `inv_seed_002` | Bob Smith     | individual | GB      | pending    | false      | `review`                |
| `inv_seed_003` | Charlie Doe   | entity     | US      | verified   | true       | `deny` (blocked wallet) |

### Wallets

| ID             | Screening status | Risk level | Linked investor |
| -------------- | ---------------- | ---------- | --------------- |
| `wal_seed_001` | verified         | low        | `inv_seed_001`  |
| `wal_seed_002` | pending          | medium     | `inv_seed_002`  |
| `wal_seed_003` | blocked          | high       | `inv_seed_003`  |

### Policy

| ID             | Name                    | requires\_kyc | requires\_accredited | allowed\_countries | wallet\_must\_be\_verified |
| -------------- | ----------------------- | ------------- | -------------------- | ------------------ | -------------------------- |
| `pol_seed_001` | US Accredited Only Fund | true          | true                 | `["US"]`           | true                       |

## Testing each outcome

The following examples use the seed data to produce each of the three possible decision outcomes. All requests target the production base URL with the test API key.

<Tabs>
  <Tab title="allow">
    Alice Johnson (`inv_seed_001`) is KYC-verified, accredited, based in the US, and has a verified low-risk wallet. She passes every check in `pol_seed_001`.

    ```bash theme={null}
    curl -X POST https://clearlayer-api-production.up.railway.app/v1/decisions \
      -H "Authorization: Bearer cl_test_key_1234567890" \
      -H "Content-Type: application/json" \
      -d '{
        "investor_id": "inv_seed_001",
        "wallet_id": "wal_seed_001",
        "asset_policy_id": "pol_seed_001",
        "action": "transfer"
      }'
    ```

    Expected response:

    ```json theme={null}
    {
      "decision": "allow",
      "reasons": ["policy_requirements_satisfied"],
      "audit_id": "dec_...",
      "policy_version": "v1",
      "timestamp": "..."
    }
    ```
  </Tab>

  <Tab title="review">
    Bob Smith (`inv_seed_002`) has a pending KYC status. The engine hits rule 2 and returns `review` before any other checks run.

    ```bash theme={null}
    curl -X POST https://clearlayer-api-production.up.railway.app/v1/decisions \
      -H "Authorization: Bearer cl_test_key_1234567890" \
      -H "Content-Type: application/json" \
      -d '{
        "investor_id": "inv_seed_002",
        "wallet_id": "wal_seed_002",
        "asset_policy_id": "pol_seed_001",
        "action": "transfer"
      }'
    ```

    Expected response:

    ```json theme={null}
    {
      "decision": "review",
      "reasons": ["kyc_not_verified"],
      "audit_id": "dec_...",
      "policy_version": "v1",
      "timestamp": "..."
    }
    ```
  </Tab>

  <Tab title="deny">
    Charlie Doe (`inv_seed_003`) has a blocked wallet (`wal_seed_003`). The engine hits rule 1 — the first check — and returns `deny` immediately.

    ```bash theme={null}
    curl -X POST https://clearlayer-api-production.up.railway.app/v1/decisions \
      -H "Authorization: Bearer cl_test_key_1234567890" \
      -H "Content-Type: application/json" \
      -d '{
        "investor_id": "inv_seed_003",
        "wallet_id": "wal_seed_003",
        "asset_policy_id": "pol_seed_001",
        "action": "transfer"
      }'
    ```

    Expected response:

    ```json theme={null}
    {
      "decision": "deny",
      "reasons": ["wallet_blocked"],
      "audit_id": "dec_...",
      "policy_version": "v1",
      "timestamp": "..."
    }
    ```
  </Tab>
</Tabs>

<Tip>
  The seed data only covers the most common scenarios. Create your own investors, wallets, and policies via the API to test edge cases — for example, an investor from a blocked country, a non-accredited investor against a policy that doesn't require accreditation, or a wallet in a pending state against a policy where `wallet_must_be_verified` is `false`.
</Tip>
