import { APIResource } from "../core/resource.mjs"; import { PageCursorURL, PagePromise } from "../core/pagination.mjs"; import { RequestOptions } from "../internal/request-options.mjs"; /** * Earning types configured for the company */ export declare class EarningTypes extends APIResource { /** * Lists Global Payroll earning types for selecting payroll earnings inputs. Use * the returned `earning_code` in `POST /earnings-inputs/`; the worker's payroll * catalog determines whether that code is available. `company_entity_id` and * `country_code` restrict results together. Conflicting filters return HTTP 200 * with empty `results`. Without either filter, returns the company's combined * earning catalog. * * A legal entity can have multiple payroll entities, including sub entities. With * `company_entity_id`, their catalogs are combined and equivalent entries with the * same country, code, display name, configuration, and behavior are merged. * Calculation and tax settings, effective dates, and employment restrictions * participate in comparison. Different configurations remain separate, even when * returned codes and names match. Each merged entry uses the lexicographically * smallest existing earning type ID; it can change when its source entry is * removed. Catalog membership does not guarantee availability to every worker. * Without `company_entity_id`, entries are deduplicated by earning type ID. * * Entity-filtered results are ordered by display name, country, code, and ID. * Pagination does not provide a snapshot during catalog changes. To continue, pass * the returned `next_link` token as `cursor` with the same filters. * * - Requires: `Global Payroll` * * @example HTTP * Representative request and response shapes. * ``` * GET /earning-types/?company_entity_id=company_entity_id&country_code=country_code&limit=50&cursor=cursor HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * { * "name": "date_of_birth", * "reason": "Insufficient entitlements" * } * ] * }, * "results": [ * { * "id": "string", * "earning_code": "string", * "display_name": "string", * "country_code": "string" * } * ], * "next_link": "string" * } * ``` */ list(query?: EarningTypeListParams | null | undefined, options?: RequestOptions): PagePromise; } export type EarningTypeListResponsesPageCursorURL = PageCursorURL; /** * An earning category available in Global Payroll, such as salary, commission, or * bonus. */ export interface EarningTypeListResponse { /** * Identifier of a source earning type. With `company_entity_id`, equivalent * entries use one existing ID, which can change when its source entry is removed. * Use `earning_code` when submitting payroll earnings inputs. */ id?: string; /** * Uppercase ISO 3166-1 alpha-2 country code of the payroll catalog, such as `CA` * or `US`. */ country_code?: string; /** * Configured display name of the earning type. Entries with different * configurations can have the same name and `earning_code`. */ display_name?: string; /** * Code used to select this earning type in `POST /earnings-inputs/`, such as * `regular_salary` or `commission`. Availability is validated against the worker's * payroll catalog. */ earning_code?: string; } export interface EarningTypeListParams { /** * Filters earnings to a company legal entity. Use the `id` returned by * `GET /company-legal-entities/`, not a payroll entity ID. Includes the combined * catalogs of linked, non-archived payroll entities, excluding internal shadow * entities. Omit this parameter to use the company-wide catalog. An unknown ID or * an ID outside the authenticated company returns HTTP 200 with empty `results`. * An empty value or a value that is not a 24-character hexadecimal ID returns HTTP * 400 (`VALIDATION_ERROR`). */ company_entity_id?: string; /** * Filters earnings by the payroll entity's country. Use an uppercase ISO 3166-1 * alpha-2 country code, such as `CA` or `US`; matching is case-sensitive. If * omitted or empty, country does not restrict results. When supplied with * `company_entity_id`, only earnings matching both filters are returned. */ country_code?: string; cursor?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; } export declare namespace EarningTypes { export { type EarningTypeListResponse as EarningTypeListResponse, type EarningTypeListResponsesPageCursorURL as EarningTypeListResponsesPageCursorURL, type EarningTypeListParams as EarningTypeListParams, }; } //# sourceMappingURL=earning-types.d.mts.map