import { APIResource } from "../../core/resource.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; /** * Payroll runs for the company */ export declare class OffCycle extends APIResource { /** * Create draft off-cycle run or runs for Global Payroll workers. Workers may be * split into separate runs by employment type, but every run must belong to the * same payroll entity. All requested workers must be eligible; validation is * all-or-nothing before creation starts. Each validated run is attempted * independently. The response contains status, confirmed runs, and per-run errors. * In both runs and errors, company_entity_id is the HRIS company entity * relationship ID, matching payroll run retrieval, not the internal company * payroll entity ID. If that relationship cannot be resolved, company_entity_id is * null; confirmed run IDs are still returned. HTTP 201 may contain * PARTIAL_SUCCESS; HTTP 500 with FAILED means no creation was confirmed. An error * does not prove that no run was created; inspect errors and reconcile before * retrying. Idempotency-Key is not supported: each POST creates new run(s), even * for an identical payload or repeated key. A retry after a timeout may create * duplicate draft run(s); reconcile before retrying. * * @example HTTP * Representative request and response shapes. * ``` * POST /payroll-runs/off-cycle/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "errors": [ * { * "code": "RUN_CREATION_OUTCOME_UNKNOWN", * "company_entity_id": "company_entity_id", * "employment_split": "employment_split", * "message": "message", * "worker_ids": [ * "string" * ] * } * ], * "runs": [ * { * "check_date": "check_date", * "company_entity_id": "company_entity_id", * "country_code": "country_code", * "employment_split": "employment_split", * "pay_period": { * "end_date": "end_date", * "start_date": "start_date" * }, * "run_configuration": { * "pay_basis": "pay_basis" * }, * "run_id": "run_id", * "run_status": "run_status", * "run_type": "run_type", * "worker_ids": [ * "string" * ] * } * ], * "status": "SUCCESS" * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "status": "SUCCESS", * "runs": [ * { * "run_id": "string", * "worker_ids": [ * "string" * ], * "company_entity_id": "string", * "country_code": "string", * "run_type": "string", * "run_status": "string", * "check_date": "string", * "pay_period": { * "start_date": "string", * "end_date": "string" * }, * "employment_split": "string", * "run_configuration": { * "pay_basis": "string" * } * } * ], * "errors": [ * { * "worker_ids": [ * "string" * ], * "company_entity_id": "string", * "employment_split": "string", * "code": "RUN_CREATION_OUTCOME_UNKNOWN", * "message": "string" * } * ] * } * ``` */ create(body: OffCycleCreateParams, options?: RequestOptions): APIPromise; } export interface OffCycleCreateResponse { /** * One error per unconfirmed run creation. Empty on full success; reconcile before * retrying. */ errors: Array; /** * Confirmed created draft runs. Empty when no creation could be confirmed. */ runs: Array; /** * SUCCESS, PARTIAL_SUCCESS, or FAILED. FAILED means no run creation was confirmed. */ status: 'SUCCESS' | 'PARTIAL_SUCCESS' | 'FAILED'; } export declare namespace OffCycleCreateResponse { interface Error { /** * Stable error code; an exception does not prove that no run was created. */ code: 'RUN_CREATION_OUTCOME_UNKNOWN'; /** * HRIS company entity relationship ID for the attempted run. Null if the * relationship cannot be resolved. */ company_entity_id: string; /** * Employment category for the attempted run. */ employment_split: string; /** * Safe description of the unconfirmed creation outcome and retry guidance. */ message: string; /** * Role IDs in the run whose creation could not be confirmed. */ worker_ids: Array; } interface Run { /** * Payment date selected for this run. */ check_date: string; /** * HRIS company entity relationship ID for this run, matching company_entity_id on * payroll run retrieval. Null if the relationship cannot be resolved. */ company_entity_id: string; /** * Country code of the payroll entity. */ country_code: string; /** * Worker eligibility category used to split this run, such as employees or * contractors. */ employment_split: string; /** * Pay period for this run. */ pay_period: Run.PayPeriod; /** * Calculation configuration used for this run. */ run_configuration: Run.RunConfiguration; /** * Identifier of the created draft payroll run. */ run_id: string; /** * Status of the created payroll run. */ run_status: string; /** * Type of the created payroll run. */ run_type: string; /** * Role IDs included in this run. */ worker_ids: Array; } namespace Run { /** * Pay period for this run. */ interface PayPeriod { /** * End date of this run's pay period. */ end_date: string; /** * Start date of this run's pay period. */ start_date: string; } /** * Calculation configuration used for this run. */ interface RunConfiguration { /** * Amount basis used by the created run. This API currently creates gross-pay runs. */ pay_basis: string; } } } export interface OffCycleCreateParams { /** * One error per unconfirmed run creation. Empty on full success; reconcile before * retrying. */ errors: Array; /** * Confirmed created draft runs. Empty when no creation could be confirmed. */ runs: Array; /** * SUCCESS, PARTIAL_SUCCESS, or FAILED. FAILED means no run creation was confirmed. */ status: 'SUCCESS' | 'PARTIAL_SUCCESS' | 'FAILED'; } export declare namespace OffCycleCreateParams { interface Error { /** * Stable error code; an exception does not prove that no run was created. */ code: 'RUN_CREATION_OUTCOME_UNKNOWN'; /** * HRIS company entity relationship ID for the attempted run. Null if the * relationship cannot be resolved. */ company_entity_id: string; /** * Employment category for the attempted run. */ employment_split: string; /** * Safe description of the unconfirmed creation outcome and retry guidance. */ message: string; /** * Role IDs in the run whose creation could not be confirmed. */ worker_ids: Array; } interface Run { /** * Payment date selected for this run. */ check_date: string; /** * HRIS company entity relationship ID for this run, matching company_entity_id on * payroll run retrieval. Null if the relationship cannot be resolved. */ company_entity_id: string; /** * Country code of the payroll entity. */ country_code: string; /** * Worker eligibility category used to split this run, such as employees or * contractors. */ employment_split: string; /** * Pay period for this run. */ pay_period: Run.PayPeriod; /** * Calculation configuration used for this run. */ run_configuration: Run.RunConfiguration; /** * Identifier of the created draft payroll run. */ run_id: string; /** * Status of the created payroll run. */ run_status: string; /** * Type of the created payroll run. */ run_type: string; /** * Role IDs included in this run. */ worker_ids: Array; } namespace Run { /** * Pay period for this run. */ interface PayPeriod { /** * End date of this run's pay period. */ end_date: string; /** * Start date of this run's pay period. */ start_date: string; } /** * Calculation configuration used for this run. */ interface RunConfiguration { /** * Amount basis used by the created run. This API currently creates gross-pay runs. */ pay_basis: string; } } } export declare namespace OffCycle { export { type OffCycleCreateResponse as OffCycleCreateResponse, type OffCycleCreateParams as OffCycleCreateParams, }; } //# sourceMappingURL=off-cycle.d.ts.map