Skip to main content
POST
/
api
/
v1
/
agents
/
{id}
/
fund
curl -X POST "https://olive-gateway-a6ba.onrender.com/api/v1/agents/agent_abc123/fund" \
  -H "Authorization: Bearer olive_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "500000.00",
    "description": "Weekly float top-up"
  }'
{
  "success": true,
  "message": "Agent funded successfully",
  "transaction_id": "txn_fund_abc123",
  "amount": "500,000.00 SLE",
  "new_balance": "1,500,000.00 SLE",
  "funded_by": "admin@olive.sl"
}
Adds float balance to an agent’s account. System admins can fund any agent. Super-agents can only fund their sub-agents.

Request

Authorization
string
required
Bearer olive_live_xxx or Bearer eyJ... (JWT)

Path Parameters

id
string
required
Agent UUID to fund (e.g., agent_abc123)

Body Parameters

amount
string
required
Amount to add (e.g., 500000.00 or 500000)
description
string
Funding description/reference

Response

success
boolean
Whether funding succeeded
transaction_id
string
Funding transaction ID
new_balance
string
Agent’s new float balance

Examples

curl -X POST "https://olive-gateway-a6ba.onrender.com/api/v1/agents/agent_abc123/fund" \
  -H "Authorization: Bearer olive_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": "500000.00",
    "description": "Weekly float top-up"
  }'
{
  "success": true,
  "message": "Agent funded successfully",
  "transaction_id": "txn_fund_abc123",
  "amount": "500,000.00 SLE",
  "new_balance": "1,500,000.00 SLE",
  "funded_by": "admin@olive.sl"
}

Funding Sources

OLIVE Admin

System admin funds from OLIVE pool

Super-Agent

Super-agent transfers own float to sub-agent

Permissions

Funder RoleCan Fund
System AdminAny agent
Super-AgentOwn sub-agents only
Sub-AgentNone

Errors

StatusCodeDescription
400INVALID_AMOUNTInvalid amount format
401UNAUTHORIZEDInvalid API key
403FORBIDDENNot authorized to fund
403INSUFFICIENT_FLOATSuper-agent has insufficient balance
404NOT_FOUNDAgent not found
500INTERNAL_ERRORServer error