# Create a Report

**POST** `/reports`

Base URL: `https://api.uat.triple-a.io/api/fiat-payout/v1`

This endpoint requests generation of a report. Report generation is asynchronous: the response returns immediately with a `pending` status, and the report is delivered via the chosen delivery channel once ready. Supply an `x-idempotency-key` header to safely retry without creating duplicate reports.

## Authorization

- oauth2 (http, bearer)

## Header parameters

- `x-idempotency-key` (string)
  Unique key to make report creation idempotent across retries. Can be any string; we recommend a V4 UUID or another random string with enough entropy to avoid collisions.

## Body

Content type: `application/json`

- `type` ("fp_account_statement", required)
  The type of report to generate.
- `from_date` (string, required)
  Inclusive report start date in ISO 8601 format. Accepts a date (2026-06-01) or a full datetime (2026-06-01T00:00:00Z). A date-only value (no offset) is interpreted as UTC and normalized to the start of that UTC day; a datetime is used with the offset it carries. To use another timezone, include an explicit offset (e.g. 2026-06-01T00:00:00+08:00). The report period is the half-open interval [from_date, to_date).
- `to_date` (string, required)
  Exclusive report end date in ISO 8601 format — up to but not including this value. Accepts a date (2026-07-01) or a full datetime (2026-07-01T00:00:00Z). A date-only value (no offset) is interpreted as UTC and normalized to the start of that UTC day; a datetime is used with the offset it carries. To use another timezone, include an explicit offset (e.g. 2026-06-01T00:00:00+08:00). Example: from_date=2026-06-01 with to_date=2026-07-01 covers all of June.
- `delivery_channel` ("email" | "webhook", required)
  How the completed report is delivered.

Example:

```json
{
  "type": "fp_account_statement",
  "from_date": "2026-06-01",
  "to_date": "2026-07-01",
  "delivery_channel": "email"
}
```

## Responses

### 202

Accepted

- `id` (string<uuid>)
- `status` ("pending" | "error" | "completed")
- `delivery_channel` ("email" | "webhook")
- `sent_at` (string<date-time>)
  When the report was delivered via the chosen delivery_channel. Null until delivery has succeeded (a completed report may still have a null sent_at).
- `created_at` (string<date-time>)
- `updated_at` (string<date-time>)

Example:

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "status": "pending",
  "delivery_channel": "email",
  "sent_at": "1970-01-01T00:00:00.000Z",
  "created_at": "1970-01-01T00:00:00.000Z",
  "updated_at": "1970-01-01T00:00:00.000Z"
}
```

### 400

Error defines errors may be returned from the system.

- `message` (string)
- `errors` (object[])
  - `errorCode` (string)
  - `message` (string)

Example:

```json
{
  "message": "string",
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ]
}
```

### 409

Error defines errors may be returned from the system.

- `message` (string)
- `errors` (object[])
  - `errorCode` (string)
  - `message` (string)

Example:

```json
{
  "message": "string",
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ]
}
```

### 422

Error defines errors may be returned from the system.

- `message` (string)
- `errors` (object[])
  - `errorCode` (string)
  - `message` (string)

Example:

```json
{
  "message": "string",
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ]
}
```

### 500

Error defines errors may be returned from the system.

- `message` (string)
- `errors` (object[])
  - `errorCode` (string)
  - `message` (string)

Example:

```json
{
  "message": "string",
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ]
}
```