Units
Every amount in the JSON API is an integer number of cents. The HTML forms use dollars, the API uses cents, and the responses always name the unit so there is never a guess.
The web forms accept 12.50. The API accepts 1250.
Developer API
A small, predictable JSON API for the parts of FanHalo that
matter for integrations: catalogue, authentication, feed, wallet and the
money actions. Send Authorization: Bearer <token> and
you are done — no cookies, no CSRF dance.
Every amount in the JSON API is an integer number of cents. The HTML forms use dollars, the API uses cents, and the responses always name the unit so there is never a guess.
The web forms accept 12.50. The API accepts 1250.
Errors come back as JSON with an error key and a real HTTP
status code.
400 the request was malformed401 the token is missing or expired402 the wallet does not hold enough money409 the action was already done (duplicate key)| Method | Path | Auth | What it does |
|---|---|---|---|
| GET | /api/v1/health | no | Service status and version |
| GET | /api/v1/plans | no | Commercial plans with prices |
| GET | /api/v1/creators | no | Creator directory, paginated |
| GET | /api/v1/creators/:username | no | One creator with their plans |
| GET | /api/v1/posts/:id | no | A post with its media and comment count |
| POST | /api/v1/auth/register | no | Create an account, returns a token |
| POST | /api/v1/auth/login | no | Exchange credentials for a token |
| POST | /api/v1/auth/logout | yes | Invalidate the current token |
| GET | /api/v1/me | yes | The signed in user |
| GET | /api/v1/feed | yes | Posts from the people you follow |
| GET | /api/v1/wallet | yes | Balance and recent ledger entries |
| POST | /api/v1/wallet/deposit | yes | Top up the wallet (cents) |
| GET | /api/v1/notifications | yes | Notifications for the signed in user |
| POST | /api/v1/posts/:id/unlock | yes | Unlock a locked post |
| POST | /api/v1/subscribe | yes | Subscribe to a creator plan |
| POST | /api/v1/tip | yes | Send a tip to a creator |
curl -X POST https://fanhalo.mintsource.dev/api/v1/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"fiona@fanhalo.test","password":"fan12345"}'
The response carries token and user.
curl -X POST https://fanhalo.mintsource.dev/api/v1/tip \
-H "Authorization: Bearer $TOKEN" \
-H 'Content-Type: application/json' \
-d '{"username":"luna","amount":1500,"message":"great work"}'
1500 is $15.00, because the API speaks cents.