> ## 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.

# Your first transaction

> A curl against /analyze/sandbox, and how it differs from the sandbox host

With your API key generated, send your first transaction to scoring's **sandbox mode**:
the same model as production, the transaction is labeled and does not count as live traffic.

Pick your environment's [API host](https://docs.fraudeg.com/en/entornos.md). The example below uses
pre-official-integration. If you are already in production and only want to test a call without
mixing it with live traffic, change the host to `https://api.fraudeg.com/api` and **keep**
the `/analyze/sandbox` path.

## `/analyze` vs `/analyze/sandbox`

| Path | What it does |
| - | - |
| `POST /v1/transactions/analyze` | Live scoring: the transaction goes into operational history |
| `POST /v1/transactions/analyze/sandbox` | Same evaluation; not treated as live traffic |

Both exist on both APIs. `/analyze/sandbox` is **not** `sandbox.fraudeg.com` or
`sandbox-api.fraudeg.com`. See [Environments](https://docs.fraudeg.com/en/entornos.md).

## Request

Two headers are required:

| Header | Required | Details |
| - | - | - |
| `X-Api-Key` | Yes | Your API key for **that** environment, with `TRANSACTIONS_WRITE` |
| `X-Idempotency-Key` | Yes | 16 to 128 url-safe characters, generated by you, unique per transaction |

```bash theme={null}
curl -X POST https://sandbox-api.fraudeg.com/api/v1/transactions/analyze/sandbox \
  -H "X-Api-Key: your_api_key" \
  -H "X-Idempotency-Key: 3f9a2b7e-6c1d-4e2a-9f31-8a0c5d2b7e41" \
  -H "Content-Type: application/json" \
  -d '{
    "order_id": "8788426783",
    "user_id": "user-4471",
    "transaction_amount": 129.90,
    "payment_method": "card",
    "cavv_result": "failed"
  }'
```

`order_id`, `user_id`, `transaction_amount`, and `payment_method` are required. The canonical
name is `payment_method` (the alias `paymentInstrumentType` is accepted).

## Response

```json theme={null}
{
  "data": {
    "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"],
      "confidence": 0.89,
      "conditions": []
    },
    "transaction_state": "BLOCKED"
  },
  "timestamp": "2026-07-29T16:43:36.22",
  "status": "OK"
}
```

> [!WARNING]
>
> In the example, `risk_score` is `29.07` — `medium` band — but the decision is `BLOCK`.
> **Always act on `decision.type`, never on the score.** See
> [Risk score](https://docs.fraudeg.com/en/conceptos/score-y-decision.md).

For this test you can reuse the same `X-Idempotency-Key` on retries: you will get the
same response. Before going to production, review [how to generate a real key per
transaction](https://docs.fraudeg.com/en/integrar/produccion.md).

Next step: [Authentication](https://docs.fraudeg.com/en/integrar/autenticacion.md).


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