Log an expense
log_expenseLog a new travel expense for the authenticated user. Amounts are integer minor units (e.g. cents) with an ISO-4217 currency code. Every expense is TIED to exactly one owned journey OR stay — provide journeyId or stayId (one, not both; standalone expenses do not exist). Categories are preset: ticket/addon/upgrade for journey expenses, room/addon/upgrade for stay expenses. Tip: when logging a journey/stay AND its price, prefer the log_journey/log_stay costs input — one call instead of two. If a matching record already exists, this returns a warning naming its ID instead of inserting a duplicate — pass allowDuplicate: true to create it anyway. If unfamiliar with TripLedger semantics, call get_tripledger_guide first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fxRate | No | ||
| stayId | No | ||
| spentAt | No | ||
| category | No | ||
| currency | No | ||
| feesMinor | No | ||
| journeyId | No | ||
| amountMinor | No | ||
| description | No | ||
| payerPersonId | No | ||
| allowDuplicate | No | Set true to create even if a matching record already exists (see the duplicate-guard note above). Defaults to false. |