Absence Transactions

Absence transactions track credits and debits to an employee's absence balance (e.g. vacation days). Transactions can be created automatically by absence rules or manually by administrators.

The Absence Transaction Object

  • Name
    id
    Type
    string (UUID)
    Description

    Unique identifier for the transaction.

  • Name
    employee_id
    Type
    string (UUID)
    Description

    The employee this transaction belongs to.

  • Name
    label
    Type
    string
    Description

    A description of the transaction.

  • Name
    missing_type
    Type
    string
    Description

    The absence type this transaction applies to (e.g. holiday).

  • Name
    date
    Type
    string (YYYY-MM-DD)
    Description

    The effective date of the transaction.

  • Name
    amount
    Type
    decimal
    Description

    The number of days credited. Must be greater than or equal to 0.

  • Name
    source
    Type
    string
    Description

    How the transaction was created: manual, absence, one-time-rule, or repeating-rule. Read-only.


GET/api/v2/timestamps/absence-transactions/

List all Transactions

Retrieve a paginated list of absence transactions.

Query Parameters

  • Name
    employee_ids
    Type
    string
    Description

    Filter by employee IDs, pipe-separated.

  • Name
    daterange
    Type
    string
    Description

    Filter by date range: YYYY-MM-DD|YYYY-MM-DD.

  • Name
    sources
    Type
    string
    Description

    Filter by source: absence, manual, one-time-rule, or repeating-rule.

  • Name
    quote_mode
    Type
    string
    Description

    Filter mode: all (default), quota, or no-quota.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/absence-transactions/?employee_ids=a1b2c3d4-e5f6-7890-abcd-ef1234567890&daterange=2024-01-01|2024-12-31" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Response

{
  "count": 3,
  "results": [
    {
      "id": "t1t1t1t1-t2t2-t3t3-t4t4-t5t5t5t5t5t5",
      "employee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "label": "Annual vacation entitlement 2024",
      "missing_type": "holiday",
      "date": "2024-01-01",
      "amount": 30.0,
      "source": "repeating-rule"
    },
    {
      "id": "t2t2t2t2-t3t3-t4t4-t5t5-t6t6t6t6t6t6",
      "employee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "label": "Summer vacation",
      "missing_type": "holiday",
      "date": "2024-06-10",
      "amount": 5.0,
      "source": "absence"
    }
  ]
}

POST/api/v2/timestamps/absence-transactions/

Create a Transaction

Manually create an absence transaction to credit days to an employee's balance.

  • Name
    employee_id
    Type
    string (UUID)
    Description

    The employee to credit. Required.

  • Name
    label
    Type
    string
    Description

    Description of the transaction.

  • Name
    missing_type
    Type
    string
    Description

    The absence type (e.g. holiday).

  • Name
    date
    Type
    string (YYYY-MM-DD)
    Description

    Effective date.

  • Name
    amount
    Type
    decimal
    Description

    Number of days to credit. Must be >= 0.

Request

curl -X POST "https://api.zeitstrom.com/api/v2/timestamps/absence-transactions/" \
  -H "Authorization: Token <YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "employee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "label": "Carryover from 2023",
    "missing_type": "holiday",
    "date": "2024-01-01",
    "amount": 5.0
  }'

PUT/api/v2/timestamps/absence-transactions/:id/

Update a Transaction

Update an existing absence transaction.

Request

curl -X PUT "https://api.zeitstrom.com/api/v2/timestamps/absence-transactions/t1t1t1t1-t2t2-t3t3-t4t4-t5t5t5t5t5t5/" \
  -H "Authorization: Token <YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "employee_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "label": "Updated carryover from 2023",
    "missing_type": "holiday",
    "date": "2024-01-01",
    "amount": 7.0
  }'

DELETE/api/v2/timestamps/absence-transactions/:id/

Delete a Transaction

Delete a manually created absence transaction.

Request

curl -X DELETE "https://api.zeitstrom.com/api/v2/timestamps/absence-transactions/t1t1t1t1-t2t2-t3t3-t4t4-t5t5t5t5t5t5/" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

GET/api/v2/timestamps/absence-transactions/aggregate/

Aggregate Balances

Get aggregated absence balances per employee. Optionally filter to see only the remaining balance.

Query Parameters

  • Name
    employee_ids
    Type
    string
    Description

    Filter by employee IDs, pipe-separated.

  • Name
    balance
    Type
    boolean
    Description

    Set to true to return net balance, false for gross totals.

Request

curl -X GET "https://api.zeitstrom.com/api/v2/timestamps/absence-transactions/aggregate/?employee_ids=a1b2c3d4-e5f6-7890-abcd-ef1234567890&balance=true" \
  -H "Authorization: Token <YOUR_API_TOKEN>"

Was this page helpful?