---
title: "Update an earning"
method: PUT
path: "/hris/{connection_id}/earning/{id}"
tags: ["hris", "earning"]
---

# Update an earning

`PUT /hris/{connection_id}/earning/{id}`

## Request

- Base URL: `http://api.unified.to`
- URL: `http://api.unified.to/hris/{connection_id}/earning/{id}`
- Auth: API key in header `authorization`

## Path parameters

- `connection_id` string, required
- `id` string, required

## Query parameters

- `fields` string[]
- `raw` string

## Request body

- HrisEarning
  - `id` string
  - `created_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `updated_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `user_id` string: employee ID (reference to HrisEmployee)
  - `company_id` string: (reference to HrisCompany)
  - `paycode_id` string: the hris_paycode (earning code) this earning is paid under
  - `amount` number: money amount added to each pay run it applies to
  - `currency` string
  - `hours` number
  - `rate_amount` number: rate per hour/unit
  - `frequency` 'ONE_TIME' | 'DAY' | 'QUARTER' | 'YEAR' | 'HOUR' | 'MONTH' | 'WEEK' | 'BIWEEKLY' | 'SEMIMONTHLY': ONE_TIME for a single addition to the next unprocessed pay run, otherwise recurring
  - `start_at` string, date-time: recurring: first effective date; ONE_TIME: requested pay date (empty = next unprocessed pay run) (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `end_at` string, date-time: recurring: last effective date (empty = until stopped) (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `status` 'PENDING' | 'ACTIVE' | 'PROCESSED' | 'ENDED' | 'CANCELLED' | 'FAILED'
  - `payroll_id` string: the hris_payroll (pay run) a ONE_TIME earning targets or was paid in
  - `payslip_id` string: the hris_payslip a ONE_TIME earning was paid on
  - `notes` string
  - `metadata` HrisMetadata[]
    - `id` string
    - `value` unknown
    - `namespace` string
    - `format` 'TEXT' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'FILE' | 'TEXTAREA' | 'SINGLE_SELECT' | 'MULTIPLE_SELECT' | 'MEASUREMENT' | 'PRICE' | 'YES_NO' | 'CURRENCY' | 'URL'
    - `extra_data` unknown
    - `slug` string
  - `raw` unknown

## Response `200`

Successful

- HrisEarning
  - `id` string
  - `created_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `updated_at` string, date-time: (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `user_id` string: employee ID (reference to HrisEmployee)
  - `company_id` string: (reference to HrisCompany)
  - `paycode_id` string: the hris_paycode (earning code) this earning is paid under
  - `amount` number: money amount added to each pay run it applies to
  - `currency` string
  - `hours` number
  - `rate_amount` number: rate per hour/unit
  - `frequency` 'ONE_TIME' | 'DAY' | 'QUARTER' | 'YEAR' | 'HOUR' | 'MONTH' | 'WEEK' | 'BIWEEKLY' | 'SEMIMONTHLY': ONE_TIME for a single addition to the next unprocessed pay run, otherwise recurring
  - `start_at` string, date-time: recurring: first effective date; ONE_TIME: requested pay date (empty = next unprocessed pay run) (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `end_at` string, date-time: recurring: last effective date (empty = until stopped) (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
  - `status` 'PENDING' | 'ACTIVE' | 'PROCESSED' | 'ENDED' | 'CANCELLED' | 'FAILED'
  - `payroll_id` string: the hris_payroll (pay run) a ONE_TIME earning targets or was paid in
  - `payslip_id` string: the hris_payslip a ONE_TIME earning was paid on
  - `notes` string
  - `metadata` HrisMetadata[]
    - `id` string
    - `value` unknown
    - `namespace` string
    - `format` 'TEXT' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'FILE' | 'TEXTAREA' | 'SINGLE_SELECT' | 'MULTIPLE_SELECT' | 'MEASUREMENT' | 'PRICE' | 'YES_NO' | 'CURRENCY' | 'URL'
    - `extra_data` unknown
    - `slug` string
  - `raw` unknown

---

[API](https://skmtc.dev/unified/apis/unified-to-api-2.md) · [All operations](https://skmtc.dev/unified/apis/unified-to-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/unified/apis/unified-to-api-2/revisions/7a38bdd7f089?raw)
