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

# Fetch Balance

> Returns the available balance per asset for the prefunded wallet (cached briefly).

<Prompt description="Fetch Prefunded Balance" actions={["cursor"]}>
  Integrate the DollarPe Fetch Prefunded Balance endpoint into my application.

  Endpoint: GET /pos/api/v1/payout/balance
  Base URL: [https://api.dollarpe.in](https://api.dollarpe.in) (production) | [https://sandbox.dollarpe.in](https://sandbox.dollarpe.in) (sandbox)

  Auth headers required on every request:

  * X-API-KEY: your API key
  * X-TIMESTAMP: current Unix time in seconds
  * X-SIGNATURE: Base64(HMAC-SHA256(X-API-KEY + X-TIMESTAMP + sortedJSONBody, apiSecret))

  Task: Write a typed function that:

  1. Builds the signed auth headers
  2. Calls GET /pos/api/v1/payout/balance
  3. Returns the available balance per asset (map of asset code to decimal string, e.g. USDT → "15000.5")
  4. Handles 400 (err\_code PREFUNDED\_NOT\_ENABLED — prefunding flow not enabled for the organization) and 500 errors

  Language: TypeScript
</Prompt>

## Error Codes and Messages

| API Status Code | Response              | Reason                                                                                   |
| --------------- | --------------------- | ---------------------------------------------------------------------------------------- |
| 400             | Bad Request           | Prefunding flow is not enabled for your organization (`err_code: PREFUNDED_NOT_ENABLED`) |
| 500             | Internal Server Error | Internal Server Error                                                                    |


## OpenAPI

````yaml GET /pos/api/v1/payout/balance
openapi: 3.1.0
info:
  title: DollarPe API
  description: API for DollarPe - Customer, Payout, and Webhook services
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://sandbox.dollarpe.xyz/pos/api/v1
    description: Payout API Base URL
    variables:
      base_url:
        default: https://sandbox.dollarpe.xyz
  - url: https://sandbox.dollarpe.xyz/cms/api/v1
    description: Customer API Base URL
    variables:
      base_url:
        default: https://sandbox.dollarpe.xyz
security:
  - ApiKeyAuth: []
    TimestampAuth: []
    SignatureAuth: []
tags:
  - name: Customer
    description: Customer related operations
    x-displayName: Customer
    x-traitTag: true
  - name: Payout
    description: Payout related operations
  - name: Webhooks
    description: Webhook related operations
  - name: Widget
    description: Hosted buy/sell widget session initialization
paths:
  /pos/api/v1/payout/balance:
    get:
      tags:
        - Payout
      description: >-
        Returns the available balance per asset for your organization's
        prefunded wallet. The response is cached briefly, so a just-completed
        top-up or payout may take a short while to reflect.
      responses:
        '200':
          description: Prefunded wallet balance fetched successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    properties:
                      available_balance:
                        type: object
                        description: >-
                          Map of asset code to available balance (as a decimal
                          string)
                        additionalProperties:
                          type: string
                        example:
                          USDT: '15000.5'
        '400':
          description: Bad Request — prefunding flow is not enabled for the organization
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Bad Request
                  data:
                    type: 'null'
                  errors:
                    type: object
                    properties:
                      payout:
                        type: array
                        items:
                          type: string
                        example:
                          - >-
                            This endpoint is not available for your
                            organization.
                  err_code:
                    type: string
                    example: PREFUNDED_NOT_ENABLED
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Internal Server Error
                  err_code:
                    type: string
                    example: SYS_INTERNAL_ERROR
                  errors:
                    type: string
                    example: Unexpected error occurred. Please try again later.
                  data:
                    type: 'null'
      servers:
        - url: https://sandbox.dollarpe.xyz
          description: Payout API Base URL
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API Key for authentication
    TimestampAuth:
      type: apiKey
      in: header
      name: X-TIMESTAMP
      description: Current timestamp in seconds since epoch
    SignatureAuth:
      type: apiKey
      in: header
      name: X-SIGNATURE
      description: HMAC SHA256 signature of the request encoded in Base64

````