# Fraud API Response

The endpoint returns a JSON structured response carrying SEON's enriched data,
the rules that fired and the resulting score. See
[Fraud API Request](fraud-api-request.html) for the call that produces it.

---

## Table of Contents

1. [Envelope](#envelope)
2. [Response attributes](#response-attributes)
3. [Example response](#example-response)
4. [Error responses](#error-responses)

---

## Envelope

Every response is wrapped in the same three fields:

| Attribute | Type | Description |
| --- | --- | --- |
| `success` | boolean | `true` when the request was processed. On `false`, read `error` and ignore `data`. |
| `error` | object | Empty on success. On failure it carries the SEON error `code` and `message` — see [Error responses](#error-responses). |
| `data` | object | The enrichment and scoring result, described below. |

---

## Response attributes

The attributes of the `data` object. Which ones appear depends on the modules
you enabled in `config` and on `config.response_fields`.

{% attributes schema="FraudApiResponse" /%}

{% callout type="tip" title="Trimming the response" %}
Without `config.response_fields`, the response carries the default set: `id`,
`state`, `fraud_score`, `blackbox_score`, `ip_details`, `email_details`,
`phone_details`, `bin_details`, `device_details`, `applied_rules`, `version`,
`calculation_time` and `seon_id`. `geolocation_details`, `string_analyses` and
`rule_category_details` are opt-in — list them in `response_fields`, and note
that the first two also need enabling by SEON or in the Admin Panel.
{% /callout %}

{% callout type="note" title="Device fingerprint data" %}
`device_details` holds the decrypted device fingerprint. The web payload is
documented field by field on [JavaScript Agent v6](javascript-agent-v6.html);
the mobile payloads on
[iOS SDK](https://docs.seon.io/api-reference/fraud-api#ios-sdk) and
[Android SDK](https://docs.seon.io/api-reference/fraud-api#android-sdk).
{% /callout %}

---

## Example response

{% example operation="fraudApi" of="response" /%}

---

## Error responses

On failure `success` is `false` and the `error` object carries the SEON error
`code` and `message`.

{% errors operation="fraudApi" /%}

---

## Next steps

### Sub-API references

The `*_details` objects contain the full response of the corresponding sub-API:

- [IP API](https://docs.seon.io/api-reference/ip-api#ip-api-response) — the full contents of `ip_details`
- [Email API](https://docs.seon.io/api-reference/email-api#email-api-response) — the full contents of `email_details`
- [Phone API](https://docs.seon.io/api-reference/phone-api#phone-api-response) — the full contents of `phone_details`
- [AML API](https://docs.seon.io/api-reference/aml-api#aml-api-response) — the full contents of `aml_details`
- [eKYC payload examples](https://docs.seon.io/api-reference/fraud-api#ekyc-endpoints-payload-examples) — `ekyc_result` and `ekyc_data`

### Additional topics

- [Fraud API Request](fraud-api-request.html) — request attributes and code samples
- [JavaScript Agent v6](javascript-agent-v6.html) — the web `device_details` payload
- [Scoring Engine & Rules](https://docs.seon.io/knowledge-base/user-manuals/scoring-engine-and-rules#rule-actions) — how `applied_rules` and `state` are produced
- [Blackbox machine learning](https://docs.seon.io/knowledge-base/machine-learning/blackbox-machine-learning) — activating `blackbox_score`
- [Rule categories](https://docs.seon.io/knowledge-base/guides/set-up-custom-scoring-and-states-with-rule-categories) — enabling `rule_category_details`
- [Errors](https://docs.seon.io/api-reference/errors) — the complete SEON error code reference across all APIs

For additional support, contact your SEON representative.
