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

# Fetch All Accounts

This API retrieves all accounts associated with the payout system.

### Request Body

```json theme={null}
{
  "pg": "string" // Optional: Specify the payment gateway to fetch accounts for
}
```

### Responses

#### 200 OK

```json theme={null}
{
  "status": true,
  "accounts": [
    {
      "pg": "string",
      "account_id": "string",
      "balance": 1000.00
    }
  ]
}
```

#### 400 Bad Request

```json theme={null}
{
  "status": false,
  "error": {
    "message": "Invalid request",
    "code": 400
  }
}
```


## OpenAPI

````yaml POST /api/v2/payout/accounts
openapi: 3.1.0
info:
  title: Orchestration
  version: '1'
servers:
  - url: https://api.paytring.com
security:
  - sec0: []
paths:
  /api/v2/payout/accounts:
    post:
      summary: Fetch All Accounts
      operationId: fetch-accounts
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                pg:
                  type: string
                  description: pg of which acounts needs to be fetched
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "status": true,
                        "accounts": {
                            "cashfree": {
                                "status": false,
                                "error": {
                                    "message": "Internal Server Error, Invalid response received from payment gateway.",
                                    "code": "INTERNAL_SERVER_ERROR"
                                }
                            },
                            "decentro": {
                                "status": true,
                                "data": [
                                    {
                                        "account_number": "936551184xxxxxxxxxxxx77",
                                        "ifsc_code": "Dxxxxxxx11",
                                        "account_type": "VIRTUAL",
                                        "currency": "INR",
                                        "available_balance": 0,
                                        "account_balance": 0,
                                        "minimum_balance": 0,
                                        "hold_fund": null,
                                        "overdraft": null,
                                        "transaction_limit": 1000000
                                    }
                                ]
                            }
                        }
                    }
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                    default: true
                  accounts:
                    type: object
                    properties:
                      cashfree:
                        type: object
                        properties:
                          status:
                            type: boolean
                            example: false
                            default: true
                          error:
                            type: object
                            properties:
                              message:
                                type: string
                                example: >-
                                  Internal Server Error, Invalid response
                                  received from payment gateway.
                              code:
                                type: string
                                example: INTERNAL_SERVER_ERROR
                      decentro:
                        type: object
                        properties:
                          status:
                            type: boolean
                            example: true
                            default: true
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                account_number:
                                  type: string
                                  example: 936551184xxxxxxxxxxxx77
                                ifsc_code:
                                  type: string
                                  example: Dxxxxxxx11
                                account_type:
                                  type: string
                                  example: VIRTUAL
                                currency:
                                  type: string
                                  example: INR
                                available_balance:
                                  type: integer
                                  example: 0
                                  default: 0
                                account_balance:
                                  type: integer
                                  example: 0
                                  default: 0
                                minimum_balance:
                                  type: integer
                                  example: 0
                                  default: 0
                                hold_fund: {}
                                overdraft: {}
                                transaction_limit:
                                  type: integer
                                  example: 1000000
                                  default: 0
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                        "status": false,
                        "error": {
                            "message": "Hash is not verified",
                            "code": 204
                        }
                    }
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                    default: true
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Hash is not verified
                      code:
                        type: integer
                        example: 204
                        default: 0
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````