Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/soker90/finper/llms.txt

Use this file to discover all available pages before exploring further.

The Tickets API is a proxy to an external service called finper-bot. Tickets represent expense receipts or items that have been captured externally (e.g. photographed via a Telegram bot) and are awaiting review. The API proxies all requests to the bot’s HTTP endpoint — there is no local data model or database table for tickets.
This module requires two environment variables to function:
  • TICKET_BOT_URL — base URL of the finper-bot service (e.g. http://finper-bot:3009).
  • TICKET_BOT_API_KEY — API key for authenticating requests to the bot.
If either variable is missing, ticket endpoints will fail with a connection or authentication error. The rest of the Finper API works normally without them.

GET /api/tickets

Retrieve all tickets pending review from the finper-bot service.
curl http://localhost:3008/api/tickets \
  -H 'token: <your-jwt>'
Response 200 — array of ticket objects as returned by finper-bot. Structure depends on the bot version, but typically includes:
[
  {
    "id": "tkt_001",
    "imageUrl": "https://finper-bot.example.com/images/receipt_001.jpg",
    "amount": 24.50,
    "date": "2024-01-15",
    "status": "pending",
    "note": "Supermarket receipt"
  }
]

PATCH /api/tickets/:id

Mark a ticket as reviewed or update its metadata. The request body is forwarded to finper-bot as-is.
id
string
required
Ticket ID as returned by finper-bot.
curl -X PATCH http://localhost:3008/api/tickets/tkt_001 \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{"status": "reviewed", "note": "Linked to transaction 64d1b..."}'
Response — the updated ticket object as returned by finper-bot.

DELETE /api/tickets/:id

Delete a ticket from finper-bot.
id
string
required
Ticket ID as returned by finper-bot.
curl -X DELETE http://localhost:3008/api/tickets/tkt_001 \
  -H 'token: <your-jwt>'
Response — forwarded from finper-bot (typically 200 or 204).
Tickets have no local data model in Finper. All ticket data lives exclusively in finper-bot. Finper acts only as an authenticated gateway, adding the token header validation and forwarding the request with the TICKET_BOT_API_KEY.

Build docs developers (and LLMs) love