> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nmbr.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an earning line item



## OpenAPI

````yaml /spec/openapi.json post /earning_line_items
openapi: 3.0.0
info:
  title: Nmbr API
  description: API to interact with Nmbr Payroll
  version: 1.0.0
servers:
  - url: https://sandbox.nmbr.co/services/payroll
security:
  - CompanyToken: []
tags:
  - name: Accounting Codes
  - name: Accounting Code Rules
  - name: Adjustments
  - name: Allowances
  - name: Allowance Line Items
  - name: Allowance Types
  - name: Async Tasks
  - name: Bank Accounts
  - name: Business Entities
  - name: Business Entity Verifications
  - name: Business Entity ROE Authorizations
  - name: Business Presets
  - name: Calculations
  - name: Companies
  - name: Contractors
  - name: Deductions
  - name: Deduction Line Items
  - name: Deduction Types
  - name: Earnings
  - name: Earning Line Items
  - name: Earning Types
  - name: Effective Tax Properties
  - name: Employees
  - name: Employee Benefits
  - name: Employee Benefit Line Items
  - name: Employee Benefit Types
  - name: Employer Benefits
  - name: Employer Benefit Line Items
  - name: Employer Benefit Types
  - name: Employer Statutory Withholding Line Items
  - name: Employer Statutory Withholding Types
  - name: Forms
  - name: Form Batches
  - name: Form Types
  - name: Holidays
  - name: Integrations
  - name: Journal Entries
  - name: Overtime Rates
  - name: Partners
  - name: Pay Rates
  - name: Pay Schedules
  - name: Pay Splits
  - name: Pay Stubs
  - name: Payments
  - name: Payrolls
  - name: Reimbursements
  - name: Reimbursement Line Items
  - name: Reimbursement Types
  - name: Remittance Accounts
  - name: Remittance Account Enrollments
  - name: Reports
  - name: Statutory Withholding Line Items
  - name: Statutory Withholding Types
  - name: Tags
  - name: Tag Groups
  - name: Tax Properties
  - name: Tax Property Templates
  - name: Tokens
  - name: Usage Records
  - name: Usage Summaries
  - name: Vacation Pay
  - name: Vacation Pay Settings
  - name: Webhooks
  - name: Work Assignments
paths:
  /earning_line_items:
    post:
      tags:
        - Earning Line Items
      summary: Create an earning line item
      operationId: earning-line-items-store
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    pay_stub_id:
                      type: string
                    business_preset_id:
                      type: string
                    earning_type:
                      type: string
                      description: >-
                        The type of earning for this line item.


                        Must be present when `business_preset_id` is either
                        empty or not set.
                      enum:
                        - bonus_discretionary
                        - bonus_non_discretionary
                        - bonus_non_taxable
                        - commission
                        - commission_periodic
                        - commission_self_employed
                        - death_benefit
                        - gift_cash
                        - gratuity
                        - in_lieu_wages
                        - income_replacement_indemnity_non_taxable
                        - income_replacement_indemnity_taxable
                        - invoice_payment
                        - invoice_sales_tax
                        - leave_bereavement
                        - leave_citizenship
                        - leave_domestic_and_sexual_violence
                        - leave_general
                        - leave_jury_duty
                        - leave_maternity
                        - leave_organ_donor
                        - leave_parental
                        - leave_paternity
                        - leave_personal
                        - leave_sick
                        - leave_voting
                        - leave_wedding
                        - overtime
                        - parental_top_up_insurable
                        - parental_top_up_non_insurable
                        - pension
                        - retiring_allowance
                        - retiring_allowance_eligible
                        - retroactive_pay
                        - retroactive_pay_increase
                        - salary
                        - salary_continuance
                        - severance_pay
                        - statutory_holiday_pay
                        - supplemental_unemployment
                        - time_off_in_lieu
                        - time_off_in_lieu_overtime
                        - vacation_accrual_adjustment
                        - vacation_pay
                        - vacation_pay_employee_terminated
                        - vacation_pay_no_time_taken
                        - vacation_pay_time_taken
                        - wage
                    pay_rate_id:
                      type: string
                      description: >-
                        On line items of type `wage` and `overtime` you may pass
                        a `pay_rate_id` and `hours` to automatically calculate
                        the `amount`.
                    overtime_rate_id:
                      type: string
                      description: >-
                        On line items of type `overtime` you may pass a
                        `overtime_rate_id` and `hours` to automatically
                        calculate the `amount`.
                    custom_amount:
                      type: number
                      description: >-
                        An override for `managed_amount`. When set, `amount`
                        reflects this value instead of `managed_amount`.
                      format: decimal
                      maximum: 999999
                    custom_hours:
                      type: number
                      description: >-
                        An override for `managed_hours`. When set, `hours`
                        reflects this value instead of `managed_hours`. Can be
                        used to prorate the dollar amount on salary line items.
                      format: decimal
                      maximum: 9999
                    accrued_vacation_pay:
                      type: number
                      description: >-
                        The vacation pay accrued on this line item, calculated
                        based on the Work Assignment's Vacation Pay Settings.
                      format: decimal
                      minimum: -99999
                      maximum: 99999
                    title:
                      type: string
                      nullable: true
                      maxLength: 255
                    title_translations:
                      type: object
                      description: Optional translations for the `title` property.
                      allOf:
                        - $ref: '#/components/schemas/Translations'
                      nullable: true
                    component_settings:
                      type: object
                      properties:
                        attributes_locked:
                          type: boolean
                    expense_accounting_code_id:
                      type: string
                    custom_expense_accounting_code_id:
                      type: string
                    liability_accounting_code_id:
                      type: string
                    custom_liability_accounting_code_id:
                      type: string
                    custom_earned_on:
                      type: string
                      format: date
                    external_ref:
                      type: string
                      maxLength: 255
                    custom_tag_assignment:
                      type: object
                      properties:
                        unit:
                          type: string
                          enum:
                            - amount
                            - hours
                            - percentage
                        is_component_locked:
                          type: boolean
                        tag_allocations:
                          type: array
                          items:
                            type: object
                            properties:
                              tags:
                                type: array
                                items:
                                  type: string
                              value:
                                type: number
                                format: decimal
                                minimum: 0
                - type: object
                  required:
                    - pay_stub_id
            example:
              pay_stub_id: <id>
              earning_type: wage
              custom_amount: '3000'
              custom_hours: '0'
              accrued_vacation_pay: '0'
              title: Earning
              custom_tag_assignment:
                unit: percentage
                tag_allocations:
                  - tags:
                      - <id>
                    value: 100
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The unique identifier of the object in Nmbr.
                    readOnly: true
                  object:
                    type: string
                    description: The type of the object in Nmbr (`"earning_line_item"`).
                    readOnly: true
                  data:
                    $ref: '#/components/schemas/EarningLineItem'
              example:
                id: <id>
                object: earning_line_item
                data:
                  pay_stub:
                    id: <id>
                    object: pay_stub
                    links:
                      self: /pay_stubs/<id>
                  amount: 3000
                  custom_amount: 3000
                  managed_amount: null
                  is_managed: false
                  line_item_type: earning
                  earning_type:
                    id: <id>
                    object: earning_type
                    data:
                      type: wage
                      label: Wage
                      supported_payroll_types:
                        regular: true
                        historical: true
                        off_cycle: true
                    links:
                      self: /earning_types/wage
                  hours: 0
                  managed_hours: null
                  custom_hours: 0
                  accrued_vacation_pay: 0
                  recurrence: null
                  pay_rate: null
                  overtime_rate: null
                  title: Earning
                  title_translations: null
                  title_translated: Earning
                  expense_accounting_code: null
                  managed_expense_accounting_code: null
                  custom_expense_accounting_code: null
                  liability_accounting_code: null
                  managed_liability_accounting_code: null
                  custom_liability_accounting_code: null
                  business_preset: null
                  source_adjustment: null
                  component_settings:
                    attributes_locked: false
                  earned_on: null
                  managed_earned_on: null
                  custom_earned_on: null
                  external_ref: null
                  created_at: '2026-01-01T00:00:00.000000Z'
                  updated_at: '2026-01-01T00:00:00.000000Z'
                links:
                  self: /earning_line_items/<id>
components:
  schemas:
    Translations:
      type: object
      nullable: true
      properties:
        en:
          type: string
          maxLength: 255
        fr:
          type: string
          maxLength: 255
    EarningLineItem:
      type: object
      title: Earning Line Item
      properties:
        pay_stub:
          type: object
          properties:
            id:
              type: string
              description: The unique identifier of the object in Nmbr.
              readOnly: true
            object:
              type: string
              description: The type of the object in Nmbr (`"pay_stub"`).
              readOnly: true
        amount:
          type: number
          description: >-
            The effective amount for this line item. Returns `custom_amount` if
            set, otherwise `managed_amount`. Read-only.
          nullable: true
          format: decimal
        custom_amount:
          type: number
          description: >-
            An override for `managed_amount`. When set, `amount` reflects this
            value instead of `managed_amount`.
          nullable: true
          format: decimal
        managed_amount:
          type: number
          description: >-
            The amount calculated by the system or set by the linked Earning or
            Pay Rate. Read-only; set `custom_amount` to override.
          format: decimal
        is_managed:
          type: boolean
          description: >-
            Whether this line item was generated by an Earning or Pay Rate
            recurrence and calculated automatically. When `true`, only
            `custom_amount` and `custom_hours` can be modified and the line item
            cannot be deleted.
        line_item_type:
          type: string
          nullable: true
        earning_type:
          type: object
          description: The type of earning for this line item.
          properties:
            id:
              type: string
              description: The unique identifier of the object in Nmbr.
              readOnly: true
            object:
              type: string
              description: The type of the object in Nmbr (`"earning_type"`).
              readOnly: true
            data:
              $ref: '#/components/schemas/EarningType'
        hours:
          type: number
          description: >-
            The effective hours for this line item. Returns `custom_hours` if
            set, otherwise `managed_hours`. `null` if neither is set. Read-only.
          nullable: true
          format: decimal
        managed_hours:
          type: number
          description: >-
            The default hours from the linked Pay Rate. Read-only; set
            `custom_hours` to override.
          nullable: true
          format: decimal
        custom_hours:
          type: number
          description: >-
            An override for `managed_hours`. When set, `hours` reflects this
            value instead of `managed_hours`. Can be used to prorate the dollar
            amount on salary line items.
          nullable: true
          format: decimal
        accrued_vacation_pay:
          type: number
          description: >-
            The vacation pay accrued on this line item, calculated based on the
            Work Assignment's Vacation Pay Settings.
          nullable: true
          format: decimal
        recurrence: {}
        pay_rate: {}
        overtime_rate: {}
        title:
          type: string
          nullable: true
          maxLength: 255
        title_translations:
          type: object
          description: Optional translations for the `title` property.
          allOf:
            - $ref: '#/components/schemas/Translations'
          nullable: true
        title_translated:
          type: string
          description: >-
            The translation of the `title` property for the request locale.
            Computed using the values in `title` and `title_translations` and
            the value of the request's `Accept-Language` header.
          readOnly: true
        expense_accounting_code:
          description: >-
            The effective expense accounting code. Returns the user-set value if
            present, otherwise the system-derived value. Writes to this field
            set the user override.
        managed_expense_accounting_code:
          description: >-
            The expense accounting code derived by the system from accounting
            code rules and presets. Read-only.
        custom_expense_accounting_code:
          description: >-
            User-set expense accounting code that overrides the system-derived
            value.
        liability_accounting_code:
          description: >-
            The effective liability accounting code. Returns the user-set value
            if present, otherwise the system-derived value. Writes to this field
            set the user override.
        managed_liability_accounting_code:
          description: >-
            The liability accounting code derived by the system from accounting
            code rules and presets. Read-only.
        custom_liability_accounting_code:
          description: >-
            User-set liability accounting code that overrides the system-derived
            value.
        business_preset: {}
        source_adjustment: {}
        component_settings:
          type: object
          description: Settings specific to the Nmbr component.
          nullable: true
          properties:
            attributes_locked:
              type: boolean
              description: >-
                Whether the line item is locked and cannot be edited in the
                component.
        earned_on:
          description: >-
            The effective earned-on date for this line item. Returns
            `custom_earned_on` if set, otherwise `managed_earned_on`. Read-only.
        managed_earned_on:
          type: string
          description: >-
            The earned-on date set by the system. Read-only; set
            `custom_earned_on` to override.
          nullable: true
          format: date
        custom_earned_on:
          type: string
          description: >-
            An override for `managed_earned_on`. When set, `earned_on` reflects
            this value instead of `managed_earned_on`. Must fall within the
            payroll's pay period.
          nullable: true
          format: date
        external_ref:
          type: string
          description: >-
            A reference to the object in an external system, e.g. the primary
            key of the object in your application's database. Nmbr doesn't use,
            validate, parse, or require this value to be unique - it simply
            stores it for your reference.
          nullable: true
          maxLength: 255
        created_at:
          type: string
          description: The date and time the object was created in Nmbr.
          readOnly: true
          format: dateTime
        updated_at:
          type: string
          description: The date and time the object was last updated in Nmbr.
          readOnly: true
          format: dateTime
    EarningType:
      type: object
      title: Earning Type
      properties:
        type:
          type: string
          description: The string identifier for this earning type.
          nullable: true
        label:
          type: string
          description: The human-readable display name for this earning type.
          nullable: true
        supported_payroll_types:
          type: object
          description: >-
            A map of Payroll types to whether this earning type is available on
            that Payroll type.
          nullable: true
          properties:
            regular:
              type: boolean
            historical:
              type: boolean
            off_cycle:
              type: boolean
        features:
          type: array
          items:
            $ref: '#/components/schemas/LineItemTypeFeature'
        form_mappings:
          type: array
          items:
            $ref: '#/components/schemas/LineItemFormMapping'
    LineItemTypeFeature:
      type: object
      description: >-
        How this line item type affects a single payroll calculation, such as
        income tax or CPP. See [Line item type
        features](https://docs.nmbr.co/guides/payroll-fundamentals/line-item-type-features)
        for further details.
      properties:
        type:
          type: string
          description: The payroll calculation this entry describes.
          enum:
            - eht
            - income_tax
            - insurable
            - pensionable
            - vacationable
            - wcb
        label:
          type: string
          description: Human-readable name for the payroll calculation.
        definitions:
          type: array
          description: >-
            How this type affects the calculation, broken down by jurisdiction.
            Jurisdictions where it does not apply are omitted.
          items:
            type: object
            properties:
              jurisdiction:
                type: string
                description: >-
                  The jurisdiction this applies to (e.g. `ca_federal`, `ca_on`,
                  `ca_qc`).
              effects:
                type: array
                description: >-
                  How this type affects the payroll calculation in this
                  jurisdiction.
                items:
                  type: string
                  enum:
                    - accrues_vacation_pay
                    - reduces_base
                    - tax_credit
                    - withholding
              help_text:
                type: string
                description: >-
                  Plain-language explanation of how this type affects the
                  calculation in this jurisdiction.
                nullable: true
              program_label:
                type: string
                description: >-
                  The program that applies in this jurisdiction, for
                  calculations that use different programs by jurisdiction (e.g.
                  CPP federally, QPP in Quebec; EI federally, QPIP in Quebec).
                nullable: true
    LineItemFormMapping:
      type: object
      description: The year-end tax form boxes this line item type maps to.
      properties:
        form:
          type: string
          description: The form code (e.g. `t4`).
        form_label:
          type: string
          description: Human-readable form name.
        mapping:
          type: array
          description: The boxes on the form this type contributes to.
          items:
            type: array
            items:
              type: object
              properties:
                name:
                  type: string
                  description: The box or line identifier on the form.
                help_text:
                  type: string
                  description: Plain-language explanation of the box, when available.
                  nullable: true
  securitySchemes:
    CompanyToken:
      type: http
      scheme: bearer

````