Solidarity

Public stats for the solidarity fund and the caller's personal contribution summary. See Commission & solidarity for how the fund is filled. Paths are relative to the /api/v1 prefix; the stats endpoints are public, while /solidarity/me requires Authorization: Bearer {token}.

See Common errors and Commission & solidarity for how the fund is filled.

Endpoints

Method URI Role Description
GET /solidarity/stats Public Aggregate fund stats (optionally per city)
GET /solidarity/recent-deliveries Public Recent fund-backed deliveries (PII-free)
GET /solidarity/me any The caller's own contribution summary

Money fields end in _usd (decimal).


GET /solidarity/stats

Aggregate fund stats. Pass city_id to scope the totals to a single city; omit it to aggregate across all cities.

Query

Field Type Required Rules
city_id integer no scope totals to one city

Response 200

{
  "totalFundUSD": 124.5,
  "clientContributionsUSD": 49.8,
  "driverContributionsUSD": 37.35,
  "aguitaContributionsUSD": 37.35,
  "contributionsCount": 312,
  "totalLitersDonated": 24900,
  "communitiesBenefited": 4,
  "familiesBenefited": 0
}
Field Type Description
totalFundUSD number The whole fund
clientContributionsUSD number The clients' 1%
driverContributionsUSD number The drivers' 1%
aguitaContributionsUSD number AgĂĽita's own 1%, mirroring the driver's
totalLitersDonated integer Litres the fund funds, at aguita.solidary.usd_per_1000_liters (5 USD per 1000 L by default)

The three contributions always add up to totalFundUSD. Contributions recorded before 2026-06-08 predate AgĂĽita's slice, so for those aguitaContributionsUSD is 0 and the other two already make up their total.

familiesBenefited is reserved and currently always 0.


GET /solidarity/recent-deliveries

A short, PII-free feed of recent fund-backed deliveries (truncated neighborhood, liters, and the driver's first name only).

Query

Field Type Required Rules
limit integer no 1–50; defaults to 10 (out-of-range values are clamped)

Response 200

{
  "deliveries": [
    {
      "liters": 5000,
      "driverFirstName": "Carlos",
      "neighborhood": "Av. Principal, Las Mercedes",
      "date": "2026-06-26T12:40:00+00:00"
    }
  ]
}

GET /solidarity/me

The authenticated user's contribution summary, plus their driver-side contributions when they have a driver profile.

Response 200

{
  "user": {
    "name": "Ana MartĂ­nez",
    "totalSolidaryUSD": 4.2,
    "totalSolidaryLTS": 840,
    "totalOrders": 12,
    "totalLitersOrdered": 36000,
    "byMonth": [ { "month": "2026-06", "totalUSD": 1.4 } ]
  },
  "driver": {
    "totalSolidaryUSD": 6.1,
    "totalSolidaryLTS": 1220,
    "matchedByAguitaUSD": 6.1,
    "matchedByAguitaLTS": 1220,
    "totalImpactLTS": 2440,
    "completedOrders": 48,
    "totalLitersDelivered": 240000
  }
}
Field Type Description
user.totalSolidaryLTS integer Litres the client's contribution funds
driver.totalSolidaryLTS integer Litres the driver's own contribution funds
driver.matchedByAguitaUSD number What AgĂĽita contributed mirroring this driver
driver.matchedByAguitaLTS integer The same, in litres
driver.totalImpactLTS integer Litres funded by the driver's slice plus AgĂĽita's match

totalLitersOrdered / totalLitersDelivered are litres of water ordered or delivered, not funded — do not confuse them with the *LTS fields.

AgĂĽita mirrors the driver's slice, not the client's, so matchedByAguita* only appears in the driver block. matchedByAguitaUSD is summed from the driver's delivered orders rather than assumed equal to their own contribution: deliveries before 2026-06-08 predate the mirror and were not matched.

driver is null when the user has no driver profile.


Examples

# Public fund stats for a city
curl "/api/v1/solidarity/stats?city_id=1"

# My contribution summary
curl /api/v1/solidarity/me -H "Authorization: Bearer {token}"