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

# POST /analyze/async

> Accepts a transaction with a 202 and delivers the decision by webhook

```
POST {API_BASE}/v1/transactions/analyze/async
POST {API_BASE}/v1/transactions/analyze/async/sandbox
```

`{API_BASE}` is `https://sandbox-api.fraudeg.com/api` or `https://api.fraudeg.com/api`, depending on
your [environment](https://docs.fraudeg.com/en/entornos.md). In production:

```
POST https://api.fraudeg.com/api/v1/transactions/analyze/async
```

Accepts a transaction and responds `202` immediately. The decision doesn't come in this
response: it arrives as a `transaction.analysis.completed` webhook (or `rejected` / `failed`), and
you can read it with [`GET /analysis`](https://docs.fraudeg.com/en/referencia/estado-analisis). The mode, the full
sequence, and the payloads are in [Asynchronous analysis](https://docs.fraudeg.com/en/integrar/analisis-asincrono.md).

`/analyze/async/sandbox` is the same with the effect of [`/analyze/sandbox`](https://docs.fraudeg.com/en/referencia/analyze-sandbox):
the transaction is tagged and isn't treated as live traffic. It exists in both APIs.

## Headers

| Header | Required | Description |
| - | - | - |
| `X-Api-Key` | Yes | `TRANSACTIONS_WRITE` scope. See [Authentication](https://docs.fraudeg.com/en/integrar/autenticacion.md) |
| `X-Idempotency-Key` | Yes | 16–128 characters from `A-Z a-z 0-9 _ : . -`. See [Idempotency](https://docs.fraudeg.com/en/integrar/idempotencia.md). One is never generated for you here |
| `Content-Type` | Yes | `application/json` |

## Request

The body is the same model as [`POST /analyze`](https://docs.fraudeg.com/en/referencia/analyze): same fields,
same aliases (`payment_method` / `paymentInstrumentType`), same optional fields
([Fields](https://docs.fraudeg.com/en/integrar/campos.md)).

```bash theme={null}
curl -X POST https://api.fraudeg.com/api/v1/transactions/analyze/async \
  -H "X-Api-Key: your_api_key" \
  -H "X-Idempotency-Key: ord-100234-2026-11-03-001" \
  -H "Content-Type: application/json" \
  -d '{
    "order_id": "ORD-100234",
    "user_id": "usr_48213",
    "transaction_amount": 129.90,
    "payment_method": "card"
  }'
```

### What's validated on receipt and what comes back as `rejected`

On receipt, only the minimum is checked. Everything else is validated later, and a failure there doesn't
change the `202` you already got: it arrives as a `rejected` webhook.

| Where | What | Result |
| - | - | - |
| On receipt | `X-Idempotency-Key` present and validly formatted | `400` if not |
| On receipt | `order_id` and `user_id` with text, `transaction_amount` present | `400` if not |
| On receipt | Transaction size within the maximum that can be queued | `400` if it exceeds it; retrying won't fix it |
| Later | The rest of the `/analyze` model (e.g., `currency`), your company's configuration, the key already used with a different body | `rejected` webhook with its [`code`](https://docs.fraudeg.com/en/referencia/codigos-de-error) |

A body that's invalid for `/analyze` returns `422` there and `rejected` here: there's no `422` on
this route.

## Response

`202 Accepted`:

```json theme={null}
{
  "data": {
    "transaction_id": "2ecfdd90-ff63-529c-9d32-2c46615b1546",
    "order_id": "ORD-100234",
    "idempotency_key": "ord-100234-2026-11-03-001"
  },
  "timestamp": "2026-11-03T14:05:09.41",
  "status": "ACCEPTED"
}
```

| Field | Description |
| - | - |
| `transaction_id` | The transaction id. It's the one you use in [`GET /analysis`](https://docs.fraudeg.com/en/referencia/estado-analisis) and the one the webhooks carry |
| `order_id` | The one you sent |
| `idempotency_key` | The key you sent |

`transaction_id` is deterministic: it depends on your company and the `X-Idempotency-Key`, so
resending with the same key always returns the same id, in the `202`, in the webhooks, and in
the stored transaction. You can store it before you receive the webhook.

The `202` means "accepted," not "decided" or "valid."

## Errors

[Error](https://docs.fraudeg.com/en/referencia/codigos-de-error.md) envelope:

```json theme={null}
{
  "error_code": "BAD_REQUEST",
  "message": "Invalid input provided or required data is missing.",
  "details": "X-Idempotency-Key is required: 16 to 128 characters of letters, digits, '_', ':', '.', '-'.",
  "timestamp": "2026-11-03T14:05:09.41"
}
```

| HTTP | `error_code` | When |
| - | - | - |
| `400` | `BAD_REQUEST` | Key missing or invalid, `order_id`, `user_id`, or `transaction_amount` missing, or the transaction is too large |
| `403` | `INSUFFICIENT_PERMISSIONS` | The key doesn't have `TRANSACTIONS_WRITE`, or is used on a route that doesn't accept API keys |
| `503` | `SERVICE_UNAVAILABLE` | The request couldn't be accepted: it wasn't queued. Wait the seconds in `Retry-After` and retry with the **same** `X-Idempotency-Key` |

A `400`, `403`, or `503` means nothing was accepted and there will be no webhook.

Next step: [Analysis status](https://docs.fraudeg.com/en/referencia/estado-analisis.md).


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