Skip to main content

Salary components

Salary components describe every earning or deduction line that appears on a payslip. Each organization starts with a default set (basic salary, housing, transportation, etc.), and you can manage the list through GraphQL to mirror your compensation model across systems.

Prerequisites

  • A Naqood API secret or OAuth-issued secret scoped to the target organization
  • The organization slug for every organization-scoped operation
  • A role that grants Payroll permissions (components)

Component fields

FieldTypeNotes
idID!Primary key needed when linking to employees or payslips.
name / descriptionString!Shown verbatim in the UI and generated PDFs.
typeSalaryComponentType!Either earning or deduction. Determines whether amounts increase or reduce net pay.
archivedBoolean!Archived components stay visible on historical documents but disappear from pickers.
isDeletableBooleantrue only when the component has no usage and can be removed permanently.
createdAt / updatedAtTimestamp!Audit timestamps.

List components

query SalaryComponents(
$slug: Slug!
$offset: Int
$limit: Int
$orderBy: OrderByInput
$filter: JSONObject
) {
organization(slug: $slug) {
salaryComponents(
offset: $offset
limit: $limit
orderBy: $orderBy
filter: $filter
) {
count
entries {
id
name
description
type
archived
isDeletable
}
}
}
}

Filters let you search by type, archived state, or name fragments using the same operators (equalTo, iLike, and/or, etc.) used elsewhere in the API.

Create or update components

mutation CreateSalaryComponent($input: CreateSalaryComponentInput!) {
createSalaryComponent(input: $input) {
id
name
type
}
}

CreateSalaryComponentInput fields:

FieldRequiredNotes
slugOrganization that owns the component.
nameDisplay name shown on payslips.
descriptionHelper text that describes how the component should be used.
typeearning or deduction.

To edit an entry, use updateSalaryComponent with the id plus whichever fields you want to modify. You can safely change the type as long as downstream integrations understand how historical documents were classified.

Archive or delete components

Archiving removes a component from creation flows while preserving historical usage:

mutation ArchiveSalaryComponent($salaryComponentID: ID!) {
archiveSalaryComponent(salaryComponentID: $salaryComponentID)
}

Use unarchiveSalaryComponent to restore an archived entry. Only delete a component when isDeletable returns true, indicating it has no linked employees or payslips. Attempting to delete a component in use will raise a validation error.