import { APIResource } from "../core/resource.mjs"; import { APIPromise } from "../core/api-promise.mjs"; import { RequestOptions } from "../internal/request-options.mjs"; /** * Payroll runs for the company */ export declare class PayrollPaymentModeChanges extends APIResource { /** * Update payment modes for workers in one or more draft Global Payroll runs. The * endpoint returns an item-level result for each requested change. When a request * contains the same run and worker more than once, only the first change is * evaluated; later entries are rejected as duplicates. Repeating the same run, * worker, and payment mode is a safe no-op, so callers can retry it without an * idempotency key. Request validation returns every detected error in an errors * array before any payment mode is written. The errors array is the deliberate * batch-validation contract for this pre-GA endpoint so callers can correct * multiple issues at once; permission-denied responses use the same envelope for * consistency. * * @example HTTP * Representative request and response shapes. * ``` * POST /payroll-payment-mode-changes/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "changes": [ * { * "payment_mode": "DEFAULT", * "run_id": "run_id", * "worker_id": "worker_id" * } * ] * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "results": [ * { * "run_id": "string", * "worker_id": "string", * "payment_mode": "DEFAULT", * "status": "UPDATED", * "error": { * "code": "DUPLICATE_NO_OP", * "message": "string" * } * } * ], * "write_status": "COMPLETED" * } * ``` */ create(body: PayrollPaymentModeChangeCreateParams, options?: RequestOptions): APIPromise; } export interface PayrollPaymentModeChangeCreateResponse { /** * Item-level results for the requested payment mode changes. Each item is either * updated or rejected so callers can retry failed items independently. */ results?: Array; /** * Completion status for this synchronous request. This is currently always * COMPLETED; the field is reserved for future status values if processing becomes * asynchronous. It describes the overall request, while each result status * describes an individual item. */ write_status?: 'COMPLETED'; } export declare namespace PayrollPaymentModeChangeCreateResponse { interface Result { /** * Structured error when the item was rejected. This field is omitted for UPDATED * items and is present for REJECTED items. */ error?: Result.Error; /** * Requested Global Payroll payment mode code. */ payment_mode?: 'DEFAULT' | 'BANK_FILE' | 'MANUAL' | 'SAME_DAY_ACH' | 'CHECK_PRINTING' | 'CHECK_MAILING'; /** * ID of the requested payroll run. */ run_id?: string; /** * Item result: UPDATED or REJECTED. */ status?: 'UPDATED' | 'REJECTED'; /** * ID of the requested worker. */ worker_id?: string; } namespace Result { /** * Structured error when the item was rejected. This field is omitted for UPDATED * items and is present for REJECTED items. */ interface Error { /** * Machine-readable error code for a rejected item. DUPLICATE_NO_OP means the * requested change was already requested and no retry is needed; * DUPLICATE_TARGET_CONFLICT, OUT_OF_SCOPE, RUN_NOT_FOUND, WORKER_NOT_IN_RUN, and * PAYMENT_MODE_NOT_SUPPORTED are terminal request errors that require changing the * request or authorization; RUN_NOT_WRITABLE may be retried when the run becomes * writable; PAYMENT_MODE_UPDATE_FAILED is retryable after the underlying update * failure is resolved. */ code?: 'DUPLICATE_NO_OP' | 'DUPLICATE_TARGET_CONFLICT' | 'OUT_OF_SCOPE' | 'RUN_NOT_FOUND' | 'RUN_NOT_WRITABLE' | 'WORKER_NOT_IN_RUN' | 'PAYMENT_MODE_NOT_SUPPORTED' | 'PAYMENT_MODE_UPDATE_FAILED'; /** * Human-readable error message. */ message?: string; } } } export interface PayrollPaymentModeChangeCreateParams { /** * Payment mode changes to process. The maximum batch size is 100. */ changes: Array; } export declare namespace PayrollPaymentModeChangeCreateParams { interface Change { /** * Canonical Global Payroll payment mode code to apply to the worker in the run. * Known labels are DEFAULT (Default), BANK_FILE (Bank file), MANUAL (Manual), * SAME_DAY_ACH (Same-day ACH), CHECK_PRINTING (Check printing), and CHECK_MAILING * (Check mailing). */ payment_mode: 'DEFAULT' | 'BANK_FILE' | 'MANUAL' | 'SAME_DAY_ACH' | 'CHECK_PRINTING' | 'CHECK_MAILING'; /** * ID of the draft Global Payroll run to update. */ run_id: string; /** * ID of the worker whose payment mode will be updated. */ worker_id: string; } } export declare namespace PayrollPaymentModeChanges { export { type PayrollPaymentModeChangeCreateResponse as PayrollPaymentModeChangeCreateResponse, type PayrollPaymentModeChangeCreateParams as PayrollPaymentModeChangeCreateParams, }; } //# sourceMappingURL=payroll-payment-mode-changes.d.mts.map