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

# Get Agent Balance

> Check agent's current float balance

## Request

<ParamField header="Authorization" type="string" required>
  `Bearer olive_live_xxx` or `Bearer eyJ...` (JWT)
</ParamField>

### Path Parameters

<ParamField path="id" type="string" required>
  Agent UUID (e.g., `agent_abc123`)
</ParamField>

***

## Response

<ResponseField name="agent_id" type="string">
  Agent UUID
</ResponseField>

<ResponseField name="balance" type="integer">
  Float balance in cents
</ResponseField>

<ResponseField name="balance_formatted" type="string">
  Formatted balance (e.g., `1,500,000.00 SLE`)
</ResponseField>

<ResponseField name="currency" type="string">
  Currency code (`SLE`)
</ResponseField>

***

## Examples

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://demo.api.vultlocal.com/api/v1/agents/agent_abc123/balance" \
    -H "Authorization: Bearer olive_live_xxx"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "success": true,
    "agent_id": "agent_abc123",
    "business_name": "ABC Money Services",
    "balance": 150000000,
    "balance_formatted": "1,500,000.00 SLE",
    "currency": "SLE",
    "last_transaction_at": "2025-01-15T10:30:00Z"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Agent not found",
    "code": "NOT_FOUND"
  }
  ```
</ResponseExample>

***

## Use Cases

<CardGroup cols={2}>
  <Card title="Before Cash-In" icon="check">
    Verify sufficient float before processing
  </Card>

  <Card title="Daily Reconciliation" icon="calculator">
    Check end-of-day float position
  </Card>
</CardGroup>

***

## Errors

| Status | Code             | Description                    |
| ------ | ---------------- | ------------------------------ |
| 401    | `UNAUTHORIZED`   | Invalid API key                |
| 403    | `FORBIDDEN`      | Not authorized to view balance |
| 404    | `NOT_FOUND`      | Agent not found                |
| 500    | `INTERNAL_ERROR` | Server error                   |


## OpenAPI

````yaml olive-openapi.json GET /agents/{id}/balance
openapi: 3.0.0
info:
  description: >-
    API Gateway for OLIVE NFC Card Payment System - Comprehensive payment, card
    management, agent operations, and admin authentication. All /api/v1 routes
    require authentication using either API Key or JWT token.
  title: OLIVE NFC Card Payment API
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    email: support@olive.sl
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://olive-gateway-a6ba.onrender.com/api/v1
security: []
paths:
  /agents/{id}/balance:
    get:
      tags:
        - Agents
      summary: Get agent balance
      description: Get current float balance for an agent
      parameters:
        - description: Agent ID
          name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
        - ApiKeyAuth: []
        - BearerAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      description: >-
        API Key for third-party integrations (WhatsApp, Smart PAY, VULT).
        Format: 'Bearer olive_live_xxxxxxxxxxxxx'
      type: apiKey
      name: Authorization
      in: header
    BearerAuth:
      description: >-
        JWT token from admin login for administrative operations. Format:
        'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
      type: apiKey
      name: Authorization
      in: header

````