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

# List all merchant accounts

<Tip>
  This endpoint is paginated to improve its performance. The example below shows
  how to fetch multiple pages.
</Tip>

```typescript theme={null}
import axios from "axios";

const getPage = async (input: { limit?: number; cursor?: string }) => {
  const response = await axios.get("https://api.palomma.com/v0/customers", {
    headers: {
      Authorization: "Bearer <token>",
    },
    params: {
      ...input,
    },
  });
  if (!response.data) throw new Error();
  const { items, cursor, count } = response.data;
  return { items, cursor, count };
};

const getAll = async (input: { limit?: number }) => {
  let items: any[] = [];
  const firstPage = await getPage({ limit: input.limit });
  if (firstPage) {
    items = items.concat(firstPage.items);
    let currentCursor = firstPage.cursor;
    while (currentCursor !== null) {
      const nextPage = await getPage({
        limit: input.limit,
        cursor: currentCursor,
      });
      items = items.concat(nextPage.items);
      currentCursor = nextPage.cursor;
    }
  }
  return items;
};
```


## OpenAPI

````yaml GET /merchantAccounts
openapi: 3.0.0
info:
  title: Palomma API
  description: This API includes functionality of the Palomma API.
  version: 1.0.0
servers:
  - url: https://api.palomma.com/v0
    description: Production server
  - url: https://sandbox.api.palomma.com/v0
    description: Sandbox server
security:
  - BearerAuth: []
paths:
  /merchantAccounts:
    get:
      tags:
        - Merchant Accounts
      summary: Retrieve merchant accounts
      operationId: listMerchantAccounts
      parameters:
        - name: limit
          in: query
          description: Number of records to return. Default is 20. Maximum is 100.
          schema:
            type: integer
        - name: cursor
          in: query
          description: >-
            A cursor for use in pagination. The cursor indicates where to start
            fetching the results.
          schema:
            type: string
      responses:
        '200':
          description: List of merchant accounts successfully retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/MerchantAccount'
                  cursor:
                    $ref: '#/components/schemas/CursorResponse'
                  count:
                    type: integer
                    description: The total number of items returned.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
components:
  schemas:
    MerchantAccount:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for this Merchant Account.
          example: 01HPR8QBF5QKA313RPBSKYB7DS
        description:
          type: string
          description: Text configured on creation to identify the Merchant Account.
        unsettledAmount:
          type: number
          description: Amount of money in the Merchant Account that is not yet settled.
          example: 500000
        payoutLimitBalance:
          type: number
          description: >-
            Remaining balance for which payouts can be made. This balance is set
            optionally to restrict the amount of money that can be paid out from
            the Merchant Account. It can be replenished by contacting us.
          example: 200000
        type:
          type: string
          enum:
            - aggregator
            - gateway
          description: >-
            Type of the Merchant Account. Merchant Accounts are either
            aggregator or gateway. Aggregator accounts maintain a balance in
            Palomma which can be used to make payout requests while gateway
            accounts automatically withdraw funds on creation of Payin
            Settlements recurringly.
        availableBalance:
          type: number
          description: >-
            Amount of money in the Aggregator Merchant Account that has been
            settled and is available for payout. Not applicable for Gateway
            Merchant Accounts.
          example: 1000000
        payinsEnabled:
          type: boolean
          description: >-
            Whether payins are enabled for Gateway Merchant Account. Only
            applicable for Gateway Merchant Accounts, as aggregator accounts are
            always able to receive payins.
        payoutsEnabled:
          type: boolean
          description: >-
            Whether payouts are enabled for Gateway Merchant Account. Only
            applicable for Gateway Merchant Accounts, as aggregator accounts are
            always able to make payouts.
    CursorResponse:
      type: string
      nullable: true
      description: >-
        A cursor for use in pagination. Provide this value in the cursor
        parameter to retrieve the next set of results. When there are no more
        results, the cursor will be null.
      example: >-
        fa4c20cf2b51f6a45377c98271e3754da1e29b6827928a8e0b40da5a7d53c971aa22c50b2c8ce83484a0dd36ee0e2570a0520a4f1f4817962d95ba65059b9a28da1a5d4ac7bfe7628fb917efd20608656da58b412ea758ec341cd6dfb226f8be263cefa811848b859a5a71f90f47533e01e969d49c0ac9e4e944b3d0fbd4e207
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````