Evenbead docs

Mileage

18 operations. All areas

GET/v1/mileage/vehicles

The company's vehicles, their linked expense accounts and odometer readings

  • Operation listVehicles
  • Scope: read
  • Read
Parameters
  • include_retired query, boolean
Responses
  • 200 Vehicles (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
  • name string, required
  • description string
  • ownership "owned" | "leased"
  • in_service_date string, required Calendar date, YYYY-MM-DD.
Responses
  • 201 Added (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
  • id path, string, required
Request body
  • name string
  • description string | null
  • ownership "owned" | "leased"
  • in_service_date string Calendar date, YYYY-MM-DD.
  • retired_on string | null Calendar date, YYYY-MM-DD.
Responses
  • 200 Saved (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
  • id path, string, required
Request body
  • accounts array of string, required
Responses
  • 200 Saved (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
  • id path, string, required
Request body
  • tax_year integer, required
  • start_miles integer, required
  • end_miles integer | null
Responses
  • 200 Saved (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
  • from query, string
  • to query, string
  • vehicle_id query, string
  • kind query, "business" | "personal"
  • include_voided query, boolean
  • limit query, integer
Responses
  • 200 Trips (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_id string, required
  • trip_date string, required Calendar date, YYYY-MM-DD.
  • from_place string, required Where the trip started (free text)
  • to_place string, required Where it went (free text: a customer's site, a supplier)
  • miles number, required One-way miles, at most one decimal (12.5). A round trip doubles it.
  • round_trip boolean There and back (doubles the miles)
  • kind "business" | "personal" Default business
  • purpose string The business purpose (required for a business trip; Publication 463)
  • contact_id string | null
  • project_id string | null
  • dry_run boolean Check and preview; nothing is written
  • rationale string An agent's note to the reviewer
Responses
  • 200 Dry run (object)
  • 201 Logged (object)
  • 202 An 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
  • id path, string, required
Request body
  • reason string, required
Responses
  • 200 Voided (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
  • id path, string, required
Request body
  • vehicle_id string, required
  • trip_date string, required Calendar date, YYYY-MM-DD.
  • from_place string, required Where the trip started (free text)
  • to_place string, required Where it went (free text: a customer's site, a supplier)
  • miles number, required One-way miles, at most one decimal (12.5). A round trip doubles it.
  • round_trip boolean There and back (doubles the miles)
  • kind "business" | "personal" Default business
  • purpose string The business purpose (required for a business trip; Publication 463)
  • contact_id string | null
  • project_id string | null
  • reason string, required
Responses
  • 200 Corrected (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
  • 200 Recurring 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_id string, required
  • from_place string, required Where the trip started (free text)
  • to_place string, required Where it went (free text: a customer's site, a supplier)
  • miles number, required One-way miles, at most one decimal (12.5). A round trip doubles it.
  • round_trip boolean
  • purpose string, required
  • contact_id string | null
  • project_id string | null
  • frequency "weekly" | "monthly", required
  • weekdays array of integer
  • day_of_month integer
  • start_date string, required Calendar date, YYYY-MM-DD.
  • end_date string | null Calendar date, YYYY-MM-DD.
Responses
  • 201 Created (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
  • id path, string, required
Request body
  • end_date string, required Calendar date, YYYY-MM-DD.
Responses
  • 200 Ended (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
  • through string, required Calendar date, YYYY-MM-DD.
  • recurring_trip_id string
Responses
  • 200 Generated (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
  • year query, integer
Responses
  • 200 Deduction (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
  • year query, integer
  • vehicle_id query, string
  • format query, "json" | "csv" | "pdf" | "base64"
Responses
  • 200 The 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_voided query, boolean
Responses
  • 200 Reimbursements (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_id string, required
  • payee string, required
  • period_start string, required Calendar date, YYYY-MM-DD.
  • period_end string, required Calendar date, YYYY-MM-DD.
  • expense_account string, required Account code
  • pay_from_account string, required A bank account, or a payable to the payee
  • entry_date string Calendar date, YYYY-MM-DD.
  • dry_run boolean Check and preview; nothing is written
  • rationale string
Responses
  • 200 Dry run (object)
  • 201 Posted (object)
  • 202 An 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
  • id path, string, required
Request body
  • reason string, required
Responses
  • 200 Voided (object)
  • Errors 400, 401, 403, 404, 409, 422, 429, 500 (Error: error.type, message)