Mileage
18 operations. All areas
- GET /v1/mileage/vehicles
- POST /v1/mileage/vehicles
- POST /v1/mileage/vehicles/{id}
- POST /v1/mileage/vehicles/{id}/accounts
- POST /v1/mileage/vehicles/{id}/odometer
- GET /v1/mileage/trips
- POST /v1/mileage/trips
- POST /v1/mileage/trips/{id}/void
- POST /v1/mileage/trips/{id}/correct
- GET /v1/mileage/recurring
- POST /v1/mileage/recurring
- POST /v1/mileage/recurring/{id}/end
- POST /v1/mileage/recurring/generate
- GET /v1/mileage/deduction
- GET /v1/mileage/log
- GET /v1/mileage/reimbursements
- POST /v1/mileage/reimbursements
- POST /v1/mileage/reimbursements/{id}/void
GET/v1/mileage/vehicles
The company's vehicles, their linked expense accounts and odometer readings
- Operation
listVehicles - Scope: read
- Read
- Parameters
include_retiredquery, boolean
- Responses
200Vehicles (object)- Errors
400,401,403,429,500(Error:error.type,message)
POST/v1/mileage/vehicles
Add a vehicle (people only): name, make and model, owned or leased, the date it was placed in service. Audited.
- Operation
createVehicle - Scope: propose
- Write: needs Idempotency-Key (or dry_run)
- Request body
namestring, requireddescriptionstringownership"owned" | "leased"in_service_datestring, required Calendar date, YYYY-MM-DD.
- Responses
201Added (object)- Errors
400,401,403,409,422,429,500(Error:error.type,message)
POST/v1/mileage/vehicles/{id}
Change a vehicle's name, description, ownership, in-service date, or retire it (retired_on). People only; audited.
- Operation
updateVehicle - Scope: propose
- Write: sets a value, no Idempotency-Key needed
- Parameters
idpath, string, required
- Request body
namestringdescriptionstring | nullownership"owned" | "leased"in_service_datestring Calendar date, YYYY-MM-DD.retired_onstring | null Calendar date, YYYY-MM-DD.
- Responses
200Saved (object)- Errors
400,401,403,404,409,422,429,500(Error:error.type,message)
POST/v1/mileage/vehicles/{id}/accounts
The expense accounts that carry this vehicle's costs (fuel, repairs, insurance...), for the actual-expense figure. Replaces the list; an account belongs to one vehicle. People only; audited.
- Operation
setVehicleAccounts - Scope: propose
- Write: sets a value, no Idempotency-Key needed
- Parameters
idpath, string, required
- Request body
accountsarray of string, required
- Responses
200Saved (object)- Errors
400,401,403,404,409,422,429,500(Error:error.type,message)
POST/v1/mileage/vehicles/{id}/odometer
The odometer at the start and end of a tax year (whole miles): the total the business-use percentage divides by. People only; audited.
- Operation
setVehicleOdometer - Scope: propose
- Write: sets a value, no Idempotency-Key needed
- Parameters
idpath, string, required
- Request body
tax_yearinteger, requiredstart_milesinteger, requiredend_milesinteger | null
- Responses
200Saved (object)- Errors
400,401,403,404,409,422,429,500(Error:error.type,message)
GET/v1/mileage/trips
Trips, newest first (voided ones with include_voided)
- Operation
listTrips - Scope: read
- Read
- Parameters
fromquery, stringtoquery, stringvehicle_idquery, stringkindquery, "business" | "personal"include_voidedquery, booleanlimitquery, integer
- Responses
200Trips (object)- Errors
400,401,403,429,500(Error:error.type,message)
POST/v1/mileage/trips
Log a trip: date, vehicle, from and to, one-way miles, round trip, business or personal, purpose, customer and project. A person's trip is recorded; an agent's becomes a proposal a person approves (from a calendar or receipts, say). dry_run checks it. Audited.
- Operation
logTrip - Scope: propose
- Write: needs Idempotency-Key (or dry_run)
- Request body
vehicle_idstring, requiredtrip_datestring, required Calendar date, YYYY-MM-DD.from_placestring, required Where the trip started (free text)to_placestring, required Where it went (free text: a customer's site, a supplier)milesnumber, required One-way miles, at most one decimal (12.5). A round trip doubles it.round_tripboolean There and back (doubles the miles)kind"business" | "personal" Default businesspurposestring The business purpose (required for a business trip; Publication 463)contact_idstring | nullproject_idstring | nulldry_runboolean Check and preview; nothing is writtenrationalestring An agent's note to the reviewer
- Responses
200Dry run (object)201Logged (object)202An agent's request: a proposal a person approves (object)- Errors
400,401,403,409,422,429,500(Error:error.type,message)
POST/v1/mileage/trips/{id}/void
Void a trip with a reason (trips are never edited or deleted). People only; audited.
- Operation
voidTrip - Scope: propose
- Write: needs Idempotency-Key (or dry_run)
- Parameters
idpath, string, required
- Request body
reasonstring, required
- Responses
200Voided (object)- Errors
400,401,403,404,409,422,429,500(Error:error.type,message)
POST/v1/mileage/trips/{id}/correct
Correct a trip: voids it with the reason and records the corrected trip, which names the one it replaces. People only; audited.
- Operation
correctTrip - Scope: propose
- Write: needs Idempotency-Key (or dry_run)
- Parameters
idpath, string, required
- Request body
vehicle_idstring, requiredtrip_datestring, required Calendar date, YYYY-MM-DD.from_placestring, required Where the trip started (free text)to_placestring, required Where it went (free text: a customer's site, a supplier)milesnumber, required One-way miles, at most one decimal (12.5). A round trip doubles it.round_tripboolean There and back (doubles the miles)kind"business" | "personal" Default businesspurposestring The business purpose (required for a business trip; Publication 463)contact_idstring | nullproject_idstring | nullreasonstring, required
- Responses
200Corrected (object)- Errors
400,401,403,404,409,422,429,500(Error:error.type,message)
GET/v1/mileage/recurring
Recurring trips and how many trips each has generated
- Operation
listRecurringTrips - Scope: read
- Read
- Responses
200Recurring trips (object)- Errors
400,401,403,429,500(Error:error.type,message)
POST/v1/mileage/recurring
A business trip that repeats: weekly on weekdays (1 Monday … 7 Sunday) or monthly on a day (1-28), from a start date (to an end date). People only; audited.
- Operation
createRecurringTrip - Scope: propose
- Write: needs Idempotency-Key (or dry_run)
- Request body
vehicle_idstring, requiredfrom_placestring, required Where the trip started (free text)to_placestring, required Where it went (free text: a customer's site, a supplier)milesnumber, required One-way miles, at most one decimal (12.5). A round trip doubles it.round_tripbooleanpurposestring, requiredcontact_idstring | nullproject_idstring | nullfrequency"weekly" | "monthly", requiredweekdaysarray of integerday_of_monthintegerstart_datestring, required Calendar date, YYYY-MM-DD.end_datestring | null Calendar date, YYYY-MM-DD.
- Responses
201Created (object)- Errors
400,401,403,409,422,429,500(Error:error.type,message)
POST/v1/mileage/recurring/{id}/end
End a recurring trip on a date (its pattern never changes: end it and make a new one). People only; audited.
- Operation
endRecurringTrip - Scope: propose
- Write: sets a value, no Idempotency-Key needed
- Parameters
idpath, string, required
- Request body
end_datestring, required Calendar date, YYYY-MM-DD.
- Responses
200Ended (object)- Errors
400,401,403,404,409,422,429,500(Error:error.type,message)
POST/v1/mileage/recurring/generate
Log every recurring trip's occurrences through a date (each date once; one that was voided is not logged again). People only; audited.
- Operation
generateRecurringTrips - Scope: propose
- Write: sets a value, no Idempotency-Key needed
- Request body
throughstring, required Calendar date, YYYY-MM-DD.recurring_trip_idstring
- Responses
200Generated (object)- Errors
400,401,403,409,422,429,500(Error:error.type,message)
GET/v1/mileage/deduction
Per vehicle and tax year: business and total miles, the business-use percentage, the standard mileage deduction (each trip at the IRS rate on its date) and actual expenses × business use, which is higher, the IRS rules on switching methods (Publication 463) and the rates with their sources. A tax figure: nothing posts.
- Operation
getMileageDeduction - Scope: read
- Read
- Parameters
yearquery, integer
- Responses
200Deduction (object)- Errors
400,401,403,429,500(Error:error.type,message)
GET/v1/mileage/log
The year's mileage log with the elements Publication 463 asks for (date, destination, business purpose, miles of each business use, total miles for the year, in-service date): JSON, CSV (format=csv) or PDF (format=pdf; base64 for MCP)
- Operation
getMileageLog - Scope: read
- Read
- Parameters
yearquery, integervehicle_idquery, stringformatquery, "json" | "csv" | "pdf" | "base64"
- Responses
200The log (object)- Errors
400,401,403,429,500(Error:error.type,message)
GET/v1/mileage/reimbursements
Accountable-plan mileage reimbursements and the entries that posted them
- Operation
listMileageReimbursements - Scope: read
- Read
- Parameters
include_voidedquery, boolean
- Responses
200Reimbursements (object)- Errors
400,401,403,429,500(Error:error.type,message)
POST/v1/mileage/reimbursements
Reimburse an owner or employee for a vehicle's business miles in a date range at the IRS rate (an accountable plan): one entry, expense account / the account that pays, through the normal path (a person posts; an agent's becomes a proposal). dry_run shows the miles, the rates and the entry. Optional: the standard-mileage deduction never posts on its own.
- Operation
reimburseMileage - Scope: propose
- Write: needs Idempotency-Key (or dry_run)
- Request body
vehicle_idstring, requiredpayeestring, requiredperiod_startstring, required Calendar date, YYYY-MM-DD.period_endstring, required Calendar date, YYYY-MM-DD.expense_accountstring, required Account codepay_from_accountstring, required A bank account, or a payable to the payeeentry_datestring Calendar date, YYYY-MM-DD.dry_runboolean Check and preview; nothing is writtenrationalestring
- Responses
200Dry run (object)201Posted (object)202An agent's request: a proposal a person approves (object)- Errors
400,401,403,409,422,429,500(Error:error.type,message)
POST/v1/mileage/reimbursements/{id}/void
Void a reimbursement record with a reason, so its dates can be reimbursed again (reverse its entry too). People only; audited.
- Operation
voidMileageReimbursement - Scope: approve
- Write: needs Idempotency-Key (or dry_run)
- Parameters
idpath, string, required
- Request body
reasonstring, required
- Responses
200Voided (object)- Errors
400,401,403,404,409,422,429,500(Error:error.type,message)