Invoices
Ingest latest rental invoice
Fetch only the current month’s rental invoice from Gmail and upload it to S3.
POST
This endpoint is also triggered automatically by an EventBridge rule every weekday at 8:30 AM UTC. When invoked by EventBridge, it processes all registered users rather than a single authenticated user.
Authentication
All requests to this endpoint must include a valid JWT in theAuthorization header.
Path parameters
string
required
The invoice type. Must be
rental for this endpoint.What this endpoint does
This endpoint checks whether a rental invoice for the current calendar month already exists in DynamoDB. If not, it connects to the user’s Gmail account and searches for the latest rental invoice email for the current month and year. If found, the PDF attachment is downloaded and uploaded to S3. The Gmail account must be connected before calling this endpoint. See Store Gmail tokens.Response
string
A human-readable confirmation message describing the outcome:
"Invoice for <month>/<year> found and ingested successfully!"— invoice was fetched and uploaded (HTTP201)."Invoice for <month>/<year> has already been processed."— invoice already exists (HTTP200)."Rental invoice for <month>/<year> has not been dispatched yet."— no matching email found in inbox (HTTP204).
number
HTTP status code.
201 when a new invoice is ingested, 200 when already processed, 204 when not yet available.null
Always
null for this endpoint.Error responses
Error responses follow this structure: