@factorialco/api-client 3.0.0-beta.2026100126 → 3.0.0-beta.2026100128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1497,15 +1497,15 @@ export type CompensationsEmployeesCompensation = {
1497
1497
  */
1498
1498
  amount_is_overwritten: boolean;
1499
1499
  /**
1500
- * Row projection type (always `compensation` on this endpoint)
1500
+ * Record projection type (always `compensation` on this endpoint)
1501
1501
  */
1502
1502
  result_type?: 'compensation' | 'payroll_result';
1503
1503
  /**
1504
- * Source type discriminator (nullable — dashboard-created rows have no source)
1504
+ * Source type discriminator (nullable — dashboard-created records have no source)
1505
1505
  */
1506
1506
  source_type?: 'compensations_compensationpolicy' | 'timesettings_customtimerangecategory' | 'expenses_expensable' | 'expenses_expense' | 'expenses_mileage' | 'benefits_compensation' | 'salary_advance_request' | 'incentives_compensationplanrequest' | 'attendance_review';
1507
1507
  /**
1508
- * Source id (nullable — dashboard-created rows have no source)
1508
+ * Source id (nullable — dashboard-created records have no source)
1509
1509
  */
1510
1510
  source_id?: string;
1511
1511
  /**
@@ -1629,6 +1629,44 @@ export type CompensationsPayrollRun = {
1629
1629
  */
1630
1630
  updated_at?: string;
1631
1631
  };
1632
+ export type CompensationsPayrollRunEmployeesCompensation = {
1633
+ /**
1634
+ * Payroll run employee compensation id
1635
+ */
1636
+ id: string;
1637
+ /**
1638
+ * Employee id (participant of the payroll run)
1639
+ */
1640
+ payroll_run_employee_id: string;
1641
+ /**
1642
+ * Payroll concept id
1643
+ */
1644
+ payroll_concept_id: string;
1645
+ /**
1646
+ * Parent payroll run id
1647
+ */
1648
+ payroll_run_id: string;
1649
+ /**
1650
+ * Record projection type — `compensation` (input) or `payroll_result` (computed)
1651
+ */
1652
+ result_type: string;
1653
+ /**
1654
+ * Amount strategy discriminator
1655
+ */
1656
+ amount_strategy_type: 'compensations_fixed_amount_strategy' | 'compensations_variable_amount_strategy' | 'compensations_per_worked_day_amount_strategy';
1657
+ /**
1658
+ * When the record was created
1659
+ */
1660
+ created_at: string;
1661
+ /**
1662
+ * When the record was last updated
1663
+ */
1664
+ updated_at: string;
1665
+ /**
1666
+ * Aggregated compensation value for this concept and employee within the payroll run, in minor units. For `payroll_result` records, this is the value the bookkeeper computed for that concept (e.g. net pay).
1667
+ */
1668
+ amount?: number;
1669
+ };
1632
1670
  export type ContractsCompensation = {
1633
1671
  /**
1634
1672
  * Unique identifier of the compensation
@@ -1762,6 +1800,10 @@ export type ContractsContractVersion = {
1762
1800
  * the amount of money the employee earns in cents.
1763
1801
  */
1764
1802
  salary_amount?: number;
1803
+ /**
1804
+ * the currency of the salary amount, inherited from the governing legal entity.
1805
+ */
1806
+ salary_currency?: string;
1765
1807
  /**
1766
1808
  * the frequency of the salary payment.
1767
1809
  */
@@ -4077,7 +4119,7 @@ export type FinanceCategory = {
4077
4119
  */
4078
4120
  id: string;
4079
4121
  /**
4080
- * Custom label for the category
4122
+ * The category's display name — the one shown in the UI and the one a person will call it by. It is the company's own label when they renamed the category, otherwise the translated default name. Match on this, never on `identifier`, which is a stable internal key that need not resemble the name (`restaurants` is displayed as "Meals").
4081
4123
  */
4082
4124
  label: string;
4083
4125
  /**
@@ -4089,7 +4131,7 @@ export type FinanceCategory = {
4089
4131
  */
4090
4132
  parent_category_id?: string;
4091
4133
  /**
4092
- * System identifier for the category
4134
+ * Stable internal key for the category, for callers that hold one. NOT a display name and not derivable from one — `restaurants` is shown to everyone as "Meals" — so never present it to a user or match a user's wording against it; use `label` for both.
4093
4135
  */
4094
4136
  identifier: string;
4095
4137
  /**
@@ -4254,35 +4296,35 @@ export type FinanceCostCenterMembership = {
4254
4296
  };
4255
4297
  export type FinanceFinancialDocument = {
4256
4298
  /**
4257
- * Factorial unique identifier.
4299
+ * Factorial unique identifier for the financial document.
4258
4300
  */
4259
4301
  id: string;
4260
4302
  /**
4261
- * Net amount in cents.
4303
+ * Sum of the line items before taxes, in cents. Use `total_amount_cents` for what is actually payable.
4262
4304
  */
4263
4305
  net_amount_cents?: number;
4264
4306
  /**
4265
- * Total amount in cents.
4307
+ * Total payable on the document, taxes included, in cents. This is the amount to branch on when a rule cares about how much is being spent.
4266
4308
  */
4267
4309
  total_amount_cents?: number;
4268
4310
  /**
4269
- * Document number.
4311
+ * Number the issuer printed on the document; for a purchase, the vendor's own invoice number. Not a Factorial identifier: on a purchase it is only unique per vendor, so the same number can legitimately appear on documents from two different vendors.
4270
4312
  */
4271
4313
  document_number?: string;
4272
4314
  /**
4273
- * Document currency.
4315
+ * ISO 4217 code of the currency the document is issued in, such as EUR or USD. Every amount on the document is expressed in it, so comparing amounts across documents without checking this is unsafe.
4274
4316
  */
4275
4317
  currency?: string;
4276
4318
  /**
4277
- * Current status.
4319
+ * Where the document stands on its way to being paid: `processing` while it is still being prepared, `review` while it awaits review (the value is `review`, never `pending`), `sent_to_pay` once it has been sent for payment, and `paid`. This is not an approval state: a document generated from an employee expense is created already `paid`, because the money left before Factorial ever saw it.
4278
4320
  */
4279
4321
  status: 'processing' | 'review' | 'sent_to_pay' | 'paid';
4280
4322
  /**
4281
- * Due date.
4323
+ * Date the payment falls due, as stated on the document.
4282
4324
  */
4283
4325
  due_date?: string;
4284
4326
  /**
4285
- * Document date.
4327
+ * Date the issuer put on the document. Distinct from `created_at`, which is when it reached Factorial; a document can arrive weeks after it was issued.
4286
4328
  */
4287
4329
  document_date?: string;
4288
4330
  /**
@@ -4323,11 +4365,11 @@ export type FinanceFinancialDocument = {
4323
4365
  }>;
4324
4366
  }>;
4325
4367
  /**
4326
- * Date when was fully reconciled.
4368
+ * When the document was fully matched against bank transactions. Null while any part of it remains unreconciled.
4327
4369
  */
4328
4370
  fully_reconciled_at?: string;
4329
4371
  /**
4330
- * Date when was recorded.
4372
+ * When the document was posted to accounting. Only possible once `validated_at` is set.
4331
4373
  */
4332
4374
  recorded_at?: string;
4333
4375
  /**
@@ -4335,15 +4377,15 @@ export type FinanceFinancialDocument = {
4335
4377
  */
4336
4378
  duplicate_financial_document_id?: string;
4337
4379
  /**
4338
- * Date when was validated.
4380
+ * When a person confirmed the document data is correct. Validation is what unlocks recording and payment; it is not an approval decision, and says nothing about whether the spend was authorised.
4339
4381
  */
4340
4382
  validated_at?: string;
4341
4383
  /**
4342
- * Factorial unique identifier for the user who validated the financial document.
4384
+ * Factorial unique identifier of the employee who validated the document.
4343
4385
  */
4344
4386
  validated_by_id?: string;
4345
4387
  /**
4346
- * Type of the financial document. Using "invoice" as default.
4388
+ * One of `invoice`, `receipt` or `credit_note`. A document generated from an expense is typed automatically and can flip between `receipt` and `invoice` when the employee edits the expense.
4347
4389
  */
4348
4390
  document_type: 'invoice' | 'receipt' | 'credit_note';
4349
4391
  /**
@@ -4351,7 +4393,7 @@ export type FinanceFinancialDocument = {
4351
4393
  */
4352
4394
  parent_financial_document_id?: string;
4353
4395
  /**
4354
- * Taxes total amount in cents.
4396
+ * Sum of every tax charged on the document, in cents.
4355
4397
  */
4356
4398
  taxes_total_amount_cents?: number;
4357
4399
  /**
@@ -10987,6 +11029,10 @@ export type PostApi20261001ResourcesAttendanceShiftsData = {
10987
11029
  * Id of the location related
10988
11030
  */
10989
11031
  workplace_id?: string;
11032
+ /**
11033
+ * Id of the project worker the shift is imputed to. A time record for that project is created with the shift.
11034
+ */
11035
+ project_worker_id?: string;
10990
11036
  };
10991
11037
  path?: never;
10992
11038
  query?: never;
@@ -12145,7 +12191,7 @@ export type PutApi20261001ResourcesCompensationsEmployeesCompensationsByIdData =
12145
12191
  id: string;
12146
12192
  amount?: number;
12147
12193
  /**
12148
- * Manual override of the strategy-computed amount; not allowed on fixed-strategy rows (422 `overwrite_not_applicable`)
12194
+ * Manual override of the strategy-computed amount; not allowed on fixed-strategy records (422 `overwrite_not_applicable`)
12149
12195
  */
12150
12196
  amount_overwritten?: number;
12151
12197
  /**
@@ -12307,6 +12353,65 @@ export type GetApi20261001ResourcesCompensationsPayrollRunsByIdResponses = {
12307
12353
  200: CompensationsPayrollRun;
12308
12354
  };
12309
12355
  export type GetApi20261001ResourcesCompensationsPayrollRunsByIdResponse = GetApi20261001ResourcesCompensationsPayrollRunsByIdResponses[keyof GetApi20261001ResourcesCompensationsPayrollRunsByIdResponses];
12356
+ export type GetApi20261001ResourcesCompensationsPayrollRunEmployeesCompensationsData = {
12357
+ body?: never;
12358
+ path?: never;
12359
+ query?: {
12360
+ /**
12361
+ * Payroll run employee compensation ids
12362
+ */
12363
+ 'ids[]'?: Array<string>;
12364
+ /**
12365
+ * Filter by payroll run ids, refers to compensations/payroll_runs endpoint.
12366
+ */
12367
+ 'payroll_run_ids[]'?: Array<string>;
12368
+ /**
12369
+ * Filter by employee ids (participants of the payroll run)
12370
+ */
12371
+ 'payroll_run_employee_ids[]'?: Array<string>;
12372
+ /**
12373
+ * Filter by payroll concept ids, refers to compensations/concepts endpoint.
12374
+ */
12375
+ 'payroll_concept_ids[]'?: Array<string>;
12376
+ /**
12377
+ * Filter by record projection type — `compensation` (input) or `payroll_result` (computed)
12378
+ */
12379
+ result_type?: 'compensation' | 'payroll_result';
12380
+ /**
12381
+ * Filter by legal entity ids, refers to companies/legal_entities endpoint.
12382
+ */
12383
+ 'legal_entity_ids[]'?: Array<string>;
12384
+ };
12385
+ url: '/api/2026-10-01/resources/compensations/payroll_run_employees_compensations';
12386
+ };
12387
+ export type GetApi20261001ResourcesCompensationsPayrollRunEmployeesCompensationsResponses = {
12388
+ /**
12389
+ * OK
12390
+ */
12391
+ 200: {
12392
+ data?: Array<CompensationsPayrollRunEmployeesCompensation>;
12393
+ meta?: PagedIndexMeta;
12394
+ };
12395
+ };
12396
+ export type GetApi20261001ResourcesCompensationsPayrollRunEmployeesCompensationsResponse = GetApi20261001ResourcesCompensationsPayrollRunEmployeesCompensationsResponses[keyof GetApi20261001ResourcesCompensationsPayrollRunEmployeesCompensationsResponses];
12397
+ export type GetApi20261001ResourcesCompensationsPayrollRunEmployeesCompensationsByIdData = {
12398
+ body?: never;
12399
+ path: {
12400
+ /**
12401
+ * Payroll run employee compensation ids
12402
+ */
12403
+ id: string;
12404
+ };
12405
+ query?: never;
12406
+ url: '/api/2026-10-01/resources/compensations/payroll_run_employees_compensations/{id}';
12407
+ };
12408
+ export type GetApi20261001ResourcesCompensationsPayrollRunEmployeesCompensationsByIdResponses = {
12409
+ /**
12410
+ * OK
12411
+ */
12412
+ 200: CompensationsPayrollRunEmployeesCompensation;
12413
+ };
12414
+ export type GetApi20261001ResourcesCompensationsPayrollRunEmployeesCompensationsByIdResponse = GetApi20261001ResourcesCompensationsPayrollRunEmployeesCompensationsByIdResponses[keyof GetApi20261001ResourcesCompensationsPayrollRunEmployeesCompensationsByIdResponses];
12310
12415
  export type GetApi20261001ResourcesContractsCompensationsData = {
12311
12416
  body?: never;
12312
12417
  path?: never;
@@ -14175,7 +14280,7 @@ export type PostApi20261001ResourcesDocumentsDocumentsRestoreFromTrashBinRespons
14175
14280
  export type PostApi20261001ResourcesDocumentsDownloadUrlsBulkCreateData = {
14176
14281
  body?: {
14177
14282
  /**
14178
- * list of document identifiers.
14283
+ * list of document identifiers (between 1 and 100).
14179
14284
  */
14180
14285
  ids?: Array<string>;
14181
14286
  };
@@ -14444,11 +14549,15 @@ export type PutApi20261001ResourcesEmployeesEmployeesByIdData = {
14444
14549
  */
14445
14550
  country?: string;
14446
14551
  /**
14447
- * bank account number of the employee.
14552
+ * bank account number of the employee, in the format given by bank_number_format.
14448
14553
  */
14449
14554
  bank_number?: string;
14450
14555
  /**
14451
- * code to identify banks and financial institutions globally.
14556
+ * format of bank_number. Required when bank_number is set.
14557
+ */
14558
+ bank_number_format?: 'iban' | 'sort_code_and_account_number' | 'routing_number_and_account_number' | 'clabe' | 'other' | 'bank_name_and_account_number';
14559
+ /**
14560
+ * SWIFT/BIC for iban, the sort code for sort_code_and_account_number, the routing number for routing_number_and_account_number, the bank name for bank_name_and_account_number. Required for those three formats.
14452
14561
  */
14453
14562
  swift_bic?: string;
14454
14563
  /**
@@ -16956,6 +17065,28 @@ export type GetApi20261001ResourcesIntegrationsSyncRunsResponses = {
16956
17065
  };
16957
17066
  };
16958
17067
  export type GetApi20261001ResourcesIntegrationsSyncRunsResponse = GetApi20261001ResourcesIntegrationsSyncRunsResponses[keyof GetApi20261001ResourcesIntegrationsSyncRunsResponses];
17068
+ export type PostApi20261001ResourcesIntegrationsSyncRunsData = {
17069
+ body?: {
17070
+ /**
17071
+ * Identifier of the company the sync run belongs to.
17072
+ */
17073
+ company_id: string;
17074
+ /**
17075
+ * UUID of the marketplace integration to create a sync run for.
17076
+ */
17077
+ marketplace_integration_uuid: string;
17078
+ };
17079
+ path?: never;
17080
+ query?: never;
17081
+ url: '/api/2026-10-01/resources/integrations/sync_runs';
17082
+ };
17083
+ export type PostApi20261001ResourcesIntegrationsSyncRunsResponses = {
17084
+ /**
17085
+ * CREATED
17086
+ */
17087
+ 201: IntegrationsSyncRun;
17088
+ };
17089
+ export type PostApi20261001ResourcesIntegrationsSyncRunsResponse = PostApi20261001ResourcesIntegrationsSyncRunsResponses[keyof PostApi20261001ResourcesIntegrationsSyncRunsResponses];
16959
17090
  export type GetApi20261001ResourcesIntegrationsSyncRunsByIdData = {
16960
17091
  body?: never;
16961
17092
  path: {
@@ -17169,7 +17300,7 @@ export type PostApi20261001ResourcesIntegrationsSyncableSyncRunsBulkUpsertData =
17169
17300
  /**
17170
17301
  * Outcome of processing the item
17171
17302
  */
17172
- status: 'success' | 'failed' | 'invalid';
17303
+ status: 'running' | 'success' | 'failed' | 'invalid';
17173
17304
  /**
17174
17305
  * The Factorial record this item resolved to (link). Only fills a missing link; re-linking to a different record is rejected.
17175
17306
  */
@@ -24111,7 +24242,7 @@ export type GetApi20261001ResourcesTimeoffAllowanceStatsData = {
24111
24242
  */
24112
24243
  'ids[]'?: Array<string>;
24113
24244
  /**
24114
- * Get the allowance stats for specific employees
24245
+ * IDs of the employees to read allowance stats for, at most 25 per request. Leave it empty to read every employee you have access to. Naming an employee you cannot access returns an empty page rather than the stats for the others.
24115
24246
  */
24116
24247
  'employee_ids[]'?: Array<string>;
24117
24248
  /**
@@ -24123,7 +24254,7 @@ export type GetApi20261001ResourcesTimeoffAllowanceStatsData = {
24123
24254
  */
24124
24255
  reference_date?: string;
24125
24256
  /**
24126
- * When provided, computes the stats as if the employee were moved to this target time off policy effective the day AFTER reference_date, so pass the day before the change date - for a change effective on 2026-08-03, send reference_date=2026-08-02. This truncates the source policy's current cycle at that boundary so available_days reflects the prorated balance that would actually transfer or be discarded on the change, rather than the full entitlement. Purely a read - nothing is persisted. Requires the policy timeline feature; without it the result is identical to an un-simulated read.
24257
+ * When provided, computes the stats as if the employee were moved to this target time off policy effective the day AFTER reference_date, so pass the day before the change date - for a change effective on 2026-08-03, send reference_date=2026-08-02. This truncates the source policy's current cycle at that boundary so available_days reflects the prorated balance that would actually transfer or be discarded on the change, rather than the full entitlement. Purely a read - nothing is persisted. Requires the policy timeline feature; without it the result is identical to an un-simulated read. Can only be used together with employee_ids, because a simulation needs every employee in the read to belong to the target policy's company - which a company-wide read cannot guarantee.
24127
24258
  */
24128
24259
  simulate_policy_change_to_id?: string;
24129
24260
  };
@@ -24948,6 +25079,10 @@ export type PostApi20261001ResourcesTimeoffPoliciesData = {
24948
25079
  * Company ID.
24949
25080
  */
24950
25081
  company_id?: string;
25082
+ /**
25083
+ * ID of an existing policy to copy. When set, the new policy is created with a copy of that policy's allowances and no employees assigned. Omit it to create a policy from scratch.
25084
+ */
25085
+ based_on_policy_id?: string;
24951
25086
  };
24952
25087
  path?: never;
24953
25088
  query?: never;
@@ -26545,7 +26680,7 @@ export type PostApi20261001ResourcesTrainingsTrainingMembershipsBulkCreateData =
26545
26680
  /**
26546
26681
  * ids for the accesses to be assigned in a training
26547
26682
  */
26548
- employee_ids: Array<string>;
26683
+ employee_ids?: Array<string>;
26549
26684
  /**
26550
26685
  * Training id to be assigned
26551
26686
  */