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

# Schedule Bulk FI Requests

> Schedule multiple FI requests in a single batch using a JSON payload.

## Overview

The Schedule Bulk FI Requests API allows you to submit multiple Financial Information (FI) requests in a single API call.

### Notes

* Each batch requires a unique `reference_id` for tracking purposes. This ID is provided by you and must be unique across all your batches.
* Duplicates in `consents_list` are accepted and will be scheduled as separate rows.
* You can specify global defaults for date ranges and config that apply to all records, with optional per-row overrides.
* Maximum batch size is 10,000 consents per request.

## Authentication

This API requires authentication using the following headers:

<ParamField header="client_id" type="string" required>
  Your unique client identifier provided by FinPro during onboarding.
</ParamField>

<ParamField header="client_secret" type="string" required>
  Your confidential client secret key provided by FinPro.
</ParamField>

<ParamField header="appIdentifier" type="string" required>
  The unique identifier for your application.
</ParamField>

<ParamField header="organisationId" type="string" required>
  Your organization's unique identifier assigned by FinPro.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be set to `application/json`.
</ParamField>

## Request Body

<ParamField body="reference_id" type="string" required>
  A unique identifier for this batch, provided by you. Must be alphanumeric with hyphens and underscores allowed, between 5-60 characters. This ID is used for tracking and querying batch status.
</ParamField>

<ParamField body="consents_list" type="array" required>
  An array of consent objects to process. Maximum 10,000 items per request.

  <Expandable title="consent object properties">
    <ParamField body="consent_id" type="string" required>
      The unique consent identifier from the Account Aggregator.
    </ParamField>

    <ParamField body="fiDataRangeFrom" type="string">
      Start date for financial data (ISO 8601 format). Overrides the global default for this specific consent.
    </ParamField>

    <ParamField body="fiDataRangeTo" type="string">
      End date for financial data (ISO 8601 format). Overrides the global default for this specific consent.
    </ParamField>

    <ParamField body="configId" type="string">
      Analytics configuration ID to use for this consent. Overrides the global default.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="fiDataRangeFrom" type="string">
  Global default start date for financial data (ISO 8601 format). Applied to all consents that don't specify their own value.
</ParamField>

<ParamField body="fiDataRangeTo" type="string">
  Global default end date for financial data (ISO 8601 format). Applied to all consents that don't specify their own value.
</ParamField>

<ParamField body="configId" type="string">
  Global default analytics configuration ID. Applied to all consents that don't specify their own value.
</ParamField>

### Request Example

```json theme={null}
{
  "reference_id": "batch-20251110-001",
  "consents_list": [
    {
      "consent_id": "54450ac0-8bcb-4b9c-ad74-29b4fabe18f7",
      "fiDataRangeFrom": "2024-01-01T00:00:00Z",
      "fiDataRangeTo": "2024-06-30T23:59:59Z",
      "configId": "analytics-config-1"
    },
    {
      "consent_id": "7b2d9e3a-1f4c-4a8b-9c6d-2e5f8a9b0c1d"
    },
    {
      "consent_id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
      "fiDataRangeTo": "2024-12-31T23:59:59Z"
    }
  ],
  "fiDataRangeFrom": "2024-01-01T00:00:00Z",
  "fiDataRangeTo": "2024-12-31T23:59:59Z",
  "configId": "analytics-config-default"
}
```

In this example:

* The first consent uses its own date range and config.
* The second consent uses the global defaults for all parameters.
* The third consent uses the global `fiDataRangeFrom` and `configId`, but overrides `fiDataRangeTo`.

## Response Parameters

<ResponseField name="ver" type="string">
  The API version that processed the request.
</ResponseField>

<ResponseField name="timestamp" type="string">
  The timestamp when the response was generated (ISO 8601 format).
</ResponseField>

<ResponseField name="txnid" type="string">
  A unique transaction ID for this API call.
</ResponseField>

<ResponseField name="status" type="string">
  The status of the API call. Returns `"success"` when the batch is accepted.
</ResponseField>

<ResponseField name="message" type="string">
  A human-readable message describing the result.
</ResponseField>

<ResponseField name="data" type="object">
  Contains batch details and tracking information.

  <Expandable title="data properties">
    <ResponseField name="reference_id" type="string">
      The reference ID you provided for this batch.
    </ResponseField>

    <ResponseField name="batch_id" type="string">
      An internal batch identifier generated by the system.
    </ResponseField>

    <ResponseField name="status" type="string">
      The current batch status. Initially `"READY"`.
    </ResponseField>

    <ResponseField name="total_records" type="integer">
      The number of consent records in this batch.
    </ResponseField>

    <ResponseField name="tracking_url" type="string">
      The endpoint to use for checking batch status (`/bulk/status`).
    </ResponseField>
  </Expandable>
</ResponseField>

### Success Response Example

```json theme={null}
{
  "ver": "1.0",
  "timestamp": "2024-11-10T12:00:00Z",
  "txnid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "success",
  "message": "Batch accepted and queued for processing",
  "data": {
    "reference_id": "batch-20251110-001",
    "batch_id": "5284f779-69a5-4934-8816-40c648d6bb80",
    "status": "READY",
    "total_records": 3,
    "tracking_url": "/bulk/status"
  }
}
```

## Error Responses

### Missing Reference ID

When the `reference_id` field is not provided:

```json theme={null}
{
  "ver": "1.0",
  "timestamp": "2024-11-10T12:00:00Z",
  "txnid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "errorCode": "MissingReferenceId",
  "errorMsg": "reference_id is required"
}
```

**HTTP Status Code**: `400 Bad Request`

### Duplicate Reference ID

When the `reference_id` already exists:

```json theme={null}
{
  "ver": "1.0",
  "timestamp": "2024-11-10T12:00:00Z",
  "txnid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "errorCode": "DuplicateReferenceId",
  "errorMsg": "reference_id 'batch-20251110-001' already exists"
}
```

**HTTP Status Code**: `409 Conflict`

### Validation Failed

When the request body contains invalid data:

```json theme={null}
{
  "ver": "1.0",
  "timestamp": "2024-11-10T12:00:00Z",
  "txnid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "errorCode": "InvalidRequest",
  "errorMsg": "consents_list cannot exceed 10,000 records",
  "errorDetails": {
    "field": "consents_list",
    "provided": 15000,
    "max": 10000
  }
}
```

**HTTP Status Code**: `400 Bad Request`

### Common Error Codes

| Error Code             | Description                                                                           |
| ---------------------- | ------------------------------------------------------------------------------------- |
| `MissingReferenceId`   | The `reference_id` field is required but was not provided.                            |
| `DuplicateReferenceId` | A batch with this `reference_id` already exists.                                      |
| `InvalidRequest`       | The request body contains invalid data (e.g., too many records, invalid date format). |
| `InvalidDateRange`     | The `fiDataRangeFrom` is after `fiDataRangeTo`.                                       |
