added

New Endpoints for Managing Deductions

What’s New?

A new Deductions module has been added to the Alvys Public API. These endpoints allow integrations to create, search, retrieve, and delete deduction records associated with drivers or trucks. A deduction represents an asset-specific financial adjustment (e.g., drug test fees, fuel advances, or reimbursements) and is always linked to a specific DriverId or TruckId, but never both.

At this stage, only one-time (Once) deductions are supported.


What Changed?

New endpoints:

MethodEndpointDescription
GET/api/p/v{version}/deductions/{id}Retrieves a deduction by its unique ID.
POST/api/p/v{version}/deductions/searchSearches deductions by date, driver, truck, or owner operator.
POST/api/p/v{version}/deductions/onceCreates a one-time deduction for a driver or a truck.
DELETE/api/p/v{version}/deductions/{id}Deletes a specific deduction by its unique ID.

Validation rules:

  • A deduction must include either DriverId or TruckId — one of them is required.
  • OwnerOperatorId is optional and may be used only to override the current owner of the asset. It is never the primary deduction subject.
  • If DriverId is provided → the deduction appears in that driver’s deduction list.
  • If TruckId is provided → the deduction appears in that truck’s deduction list.
  • For creating a deduction, the amount must be negative and less than - 1.00.
  • Only "Once" frequency is supported.
  • Requires a valid Bearer token with the appropriate scope (deduction:read, deduction:create, or deduction:delete).

Why?

This release introduces a consistent and secure way to manage one-time deductions through the Public API. It enables automated synchronization of deduction data across financial and payroll systems while maintaining full ownership and asset context within Alvys.