@factorialco/api-client 3.0.0-beta.2026100116 → 3.0.0-beta.2026100118

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.
@@ -5983,6 +5983,10 @@ export type ProcurementPurchaseOrder = {
5983
5983
  * Date when the purchase order was created
5984
5984
  */
5985
5985
  date: string;
5986
+ /**
5987
+ * Deadline date for the purchase order delivery or completion. Writable through the update endpoint (omitted or null keeps it); readable here so the GET -> modify -> PUT roundtrip is complete.
5988
+ */
5989
+ deadline?: string;
5986
5990
  /**
5987
5991
  * Identifier of the vendor (contact) associated with this purchase order
5988
5992
  */
@@ -6003,10 +6007,22 @@ export type ProcurementPurchaseOrder = {
6003
6007
  * Formatted purchase order number with prefix (e.g., PO-00001)
6004
6008
  */
6005
6009
  formatted_po_number: string;
6010
+ /**
6011
+ * Preferred payment method for this purchase order
6012
+ */
6013
+ preferred_payment_method?: 'banktransfer' | 'cash' | 'virtualcard';
6006
6014
  /**
6007
6015
  * Identifier of the pinned PO template version this purchase order uses. Fetch that version (and its field definitions) to interpret the purchase order's header and line-item field keys. Null for legacy purchase orders created without a template.
6008
6016
  */
6009
6017
  po_template_version_id?: string;
6018
+ /**
6019
+ * Custom header field values, addressed by the field_key of the purchase order's PINNED template version, as an array of `{field_key, value}` pairs — exactly the shape the update endpoint accepts, so a GET -> modify -> PUT roundtrip works verbatim. Predefined fields (vendor, order_date, currency, due_date, payment_method, legal_entity) surface as top-level parameters instead, and computed or hidden values never appear (they are preserved server-side on update). Null for purchase orders without a template version.
6020
+ */
6021
+ header_field_values_by_key?: Array<unknown>;
6022
+ /**
6023
+ * Line items with their field values addressed by the field_key of the purchase order's PINNED template version — the same shape the update endpoint accepts: modify and send the whole set back. Rows are addressed by id (rows without an id are created, persisted rows missing from the set are deleted). Null for purchase orders without a template version.
6024
+ */
6025
+ line_items_by_key?: Array<unknown>;
6010
6026
  };
6011
6027
  export type ProcurementPurchaseRequest = {
6012
6028
  /**
@@ -19729,13 +19745,11 @@ export type PostApi20261001ResourcesProcurementPurchaseOrdersData = {
19729
19745
  */
19730
19746
  preferred_payment_method?: 'banktransfer' | 'cash' | 'virtualcard';
19731
19747
  /**
19732
- * Map of field_key => value for the header fields of the ACTIVE purchase order template version. Only custom (non-predefined, non-computed) field keys are accepted; predefined fields (vendor, order_date, currency, due_date, payment_method, legal_entity) are populated from the corresponding top-level parameters. Reference fields (employee, cost_center, project, tax_rate, team) take the referenced internal id as the value.
19748
+ * Header field values of the ACTIVE purchase order template version, as an array of `{field_key, value}` pairs. Only custom (non-predefined, non-computed) field keys are accepted; predefined fields (vendor, order_date, currency, due_date, payment_method, legal_entity) are populated from the corresponding top-level parameters. Reference fields (employee, cost_center, project, tax_rate, team) take the referenced internal id as the value. If a field_key appears more than once, the last occurrence wins.
19733
19749
  */
19734
- header_field_values?: {
19735
- [key: string]: unknown;
19736
- };
19750
+ header_field_values?: Array<unknown>;
19737
19751
  /**
19738
- * Line items of the purchase order, each addressed by the line-item field keys of the ACTIVE template version (e.g. concept, quantity, unit_price, tax_rate). Computed keys (subtotal, tax_amount, total, discount_amount) are derived server-side and rejected as input.
19752
+ * Line items of the purchase order, each carrying its values as an array of `{field_key, value}` pairs addressed by the line-item field keys of the ACTIVE template version (e.g. concept, quantity, unit_price, tax_rate). Computed keys (subtotal, tax_amount, total, discount_amount) are derived server-side and rejected as input.
19739
19753
  */
19740
19754
  line_items?: Array<unknown>;
19741
19755
  };
@@ -19768,6 +19782,79 @@ export type GetApi20261001ResourcesProcurementPurchaseOrdersByIdResponses = {
19768
19782
  200: ProcurementPurchaseOrder;
19769
19783
  };
19770
19784
  export type GetApi20261001ResourcesProcurementPurchaseOrdersByIdResponse = GetApi20261001ResourcesProcurementPurchaseOrdersByIdResponses[keyof GetApi20261001ResourcesProcurementPurchaseOrdersByIdResponses];
19785
+ export type PutApi20261001ResourcesProcurementPurchaseOrdersByIdData = {
19786
+ body?: {
19787
+ /**
19788
+ * Identifier of the purchase order to update.
19789
+ */
19790
+ id: string;
19791
+ /**
19792
+ * Company identifier, as returned by the credentials endpoint (`/resources/api_public/credentials`).
19793
+ */
19794
+ company_id: string;
19795
+ /**
19796
+ * Formatted purchase order number with prefix, as returned by the read endpoint — send back the value you read.
19797
+ */
19798
+ formatted_po_number: string;
19799
+ /**
19800
+ * Description or notes about the purchase order.
19801
+ */
19802
+ description: string;
19803
+ /**
19804
+ * Preferred payment method for this purchase order. Send null to clear it.
19805
+ */
19806
+ preferred_payment_method?: 'banktransfer' | 'cash' | 'virtualcard';
19807
+ /**
19808
+ * Status of the purchase order. Omitted or null keeps the current status; send a new one to transition. Once closed, the purchase order becomes immutable.
19809
+ */
19810
+ status?: 'draft' | 'pending' | 'ordered' | 'partial' | 'received' | 'closed';
19811
+ /**
19812
+ * Identifier of the legal entity that owns the purchase order. Must belong to the company.
19813
+ */
19814
+ legal_entity_id: string;
19815
+ /**
19816
+ * Total cost of the purchase order, as returned by the read endpoint — send back what you read. The currency is applied as sent; on template-versioned purchase orders the amounts are owned by the line items and recomputed server-side.
19817
+ */
19818
+ cost: {
19819
+ [key: string]: unknown;
19820
+ };
19821
+ /**
19822
+ * Identifier of the vendor (Finance contact) by internal Factorial id. Null clears the vendor on template-versioned purchase orders.
19823
+ */
19824
+ vendor_id?: string;
19825
+ /**
19826
+ * Purchase order date. Omit or send null to keep the current one.
19827
+ */
19828
+ date?: string;
19829
+ /**
19830
+ * Deadline date for the purchase order delivery or completion. Omitted or null keeps the current deadline (clearing a deadline through this endpoint is not supported).
19831
+ */
19832
+ deadline?: string;
19833
+ /**
19834
+ * Header field values of the purchase order's template version, as an array of `{field_key, value}` pairs — the same shape the read returns. Replaced as sent: send the complete set; an empty array deletes all custom header values, and omitting the field leaves them untouched. Only custom field keys are accepted; predefined fields (vendor, order_date, currency, due_date, payment_method, legal_entity) come from the corresponding top-level parameters. Reference fields take the referenced id as the value. If a field_key appears more than once, the last occurrence wins.
19835
+ */
19836
+ header_field_values_by_key?: Array<unknown>;
19837
+ /**
19838
+ * Line items of the purchase order, replaced as sent — the same shape the read returns. Rows with an id update the matching line item, rows without an id create new ones, and persisted rows missing from the set are deleted. Send an empty array to remove all line items, or omit the field to leave them untouched. Values travel as `{field_key, value}` pairs; computed keys (subtotal, tax_amount, total, discount_amount) are derived server-side and rejected as input.
19839
+ */
19840
+ line_items_by_key?: Array<unknown>;
19841
+ };
19842
+ path: {
19843
+ /**
19844
+ * Identifier of the purchase order to update.
19845
+ */
19846
+ id: string;
19847
+ };
19848
+ query?: never;
19849
+ url: '/api/2026-10-01/resources/procurement/purchase_orders/{id}';
19850
+ };
19851
+ export type PutApi20261001ResourcesProcurementPurchaseOrdersByIdResponses = {
19852
+ /**
19853
+ * OK
19854
+ */
19855
+ 200: ProcurementPurchaseOrder;
19856
+ };
19857
+ export type PutApi20261001ResourcesProcurementPurchaseOrdersByIdResponse = PutApi20261001ResourcesProcurementPurchaseOrdersByIdResponses[keyof PutApi20261001ResourcesProcurementPurchaseOrdersByIdResponses];
19771
19858
  export type GetApi20261001ResourcesProcurementPurchaseRequestsData = {
19772
19859
  body?: never;
19773
19860
  path?: never;
@@ -21004,63 +21091,63 @@ export type PostApi20261001ResourcesProjectManagementProjectWorkersUnassignRespo
21004
21091
  export type GetApi20261001ResourcesProjectManagementRatesData = {
21005
21092
  body?: never;
21006
21093
  path?: never;
21007
- query: {
21094
+ query?: {
21008
21095
  /**
21009
21096
  * Filter rates by IDs
21010
21097
  */
21011
- 'ids[]': Array<string>;
21098
+ 'ids[]'?: Array<string>;
21012
21099
  /**
21013
21100
  * Filter rates by company ID
21014
21101
  */
21015
- company_id: string;
21102
+ company_id?: string;
21016
21103
  /**
21017
21104
  * Filter rates by project ID
21018
21105
  */
21019
- project_id: string;
21106
+ project_id?: string;
21020
21107
  /**
21021
21108
  * Filter rates by canonical resource identity (numeric id or tree node uuid)
21022
21109
  */
21023
- 'resource_ids[]': Array<string>;
21110
+ 'resource_ids[]'?: Array<string>;
21024
21111
  /**
21025
21112
  * Filter rates by the kind of resource they apply to.
21026
21113
  */
21027
- resource_kind: 'project_worker' | 'project' | 'employee' | 'job_catalog_tree_node';
21114
+ resource_kind?: 'project_worker' | 'project' | 'employee' | 'job_catalog_tree_node';
21028
21115
  /**
21029
21116
  * Filter rates by reference rate ID
21030
21117
  */
21031
- reference_rate_id: string;
21118
+ reference_rate_id?: string;
21032
21119
  /**
21033
21120
  * Filter rates by job catalog role or level name
21034
21121
  */
21035
- role_or_level: string;
21122
+ role_or_level?: string;
21036
21123
  /**
21037
21124
  * Filter rates by employee name
21038
21125
  */
21039
- employee_name: string;
21126
+ employee_name?: string;
21040
21127
  /**
21041
21128
  * Filter rates by quote ID
21042
21129
  */
21043
- quote_id: string;
21130
+ quote_id?: string;
21044
21131
  /**
21045
21132
  * If true, retrieve only currently active rates.
21046
21133
  */
21047
- only_active: boolean;
21134
+ only_active?: boolean;
21048
21135
  /**
21049
21136
  * If true, retrieve only rates that are not linked to a project.
21050
21137
  */
21051
- without_project: boolean;
21138
+ without_project?: boolean;
21052
21139
  /**
21053
21140
  * If true, retrieve only rates that are not linked to a quote.
21054
21141
  */
21055
- without_quote: boolean;
21142
+ without_quote?: boolean;
21056
21143
  /**
21057
21144
  * Filter rates by record type
21058
21145
  */
21059
- record_type: string;
21146
+ record_type?: string;
21060
21147
  /**
21061
21148
  * Filter rates by reference rate IDs
21062
21149
  */
21063
- 'reference_rate_ids[]': Array<string>;
21150
+ 'reference_rate_ids[]'?: Array<string>;
21064
21151
  };
21065
21152
  url: '/api/2026-10-01/resources/project_management/rates';
21066
21153
  };
@@ -22726,6 +22813,10 @@ export type GetApi20261001ResourcesTimeoffAllowanceStatsData = {
22726
22813
  * The reference date to calculate the allowance stats. If not provided, it will use today's date.
22727
22814
  */
22728
22815
  reference_date?: string;
22816
+ /**
22817
+ * 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.
22818
+ */
22819
+ simulate_policy_change_to_id?: string;
22729
22820
  };
22730
22821
  url: '/api/2026-10-01/resources/timeoff/allowance_stats';
22731
22822
  };