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

# Fetch Data

> Retrieve the collected data for a transaction, optionally scoped by type.

Once the journey is complete, retrieve the user's data with the same
`transaction_id`. The response is a uniform list of `{ type, status, data }` blocks,
where the inner `data` is a free-form map whose contents depend on `type`.

An optional `type` scopes the list to a single type; omit it to receive the entire
list.

## Endpoint

```
POST /transaction/data
```

## Headers

| Header          | Description                                                                                             |
| --------------- | ------------------------------------------------------------------------------------------------------- |
| `Content-Type`  | `application/json`                                                                                      |
| `Authorization` | `Basic base64(client_id:client_secret)`. Your `client_id` and `client_secret` are provided by MoneyOne. |

## Sample request

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://<base_url>/transaction/data' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic <base64(client_id:client_secret)>' \
    --data '{
      "transaction_id": "txn_7f8a2b91c4d3e5f2",
      "type": "KYC"
    }'
  ```
</CodeGroup>

## Parameters

<ParamField body="transaction_id" type="string" required>
  The transaction identifier returned by `/transaction/init`.
</ParamField>

<ParamField body="type" type="string">
  Scopes the response to a single `type`, e.g. `KYC` or `ANALYTICS` — it can be any
  type configured for the instance; these are just examples. Omit to receive the
  entire list.
</ParamField>

## Response 200

```json theme={null}
{
  "timestamp": "2024-06-23T10:30:00.000Z",
  "transaction_id": "txn_7f8a2b91c4d3e5f2",
  "event_type": "DATA",
  "event_status": "SUCCESS",
  "reference_id": "client-order-123",
  "data": [
    {
      "type": "KYC",
      "status": "VERIFIED",
      "data": {
        "source": "AADHAAR",
        "name": "Rahul Sharma",
        "father_name": "Suresh Sharma",
        "dob": "1990-05-12",
        "gender": "M",
        "address": { "line1": "12, MG Road", "line2": "Indiranagar", "city": "Bengaluru", "state": "Karnataka", "pincode": "560038", "country": "India" },
        "documents": { "pan": "ABCDE1234F", "aadhaar_masked": "XXXXXXXX1234" },
        "image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAA..."
      }
    }
  ]
}
```

### Top-level fields

| Field            | Description                              |
| ---------------- | ---------------------------------------- |
| `timestamp`      | ISO-8601 time the response was produced. |
| `transaction_id` | Transaction identifier for the journey.  |
| `event_type`     | Always `DATA`.                           |
| `event_status`   | Overall outcome, e.g. `SUCCESS`.         |
| `reference_id`   | Your correlation ID supplied at init.    |
| `data`           | Array of data blocks, one per `type`.    |

### `data[]` fields

| Field    | Description                                                                  |
| -------- | ---------------------------------------------------------------------------- |
| `type`   | The block's type — e.g. `KYC` or any other type configured for the instance. |
| `status` | Per-type status, e.g. `SUCCESS`, `VERIFIED`.                                 |
| `data`   | Free-form map whose contents depend on `type`.                               |

## Next step

To receive the data push instead of pulling it, configure a [Webhook](./webhooks)
subscribed to the `DATA` event.
