FyxiGo to Dashboard →

API Documentation

Fyxi provides a REST API that lets you programmatically access your receipts, analytics, and AI analysis capabilities. All endpoints are prefixed with /api/v1.

Authentication

Generate an API key in Settings → API Keys. Pass it in the request header:

Authorization: Bearer tw_live_xxxxxxxxxxxxxxxxxxxx

# Or using X-API-Key header:
X-API-Key: tw_live_xxxxxxxxxxxxxxxxxxxx

All requests must be made over HTTPS. Requests without valid authentication return 401 Unauthorized.

Tickets

Retrieve your receipt and invoice records.

GET/api/v1/tickets

List all tickets for the authenticated user

GET/api/v1/tickets/:id

Get a single ticket by ID

Example response:

{
  "data": [
    {
      "_id":           "abc123",
      "provider":      "Whole Foods Market",
      "date":          "2026-05-15",
      "amount":        47.82,
      "subtotal":      44.70,
      "tax":           3.12,
      "category":      "Food",
      "paymentMethod": "Credit Card",
      "confidence":    0.97,
      "items": [
        { "name": "Organic Milk", "qty": 1, "price": 4.99 },
        { "name": "Avocados",     "qty": 4, "price": 1.50 }
      ]
    }
  ],
  "count": 1
}

Stats

GET/api/v1/stats

Get spending statistics aggregated by category

{
  "data": {
    "totalAmount":  1248.50,
    "totalTickets": 47,
    "byCategory": {
      "Food":        412.30,
      "Transport":   178.00,
      "Technology":  320.00
    }
  }
}

Analyze Receipt

Submit a receipt image URL for AI extraction without saving it to your account.

POST/api/analyze-receipt

Analyze a receipt image with Gemini AI

# Request
POST /api/analyze-receipt
Content-Type: application/json
Authorization: Bearer tw_live_...

{
  "imageUrl": "https://your-bucket.r2.dev/receipt.jpg"
}

# Response
{
  "provider":      "Starbucks",
  "date":          "2026-05-29",
  "amount":        8.75,
  "subtotal":      8.25,
  "tax":           0.50,
  "category":      "Food",
  "paymentMethod": "Credit Card",
  "confidence":    0.99,
  "items": [
    { "name": "Grande Latte", "qty": 1, "price": 5.75 },
    { "name": "Croissant",    "qty": 1, "price": 2.50 }
  ]
}

Error Codes

400Bad RequestMissing or invalid request body
401UnauthorizedInvalid or missing API key
403ForbiddenResource does not belong to authenticated user
404Not FoundResource not found
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error