Skip to main content
POST
Create one-time deduction
This endpoint creates a new deduction record for a driver or a truck. Deductions are asset-specific financial adjustments and can be associated with either a driver or a truck, but not both simultaneously. The deduction itself is always tied to a specific asset (Driver or Truck) and can optionally reference an owner operator for ownership context.

Key Rules:

  • A deduction must include either DriverId or TruckId — one of them is mandatory.
  • OwnerOperatorId is optional and used only to override the current owner of the asset. It is never the primary subject of the deduction.
  • The deduction is always created for a specific DriverId or TruckId, not directly for an owner operator.
  • If DriverId is provided → the deduction appears in that driver’s deductions table.
  • If TruckId is provided → the deduction appears in that truck’s deductions table.
  • If OwnerOperatorId is provided → it overrides the current owner of the asset to that specific owner operator (only within this deduction record). If omitted → the system automatically links the deduction to the current owner operator, if one exists.
  • If the truck or driver has no owner operator → the deduction is created without one.

Permissions Required

Only users or client credentials with Create access to the Deductions resource can perform creation. If the API client lacks sufficient privileges, a 403 Forbidden response will be returned.

Request Body Parameters

Example CURL Request

Response Body Parameters


Example Response

Versioning

The version parameter in the URL path specifies which version of the API you are using. Including the version number ensures that your integration remains stable as the API evolves. For more details, refer to the Versioning page.

Rate Limits

All endpoints are subject to standard rate limits to ensure consistent API performance. For details, see the Rate Limits section.

Authorizations

Authorization
string
header
required

OAuth 2.0 client-credentials access token. Obtain one from https://auth.alvys.com/oauth/token (grant_type=client_credentials, audience=https://api.alvys.com/public/), then paste it here. The playground sends it as Authorization: Bearer <token>.

Path Parameters

version
string
default:1.0
required

API version (e.g., 1.0)

Example:

"1.0"

Body

Date
string<date-time>
required
Amount
number<double>
required
Category
string
required
Description
string
required
DriverId
string | null
TruckId
string | null
OwnerOperatorId
string | null

Response

Created

Id
string
required
Type
string
required
GroupId
string
required
Description
string
required
Category
string
required
Amount
object
required
Date
string<date-time>
required
IsPaid
boolean
required
CreatedAt
string<date-time>
required
DriverId
string | null
TruckId
string | null
OwnerOperatorId
string | null
CreatedBy
string | null