Skip to main content

Rake

Collect a fee on every transaction your agents make. Fees accrue in your balance and are paid out on your schedule.

How it works

StepWhat happens
ConfigureSet your fee structure (percentage, fixed, or both)
TransactFees calculated automatically on each card spend
AccrueBalance accumulates in your account
PayoutSettle via dashboard when ready

Fee structure

curl -X PATCH https://api.ledger.so/v1/rake \
  -H "Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "percentage": 0.025,
    "fixedAmount": 25
  }'
FieldDescription
enabledTurn fees on/off
percentageFee as decimal (0.025 = 2.5%)
fixedAmountFixed fee in cents
minFeeFloor for calculated fee (cents)
maxFeeCap for calculated fee (cents)
Calculation: fee = (amount × percentage) + fixedAmount Bounds are applied after calculation—minFee guarantees a minimum, maxFee caps large transactions.

Per-card overrides

Override fees for specific cards. Useful for premium tiers or promotional pricing.
curl -X POST https://api.ledger.so/v1/agents/$AGENT_ID/cards \
  -H "Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "purpose": "Premium agent card",
    "type": "multi",
    "feeOverride": {
      "enabled": true,
      "percentage": 0.01
    }
  }'
Card-level overrides take precedence over your global configuration.

Check your balance

curl https://api.ledger.so/v1/rake/balance \
  -H "Api-Key: $API_KEY"
{
  "object": "fee_balance",
  "balance": 125000,
  "currency": "USD"
}

View fee history

curl https://api.ledger.so/v1/rake/ledger \
  -H "Api-Key: $API_KEY"
{
  "object": "list",
  "data": [
    {
      "id": "fl_abc123",
      "transactionId": "txn_xyz789",
      "amount": 250,
      "balance": 125000,
      "type": "fee",
      "createdAt": 1704067200000
    }
  ],
  "hasMore": false
}
TypeDescription
feeFee collected from transaction
refundFee returned (transaction reversed)
payoutFunds settled to you

Notes

  • Fees are tracked separately—they don’t reduce the cardholder’s transaction amount
  • Declined and reversed transactions don’t incur fees
  • Balance can go negative if refunds exceed collected fees