Mileage

A business mileage log priced at the IRS standard mileage rate, and recording it in the books.

List mileage trips

GET /mileage-trips

Sends Vortex-Entity.

Newest first. Requires ledger:read. Each trip shows the IRS business standard mileage rate in force on its date (rate_cents), the amount at that rate to the cent, and whether that year's rates are confirmed in SYNC (rate_confirmed; for a year not yet confirmed, the latest confirmed rate is shown). recorded is true while the trip is part of a reimbursement entry that hasn't been reversed.

Parameters

NameInTypeAbout
start_datequerystring (date)
end_datequerystring (date)
limitqueryinteger
starting_afterquerystring

Answers

  • 200 object. A page of trips.
  • 4XX Problem. An error. `code` is stable and safe to branch on; `detail` says in plain English what
  • 5XX Problem. An error. `code` is stable and safe to branch on; `detail` says in plain English what

Log a business trip

POST /mileage-trips

Sends Vortex-Entity.

Logging a trip doesn't change the books. Requires journal:write. project must be an active project (422 unknown_project).

Body

FieldTypeAbout
date requiredstring (date)
purpose requiredstring

Up to 200 characters.

miles requiredstring

More than 0 and at most 2,000, with at most one decimal place.

vehiclestring

Up to 100 characters.

start_placestring

Up to 200 characters.

end_placestring

Up to 200 characters.

projectstring

Answers

  • 201 MileageTrip. The trip.
  • 4XX Problem. An error. `code` is stable and safe to branch on; `detail` says in plain English what
  • 5XX Problem. An error. `code` is stable and safe to branch on; `detail` says in plain English what

Delete a trip

DELETE /mileage-trips/{trip_id}

Sends Vortex-Entity.

Requires journal:write. A recorded trip returns 409 trip_recorded; reverse its entry first.

Parameters

NameInTypeAbout
trip_id requiredpathstring (uuid)

Answers

  • 200 object. Deleted.
  • 4XX Problem. An error. `code` is stable and safe to branch on; `detail` says in plain English what
  • 5XX Problem. An error. `code` is stable and safe to branch on; `detail` says in plain English what

Miles and the IRS-rate amount for a period

GET /mileage-summary

Sends Vortex-Entity.

Totals for the trips in the dates, split by rate, and what isn't recorded in the books yet. Requires ledger:read.

Parameters

NameInTypeAbout
start_date requiredquerystring (date)
end_date requiredquerystring (date)

Answers

  • 200 object. The summary.
  • 4XX Problem. An error. `code` is stable and safe to branch on; `detail` says in plain English what
  • 5XX Problem. An error. `code` is stable and safe to branch on; `detail` says in plain English what

Record mileage in the books at the IRS rate

POST /mileage-reimbursements

Sends Vortex-Entity and Idempotency-Key.

Records every trip not yet recorded, dated on or before through (and on or after start_date when sent), as one journal entry dated through: expense_account_id is debited, one line per project, and credit_account_id is credited with the total. The credit account is the bank it was paid from, a liability for what's owed to the driver, or an owner's equity account. Requires journal:write. Errors: 422 invalid_expense_account, invalid_credit_account, nothing_to_record, or rate_not_confirmed when a trip's year doesn't have confirmed rates in SYNC yet. A retry with the same Idempotency-Key returns the entry already made.

Body

FieldTypeAbout
through requiredstring (date)
start_datestring (date)
expense_account_id requiredstring (uuid)
credit_account_id requiredstring (uuid)
memostring

Up to 1000 characters.

Answers

  • 201 object. The entry, how many trips it covers, and the total.
  • 4XX Problem. An error. `code` is stable and safe to branch on; `detail` says in plain English what
  • 5XX Problem. An error. `code` is stable and safe to branch on; `detail` says in plain English what