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

# Response format

> The {data, timestamp, status} envelope and the shape of data in /analyze

Every successful API response comes wrapped in the same format:

```json theme={null}
{
  "data": { },
  "timestamp": "2026-07-29T16:43:36.22",
  "status": "OK"
}
```

| Field | Description |
| - | - |
| `data` | The endpoint's own result. The one for `POST /analyze` is below. |
| `timestamp` | When the response was generated |
| `status` | `OK` on reads and scoring; `CREATED` when creating a verification |

Errors use a different envelope. See [Error codes](https://docs.fraudeg.com/en/referencia/codigos-de-error.md).

## `data` in `POST /analyze`

```json theme={null}
{
  "transaction_id": "01e6efd4-c884-5bc0-af43-68b3fac8d0f8",
  "order_id": "8788426783",
  "risk_score": 29.07,
  "risk_level": "medium",
  "flags": [
    {
      "code": "AUTH_3DS_FAILED",
      "category": "authentication",
      "severity": "high",
      "description": "3DS authentication explicitly failed"
    }
  ],
  "recommendation": "…",
  "decision": {
    "type": "BLOCK",
    "reason": ["AUTH_3DS_FAILED", "custom_rule:abc123"],
    "confidence": 0.89,
    "conditions": []
  },
  "transaction_state": "BLOCKED"
}
```

| Field | Description |
| - | - |
| `transaction_id` | Identifier assigned by Fraudeg |
| `order_id` | The order identifier you sent |
| `risk_score` | A number from 0 to 100 — a **flat** field. See [Risk score](https://docs.fraudeg.com/en/conceptos/score-y-decision.md) |
| `risk_level` | `low` / `medium` / `high` / `critical` — a **flat** field |
| `flags` | Risk signals with `code`, `category`, `severity`, `description`. Catalog: [Flags](https://docs.fraudeg.com/en/referencia/flags.md) |
| `recommendation` | A sentence in the company's language. See below |
| `decision.type` | The decision — [Transaction decisions](https://docs.fraudeg.com/en/conceptos/decisiones.md) |
| `decision.reason` | A list of strings — see below |
| `decision.confidence` | 0 to 1, for the **score-based** decision. See [Risk score](https://docs.fraudeg.com/en/conceptos/score-y-decision.md) |
| `decision.conditions` | Pending conditions when `type` is `STEP_UP_AUTH` (today: `OTP_VERIFICATION`) |
| `transaction_state` | [Lifecycle](https://docs.fraudeg.com/en/conceptos/ciclo-de-vida.md) |

> [!NOTE]
>
> `risk_score` and `risk_level` are top-level fields of `data`. So is `flags`. There's no nested
> `risk` object, and `flags` doesn't live inside `decision`.

## `recommendation`

It's a **prose string**, in the language configured for your company. It summarizes the decision and,
when there are signals, may cite public codes from [`flags`](https://docs.fraudeg.com/en/referencia/flags).

It isn't a programmable contract:

* Don't `switch` on the text.
* Don't parse codes out of the sentence: they're already in `flags` and in `decision.reason`.
* The wording can change without notice; `decision.type` doesn't.

Use it to show something readable in a UI. To decide what to do with the transaction, always read
`decision.type`.

## About `flags`

Each entry is a signal that fired, with four fields. `flags` is `[]` if there are no
signals. Entries are deduplicated by `code`.

They never include the signal's internal name or a numeric weight.

The full catalog of `code` values —in one place, not duplicated on other pages— is in
[Flags catalog](https://docs.fraudeg.com/en/referencia/flags.md).

## About `decision.reason`

A list of **strings**, not objects. A short read so you can branch without walking `flags`:

| Form | What it means |
| - | - |
| A public code (e.g., `"AUTH_3DS_FAILED"`) | That signal fired. Same vocabulary as `flags[].code` |
| `custom_rule:<id>` | One of the **merchant's own rules** escalated the decision |
| `entity_block:<kind>:<value>` | An entry in your **entity list** blocked the transaction. `<kind>` is the type (`user_id`, `device_id`, `ip_address`, `pan_token`, `email`, `expanded_bin`) and `<value>` is the value that matched |

If you get a `BLOCK` with `entity_block:user_id:user-4471`, the cause is in your list.


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