> For the complete documentation index, see [llms.txt](https://saafe-tech-fip.gitbook.io/fip-and-cbs-api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://saafe-tech-fip.gitbook.io/fip-and-cbs-api-documentation/fip-api-v2.1.0-documentation.md).

# FIP API v2.1.0 Documentation

### Overview

The **Financial Information Provider (FIP) APIs** are used by Account Aggregators (AA) to handle customer financial information.

Account Aggregators interact with FIPs for:

* Customer account discovery
* Account linking and delinking
* Financial information requests
* Consent creation and notifications

Refer to **ReBIT FIP API Specification v2.1.0** for complete standards.

⚠️ The APIs listed below contain **only success responses** for reference.

***

## Authentication

### JWS Signature

All requests to the AA ReBIT APIs must contain a **detached JWS signature** in the header.

#### Header

| Header           | Description                      | Type   |
| ---------------- | -------------------------------- | ------ |
| x-jws-signature  | Detached JWS of the request body | string |
| client\_api\_key | Client API Key                   | string |

The **response must also contain a detached JWS signature** of the response body.

***

## Base URL

```
https://sandbox.saafe.in/api/v2
```

***

## Account Discovery and Linking

These APIs allow the **Account Aggregator (AA)** to discover and link customer accounts with the Financial Information Provider.

***

## Discover Accounts

#### Endpoint

```
POST /Accounts/discover
```

#### Headers

| Key              | Value  |
| ---------------- | ------ |
| x-jws-signature  | string |
| client\_api\_key | string |

***

#### Request Body

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T06:41:54.904+0000",
  "txnid": "f35761ac-4a18-11e8-96ff-0277a9fbfedc",
  "Customer": {
    "id": "customer_identifier@AA_identifier",
    "Identifiers": [
      {
        "category": "STRONG",
        "type": "AADHAAR",
        "value": "XXXXXXXXXXXXXXXX"
      }
    ]
  },
  "FITypes": [
    "DEPOSIT"
  ]
}
```

***

#### Response

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T11:39:57.153Z",
  "txnid": "f35761ac-4a18-11e8-96ff-0277a9fbfedc",
  "DiscoveredAccounts": [
    {
      "FIType": "DEPOSIT",
      "accType": "SAVINGS",
      "accRefNumber": "BANK11111111",
      "maskedAccNumber": "XXXXXXX3468"
    }
  ]
}
```

***

#### Response Headers

| Name            | Description                   | Type   |
| --------------- | ----------------------------- | ------ |
| x-jws-signature | Detached JWS of response body | string |

***

## Link Accounts

#### Endpoint

```
POST /Accounts/link
```

#### Request Body

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T17:51:18.412Z",
  "txnid": "f35761ac-4a18-11e8-96ff-0277a9fbfedc",
  "Customer": {
    "id": "customer_identifier@AA_identifier",
    "Accounts": [
      {
        "FIType": "DEPOSIT",
        "accType": "SAVINGS",
        "accRefNumber": "BANK11111111",
        "maskedAccNumber": "XXXXXXX3468"
      }
    ]
  }
}
```

***

#### Response

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T06:13:30.967+0000",
  "txnid": "f35761ac-4a18-11e8-96ff-0277a9fbfedc",
  "AuthenticatorType": "TOKEN",
  "RefNumber": "f6b1482e-8f08-11e8-862a-02552b0d3c36"
}
```

***

## Account Link Verification

#### Endpoint

```
POST /Accounts/link/verify
```

#### Request Body

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T10:27:17.699+0000",
  "txnid": "410c2d2e-4a1e-11e8-960e-0277a9fbfedc",
  "refNumber": "f6b1482e-8f08-11e8-862a-02552b0d3c36",
  "token": "999999"
}
```

***

#### Response

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T10:27:17.699+0000",
  "txnid": "410c2d2e-4a1e-11e8-960e-0277a9fbfedc",
  "AccLinkDetails": [
    {
      "customerAddress": "customer_address@aa_identifier",
      "linkRefNumber": "xxxxxxxxxxxxx",
      "accRefNumber": "XXXXXXXXXXXX",
      "status": "LINKED"
    }
  ]
}
```

***

## De-link Account

#### Endpoint

```
POST /Accounts/delink
```

#### Request Body

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T17:51:18.412Z",
  "txnid": "f35761ac-4a18-11e8-96ff-0277a9fbfedc",
  "Account": {
    "customerAddress": "customer_address@aa_identifier",
    "linkRefNumber": "xxxxxxxxxxxxx"
  }
}
```

***

#### Response

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T10:27:17.699+0000",
  "txnid": "410c2d2e-4a1e-11e8-960e-0277a9fbfedc",
  "AccLinkDetails": {
    "customerAddress": "customer_address@aa_identifier",
    "linkRefNumber": "xxxxxxxxxxxxx",
    "status": "DELINKED"
  }
}
```

***

## Financial Information Flow

### FI Request

#### Endpoint

```
POST /FI/request
```

#### Request Body

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T09:58:50.505Z",
  "txnid": "c4a1450c-d08a-45b4-a475-0468bd10e380",
  "Consent": {
    "id": "654024c8-29c8-11e8-8868-0289437bf331",
    "digitalSignature": "string"
  },
  "FIDataRange": {
    "from": "2018-11-27T06:26:29.761Z",
    "to": "2018-12-27T06:26:29.761Z"
  },
  "KeyMaterial": {
    "cryptoAlg": "ECDH",
    "curve": "Curve25519",
    "params": "cipher=AES/GCM/NoPadding",
    "DHPublicKey": {
      "expiry": "2019-06-01T09:58:50.505Z",
      "Parameters": "string",
      "KeyValue": "string"
    },
    "Nonce": "29512b70-ca84-46b5-9471-63765599cf15"
  }
}
```

***

#### Response

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T10:05:50.505Z",
  "txnid": "c4a1450c-d08a-45b4-a475-0468bd10e380",
  "consentId": "654024c8-29c8-11e8-8868-0289437bf331",
  "sessionId": "caa2f259-2dc2-4075-87aa-6d81018b6183"
}
```

***

## FI Fetch

#### Endpoint

```
POST /FI/fetch
```

#### Request Body

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T06:41:34.904+0000",
  "txnid": "af5b8023-aabc-4a46-8f37-d3c167129b1e",
  "sessionId": "caa2f259-2dc2-4075-87aa-6d81018b6183",
  "fipId": "FIP-1",
  "linkRefNumber": [
    {
      "id": "XXXX-XXXX-XXXX"
    }
  ]
}
```

***

#### Response

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T06:41:54.904+0000",
  "txnid": "af5b8023-aabc-4a46-8f37-d3c167129b1e",
  "FI": [
    {
      "fipID": "FIP-1",
      "data": [
        {
          "linkRefNumber": "XXXX-XXXX-XXXX",
          "maskedAccNumber": "XXXXXXXX4020",
          "encryptedFI": "string"
        }
      ]
    }
  ]
}
```

***

## Consent APIs

***

## Consent Notification

#### Endpoint

```
POST /Consent/Notification
```

#### Request Body

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T11:39:57.153Z",
  "txnid": "0b811819-9044-4856-b0ee-8c88035f8858",
  "Notifier": {
    "type": "AA",
    "id": "AA_1"
  },
  "ConsentStatusNotification": {
    "consentId": "XXXX0-XXXX-XXXX",
    "consentStatus": "REVOKED"
  }
}
```

***

#### Response

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T06:13:30.967+0000",
  "txnid": "f35761ac-4a18-11e8-96ff-0277a9fbfedc",
  "response": "OK"
}
```

***

## Consent Creation

#### Endpoint

```
POST /Consent
```

This API is used by the **Account Aggregator to notify the FIP when a new consent is created.**

#### Response

```
{
  "ver": "2.0.0",
  "timestamp": "2023-06-26T06:13:30.967+0000",
  "txnid": "f35761ac-4a18-11e8-96ff-0277a9fbfedc",
  "response": "OK"
}
```

***

## Response Header

All responses must include:

| Header          | Description                       |
| --------------- | --------------------------------- |
| x-jws-signature | Detached JWS of the response body |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://saafe-tech-fip.gitbook.io/fip-and-cbs-api-documentation/fip-api-v2.1.0-documentation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
