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

# Repaid Transactions

> Retrieves a list of all repaid transactions for a user.

Fetches all repayment transactions that have been completed by the user across all their loans.

<RequestExample>
  ```bash cURL GET theme={null}
  [https://finlend.fincode.software/api/v1/services/user/repaid-transactions/{user-id}](https://finlend.fincode.software/api/v1/services/user/repaid-transactions/{user-id})
  ```
</RequestExample>

## Request Headers

<ParamField header="X-Auth-Token" type="string" required>
  The **JWT Access Token** obtained from the `/login` or `/refresh-token` endpoint.
</ParamField>

<ParamField header="x-idempotency-key" type="string" required>
  Unique idempotency key for the request to prevent duplicate processing.
</ParamField>

<ParamField header="x-fapi-auth-date" type="string" required>
  The date and time at which the request was initiated (ISO 8601 format).
</ParamField>

<ParamField header="x-fapi-customer-ip-address" type="string" required>
  The IP address of the customer making the request.
</ParamField>

<ParamField header="x-fapi-interaction-id" type="string" required>
  Unique identifier for the interaction/session.
</ParamField>

## Path Parameters

<ParamField path="user-id" type="string" required>
  The unique identifier (UUID) of the user whose repaid transactions to retrieve.
</ParamField>

## Response

Returns a list of all repaid transactions.

<ResponseField name="status" type="string" default="SUCCESS">
  Overall status of the API request.
</ResponseField>

<ResponseField name="data" type="array">
  Array of repayment transaction objects.

  <Expandable title="data array item">
    <ResponseField name="repaymentId" type="string">
      Unique identifier for the repayment.
    </ResponseField>

    <ResponseField name="loanApplicationId" type="string">
      Identifier of the loan application.
    </ResponseField>

    <ResponseField name="repaymentAmount" type="number">
      Amount that was repaid.
    </ResponseField>

    <ResponseField name="paymentDate" type="string">
      Date when the payment was made.
    </ResponseField>

    <ResponseField name="paymentMethod" type="string">
      Method used for payment.
    </ResponseField>

    <ResponseField name="status" type="string">
      Status of the repayment (typically `VERIFIED` or `PAID`).
    </ResponseField>
  </Expandable>
</ResponseField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://finlend.fincode.software/api/v1/services/user/repaid-transactions/123e4567-e89b-12d3-a456-426614174000' \
  --header 'X-Auth-Token: YOUR_JWT_ACCESS_TOKEN' \
  --header 'x-idempotency-key: unique-key-12345' \
  --header 'x-fapi-auth-date: 2024-01-15T10:30:00Z' \
  --header 'x-fapi-customer-ip-address: 192.168.1.1' \
  --header 'x-fapi-interaction-id: interaction-12345'
  ```

  ```javascript Node.js theme={null}
  const axios = require('axios');

  const BASE_URL = 'https://finlend.fincode.software/api/v1/services/user';

  async function getRepaidTransactions(accessToken, userId) {
    try {
      const response = await axios.get(
        `${BASE_URL}/repaid-transactions/${userId}`,
        {
          headers: {
            'X-Auth-Token': accessToken,
            'x-idempotency-key': `key-${Date.now()}`,
            'x-fapi-auth-date': new Date().toISOString(),
            'x-fapi-customer-ip-address': '192.168.1.1',
            'x-fapi-interaction-id': `interaction-${Date.now()}`,
          },
        }
      );
      return transactions;
    } catch (error) {
      console.error(
        'Failed to fetch repaid transactions:',
        error.response?.data || error.message
      );
      throw error;
    }
  }

  ```
</CodeGroup>
