---
title: "Earning data model"
url: "https://docs.unified.to/hris/earning/model"
description: "The Earning data model object in Unified's Earning API: 17 fields, including created_at, updated_at and user_id, with types and enum values."
---
# Earning data model

 View field support, webhooks, and list parameters for each integration on the [Supported Integrations](https://docs.unified.to/hris/integrations.md) page. 

| Field        | Type               | Required | Description                                                                                                                                                          |
| ------------ | ------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id           | string             | No       |                                                                                                                                                                      |
| created\_at  | string (date-time) | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                             |
| updated\_at  | string (date-time) | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                                                             |
| user\_id     | string             | No       | employee ID (reference to HrisEmployee)                                                                                                                              |
| company\_id  | string             | No       | (reference to HrisCompany)                                                                                                                                           |
| paycode\_id  | string             | No       | the hris\_paycode (earning code) this earning is paid under                                                                                                          |
| amount       | number             | No       | money amount added to each pay run it applies to                                                                                                                     |
| currency     | string             | No       |                                                                                                                                                                      |
| hours        | number             | No       |                                                                                                                                                                      |
| rate\_amount | number             | No       | rate per hour/unit                                                                                                                                                   |
| frequency    | enum               | No       | ONE\_TIME for a single addition to the next unprocessed pay run, otherwise recurring Values: ONE\_TIME, DAY, QUARTER, YEAR, HOUR, MONTH, WEEK, BIWEEKLY, SEMIMONTHLY |
| start\_at    | string (date-time) | No       | 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) | No       | recurring: last effective date (empty = until stopped) (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                      |
| status       | enum               | No       | Values: PENDING, ACTIVE, PROCESSED, ENDED, CANCELLED, FAILED                                                                                                         |
| payroll\_id  | string             | No       | the hris\_payroll (pay run) a ONE\_TIME earning targets or was paid in                                                                                               |
| payslip\_id  | string             | No       | the hris\_payslip a ONE\_TIME earning was paid on                                                                                                                    |
| notes        | string             | No       |                                                                                                                                                                      |

## TypeScript

```typescript
export type HrisEarning = {
	id?: string;
	created_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	updated_at?: string-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-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-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;
	raw?: any;
} 
```

## Zod

```typescript
import { z } from 'zod';

export const ZodHrisEarning = z.object({
	id: z.string().optional(),
	created_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	updated_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	user_id: z.string().optional().describe("employee ID (reference to HrisEmployee)"),
	company_id: z.string().optional().describe("(reference to HrisCompany)"),
	paycode_id: z.string().optional().describe("the hris_paycode (earning code) this earning is paid under"),
	amount: z.number().optional().describe("money amount added to each pay run it applies to"),
	currency: z.string().optional(),
	hours: z.number().optional(),
	rate_amount: z.number().optional().describe("rate per hour/unit"),
	frequency: z.enum("ONE_TIME", "DAY", "QUARTER", "YEAR", "HOUR", "MONTH", "WEEK", "BIWEEKLY", "SEMIMONTHLY").optional().describe("ONE_TIME for a single addition to the next unprocessed pay run, otherwise recurring"),
	start_at: z.string-time().optional().describe("recurring: first effective date; ONE_TIME: requested pay date (empty = next unprocessed pay run) (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	end_at: z.string-time().optional().describe("recurring: last effective date (empty = until stopped) (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	status: z.enum("PENDING", "ACTIVE", "PROCESSED", "ENDED", "CANCELLED", "FAILED").optional(),
	payroll_id: z.string().optional().describe("the hris_payroll (pay run) a ONE_TIME earning targets or was paid in"),
	payslip_id: z.string().optional().describe("the hris_payslip a ONE_TIME earning was paid on"),
	notes: z.string().optional(),

});
```

## Python

```python
import dataclasses

@dataclasses.dataclass
class HrisEarningFrequency(str, Enum):
	ONE_TIME = 'ONE_TIME'
	DAY = 'DAY'
	QUARTER = 'QUARTER'
	YEAR = 'YEAR'
	HOUR = 'HOUR'
	MONTH = 'MONTH'
	WEEK = 'WEEK'
	BIWEEKLY = 'BIWEEKLY'
	SEMIMONTHLY = 'SEMIMONTHLY'

@dataclasses.dataclass
class HrisEarningStatus(str, Enum):
	PENDING = 'PENDING'
	ACTIVE = 'ACTIVE'
	PROCESSED = 'PROCESSED'
	ENDED = 'ENDED'
	CANCELLED = 'CANCELLED'
	FAILED = 'FAILED'

@dataclasses.dataclass
class HrisEarning:
	id: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	created_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	updated_at: Optional[str]
	"""employee ID (reference to HrisEmployee)"""
	user_id: Optional[str]
	"""(reference to HrisCompany)"""
	company_id: Optional[str]
	"""the hris_paycode (earning code) this earning is paid under"""
	paycode_id: Optional[str]
	"""money amount added to each pay run it applies to"""
	amount: Optional[int]
	currency: Optional[str]
	hours: Optional[int]
	"""rate per hour/unit"""
	rate_amount: Optional[int]
	"""ONE_TIME for a single addition to the next unprocessed pay run, otherwise recurring"""
	frequency: Optional[HrisEarningFrequency]
	"""recurring: first effective date; ONE_TIME: requested pay date (empty = next unprocessed pay run) (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	start_at: Optional[str]
	"""recurring: last effective date (empty = until stopped) (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	end_at: Optional[str]
	status: Optional[HrisEarningStatus]
	"""the hris_payroll (pay run) a ONE_TIME earning targets or was paid in"""
	payroll_id: Optional[str]
	"""the hris_payslip a ONE_TIME earning was paid on"""
	payslip_id: Optional[str]
	notes: Optional[str]

```
