Skip to content

Balance

Endpoint to query account balance.

GET /v1/balance

Returns the authenticated user's balance, including total balance, available for withdrawal and held.

Headers

http
Authorization: Bearer {access_token}

Request Example

bash
curl -X GET https://api.misespay.com/v1/balance \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Response (200 OK)

json
{
  "success": true,
  "data": {
    "total": {
      "cents": 150000,
      "amount": 1500.0,
      "formatted": "R$ 1.500,00"
    },
    "available": {
      "cents": 100000,
      "amount": 1000.0,
      "formatted": "R$ 1.000,00"
    },
    "hold": {
      "cents": 50000,
      "amount": 500.0,
      "formatted": "R$ 500,00"
    }
  }
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
data.totalobjectTotal account balance
data.total.centsintegerTotal amount in cents
data.total.amountnumberTotal amount in reais
data.total.formattedstringTotal amount formatted (e.g. "R$ 1.500,00")
data.availableobjectBalance available for withdrawal
data.available.centsintegerAvailable amount in cents
data.available.amountnumberAvailable amount in reais
data.available.formattedstringAvailable amount formatted
data.holdobjectHeld/blocked balance
data.hold.centsintegerHeld amount in cents
data.hold.amountnumberHeld amount in reais
data.hold.formattedstringHeld amount formatted

Balance Types

Total

Sum of all money in the account (available + held).

Available

Amount that can be withdrawn immediately. This is the balance used to validate withdrawals.

Hold

Amount temporarily blocked by:

  • Sales in processing
  • Withdrawals pending approval
  • Compliance reviews
  • Disputes or chargebacks

Possible Errors

401 Unauthorized

json
{
  "error": "Unauthorized",
  "message": "Invalid or expired token"
}

500 Internal Server Error

json
{
  "success": false,
  "message": "Error querying balance"
}

Value Formats

The API returns values in three formats to facilitate different use cases:

Cents

  • Type: Integer
  • Use: Precise calculations, avoids floating point issues
  • Example: 150000 = R$ 1,500.00

Amount (Reais)

  • Type: Number (float)
  • Use: Display and simple calculations
  • Example: 1500.00

Formatted

  • Type: String
  • Use: Direct display to users
  • Example: "R$ 1.500,00"

TIP

For precise calculations, always use the value in cents to avoid rounding issues with decimal numbers.

  1. Query balance before creating withdrawals
  2. Check available (not total) to validate if there's sufficient balance
  3. Consider withdrawal fee (R$ 0.20) in the calculation
  4. Update balance after sale or withdrawal operations

Next Steps

Mises API - Simplified PIX Payments