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

# Get Loan Accounts

> Retrieves the credit lines for the authenticated business, with balances and credit limits in smallest units. The accounts sit at the top level of the response as `loans`, not under `data`.

Retrieve the credit lines associated with your business, with their balances and credit limits. All amounts are in the smallest unit of the loan currency (kobo for NGN, cents for USD).

## Example Request

```bash theme={null}
curl -X GET "https://api.rolla.xyz/api/v1/external/wallet/loans" \
  -H "X-API-Key: your_api_key_here"
```

## Example Response

```json theme={null}
{
  "status": 200,
  "message": "Loan accounts retrieved successfully",
  "success": true,
  "loans": [
    {
      "id": "d4e5f6a7-b8c9-4012-9def-456789012345",
      "name": "Acme Ltd NGN Credit Line",
      "currency": "NGN",
      "balance": {
        "availableBalance": 2000000,
        "postedBalance": 2000000,
        "pendingBalance": 0,
        "lienAmount": 0
      },
      "virtualAccounts": [],
      "credit_limit": 5000000,
      "interest_rate": 12.5
    }
  ]
}
```

<Info>
  `balance.postedBalance` is the amount currently drawn. The credit still available to draw is `credit_limit` minus `balance.postedBalance` — in the example above, 3000000 kobo. `interest_rate` is an annual percentage, not an amount, so it is never converted to minor units.
</Info>

<Note>
  Unlike most reads on this API, the loan accounts sit at the top level of the response as `loans`, not under `data`.
</Note>


## OpenAPI

````yaml GET /wallet/loans
openapi: 3.1.0
info:
  title: Rolla Developer API
  description: >-
    API for programmatic transaction management on the Rolla platform. Monetary
    `amount` fields use the smallest unit of the referenced currency unless an
    endpoint says otherwise (e.g. NGN = kobo, USD = cents, where **100 cents =
    USD 1.00**).
  version: 1.0.0
servers:
  - url: https://api.rolla.xyz/api/v1/external
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /wallet/loans:
    get:
      summary: Get Loan Accounts
      description: >-
        Retrieves the credit lines for the authenticated business, with balances
        and credit limits in smallest units. The accounts sit at the top level
        of the response as `loans`, not under `data`.
      operationId: getLoanAccounts
      responses:
        '200':
          description: Loan accounts retrieved successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                  - success
                  - loans
                properties:
                  status:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: Loan accounts retrieved successfully
                  success:
                    type: boolean
                    example: true
                  loans:
                    type: array
                    items:
                      $ref: '#/components/schemas/LoanAccount'
              example:
                status: 200
                message: Loan accounts retrieved successfully
                success: true
                loans:
                  - id: d4e5f6a7-b8c9-4012-9def-456789012345
                    name: Acme Ltd NGN Credit Line
                    currency: NGN
                    balance:
                      availableBalance: 2000000
                      postedBalance: 2000000
                      pendingBalance: 0
                      lienAmount: 0
                    virtualAccounts: []
                    credit_limit: 5000000
                    interest_rate: 12.5
        '401':
          description: Unauthorized - invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Loan accounts could not be read
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    LoanAccount:
      type: object
      description: >-
        A credit line. Carries the same id, name, currency, balance and
        virtualAccounts as a wallet, plus the credit limit and the interest
        rate.
      properties:
        id:
          type: string
          format: uuid
          example: d4e5f6a7-b8c9-4012-9def-456789012345
        name:
          type: string
          example: Acme Ltd NGN Credit Line
        currency:
          type: string
          example: NGN
        balance:
          type: object
          description: >-
            Balances in the smallest unit of the loan currency. postedBalance is
            the amount currently drawn.
          properties:
            availableBalance:
              type: integer
              nullable: true
              description: >-
                Spendable balance: posted credits less posted and pending
                debits, already net of lienAmount. Check a withdrawal against
                this figure.
              example: 2000000
            postedBalance:
              type: integer
              nullable: true
              description: Posted balance. Pending debits have not been deducted from it.
              example: 2000000
            pendingBalance:
              type: integer
              nullable: true
              description: Amount held by transactions that have not posted.
              example: 0
            lienAmount:
              type: integer
              nullable: true
              description: >-
                Portion reserved by Rolla and unavailable for withdrawal.
                Already excluded from availableBalance.
              example: 0
        virtualAccounts:
          type: array
          description: 'Empty on a credit line: funds are drawn into a wallet, not paid in.'
          items:
            $ref: '#/components/schemas/VirtualAccount'
        credit_limit:
          type: integer
          nullable: true
          description: >-
            Total credit available on the line, in smallest units. The credit
            still undrawn is this minus balance.postedBalance.
          example: 5000000
        interest_rate:
          type: number
          description: >-
            Annual interest rate as a percentage. Not an amount, so never
            converted to smallest units.
          example: 12.5
    Error:
      type: object
      required:
        - status
        - message
      description: >-
        Error envelope. Some errors add further top-level fields (for example
        `accountBlocked`, `provider`, `missingFields`); the endpoint documents
        them where they apply.
      additionalProperties: true
      properties:
        status:
          type: integer
          description: HTTP status code, repeated in the body as a number
          example: 400
        message:
          type: string
          description: Human-readable description of what went wrong
          example: Validation failed
        code:
          type: string
          description: >-
            Machine-readable error code, present on some errors only. See the
            Errors concept page for the taxonomy.
          example: ACCOUNT_RESTRICTED
        errors:
          type: array
          description: 'Present on `400` validation failures: one entry per offending field'
          items:
            type: object
            properties:
              path:
                type: array
                items:
                  type: string
                example:
                  - amount
              message:
                type: string
                example: >-
                  amount must be a whole number of smallest currency units (e.g.
                  cents)
    VirtualAccount:
      type: object
      description: >-
        A virtual account as the external API returns it. Fields that are empty
        for the account are omitted, so a fiat account carries bank details and
        a crypto account carries a wallet address instead.
      required:
        - id
        - status
        - virtual_account_type
        - currency_type
      properties:
        id:
          type: string
          format: uuid
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        status:
          type: string
          description: Account status
          example: active
        virtual_account_type:
          type: string
          enum:
            - static
            - dynamic
          example: static
        currency_type:
          type: string
          enum:
            - fiat
            - crypto
          example: fiat
        bank_name:
          type: string
          description: Fiat accounts only
          example: Wema Bank
        account_number:
          type: string
          description: Fiat accounts only
          example: '9876543210'
        account_name:
          type: string
          description: Fiat accounts only
          example: Rolla / Your Business Name
        routing_number:
          type: string
          description: USD fiat accounts only
          example: '021000021'
        bank_address:
          type: object
          additionalProperties: true
          description: USD fiat accounts only. Empty parts of the address are omitted.
          example:
            city: New York
            country: US
        swift_code:
          type: string
          description: USD fiat accounts only
          example: LEADUS33
        expires_at:
          type: string
          format: date-time
          description: 'Dynamic accounts only: when the account stops accepting deposits.'
          example: '2024-01-16T10:30:00.000Z'
        stablecoin_type:
          type: string
          description: Crypto accounts only
          example: USDT
        wallet_address:
          type: string
          description: Crypto accounts only
          example: '0xAbC1234dEf5678901234567890aBcDeF12345678'
        wallet_chain:
          type: string
          description: Crypto accounts only
          example: ethereum
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Rolla API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.