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

# Anti-fraud simulator

An simulator anti-fraud connection is provided which can be used for integration
testing. This anti-fraud connection makes it straight forward to test all response
decisions and asynchronous webhooks.

## Credentials

To configure the connection, you need to set the following credentials.

| Credential | Description                                        |
| :--------- | :------------------------------------------------- |
| API Key    | This is not validated and can be set to any string |

## Decision mapping

To test various anti-fraud decisions you must create a buyer with a
specific email address (see table below). If you do not pass a buyer with email address
the decision is `skipped`.

| Buyer email         | Decision    | Description                                       |
| :------------------ | :---------- | :------------------------------------------------ |
| `accept@gr4vy.com`  | `accept`    | Simulates a low risk transaction                  |
| `reject@gr4vy.com`  | `reject`    | Simulates a high risk transaction                 |
| `review@gr4vy.com`  | `review`    | Simulates a transaction which needs manual review |
| `error@gr4vy.com`   | `error`     | Simulates a bad request                           |
| `timeout@gr4vy.com` | `exception` | Simulates a server timeout/bad response           |

## Errors

To simulate a network error, for example to simulate a situation where the connector is
unable to connect to the anti-fraud provider you can
use `unavailable@gr4vy.com`. This results in the decision being skipped and creates
an `anti-fraud-decision-error` transaction event.

## Webhooks

To test the `review` status you can manually send a POST request to the
anti-fraud service webhook URL. You can find this value from the dashboard or via
the API when [fetching the anti-fraud service](/reference/anti-fraud-services/get-anti-fraud-service).

<CodeGroup>
  ```json Response theme={"system"}
  {
    "type": "anti-fraud-service",
    "id": "f80b5fc6-c95d-4a28-a929-4d5268c3e141",
    "merchant_account_id": "default",
    "display_name": "Simulator",
    "anti_fraud_service_definition_id": "mock-anti-fraud",
    "active": true,
    "reviews_enabled": true,
    "created_at": "2024-04-01T00:00:00+00:00",
    "updated_at": "2024-04-01T00:00:00+00:00",
    "webhook_url": "https://api.sandbox.example.gr4vy.app/i/af/-AtfxsldSiipKU1SaMPhQWZvcnRlci1hbnRpLWZyYXVk/5bOPmoOpwNRR6bKZaPD7MNjiZcYgSu1cNtNUO0jLUNc",
    "fields": []
  }
  ```
</CodeGroup>

The expected `POST` body for the webhook URL must contain the UUID of the transaction and
a decision of `ACCEPT` or `REJECT`:

<CodeGroup>
  ```json Simulated webhook theme={"system"}
  {
    "transactionId": "d6d2bc16-8a25-4e05-a595-b4cd51fe4932",
    "decision": "ACCEPT" | "REJECT"
  }
  ```
</CodeGroup>

## Device fingerprinting

Device fingerprinting is not currently supported via this connection.
