@spaceinvoices/js-sdk 12.42.0 → 12.43.0
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.
- package/dist/generated/expenses/expenses.d.cts +5 -4
- package/dist/generated/expenses/expenses.d.ts +5 -4
- package/dist/generated/model/createExpenseBody.d.cts +1 -1
- package/dist/generated/model/createExpenseBody.d.ts +1 -1
- package/dist/generated/model/customExpenseWrite.d.cts +1 -1
- package/dist/generated/model/customExpenseWrite.d.ts +1 -1
- package/dist/generated/model/expensePaymentOpenBalanceError.d.cts +15 -0
- package/dist/generated/model/expensePaymentOpenBalanceError.d.ts +15 -0
- package/dist/generated/model/expensePaymentOpenBalanceErrorCause.d.cts +27 -0
- package/dist/generated/model/expensePaymentOpenBalanceErrorCause.d.ts +27 -0
- package/dist/generated/model/expensePaymentOpenBalanceErrorCauseCode.d.cts +11 -0
- package/dist/generated/model/expensePaymentOpenBalanceErrorCauseCode.d.ts +11 -0
- package/dist/generated/model/index.d.cts +3 -0
- package/dist/generated/model/index.d.ts +3 -0
- package/dist/generated/payments/payments.d.cts +7 -5
- package/dist/generated/payments/payments.d.ts +7 -5
- package/dist/generated-zod/expenses/expenses.d.cts +1 -0
- package/dist/generated-zod/expenses/expenses.d.ts +1 -0
- package/dist/generated-zod/payments/payments.d.cts +3 -1
- package/dist/generated-zod/payments/payments.d.ts +3 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking.
|
|
6
6
|
* OpenAPI spec version: 1.0.0
|
|
7
7
|
*/
|
|
8
|
-
import type { CreateExpenseBody, CreateExpensePaymentBody, CreateExpenseRecognitionBody, CustomExpenseWrite, Error, Expense, ExpenseCategoryReportResponse, ExpenseDuplicateConflictError, ExpenseRecognitionBackfill, ExpenseRecognitionBackfillResponse, ExpenseRecognitionCreateResponse, ExpenseRecognitionJob, ExpenseRecognitionLookupResponse, ExpenseRecognitionSettingsResponse, ExportExpensesParams, FileMetadata, GetExpenseAttachments200, GetExpenseAttachmentsParams, GetExpenseCategoryReportParams, GetExpensePayments200, GetExpenses200, GetExpensesParams, IdempotencyError, Payment, UpdateExpenseBody, UpdateExpenseRecognitionSettings, UploadExpenseAttachmentBody, ValidationError } from '../model/index.cjs';
|
|
8
|
+
import type { CreateExpenseBody, CreateExpensePaymentBody, CreateExpenseRecognitionBody, CustomExpenseWrite, Error, Expense, ExpenseCategoryReportResponse, ExpenseDuplicateConflictError, ExpensePaymentOpenBalanceError, ExpenseRecognitionBackfill, ExpenseRecognitionBackfillResponse, ExpenseRecognitionCreateResponse, ExpenseRecognitionJob, ExpenseRecognitionLookupResponse, ExpenseRecognitionSettingsResponse, ExportExpensesParams, FileMetadata, GetExpenseAttachments200, GetExpenseAttachmentsParams, GetExpenseCategoryReportParams, GetExpensePayments200, GetExpenses200, GetExpensesParams, IdempotencyError, Payment, UpdateExpenseBody, UpdateExpenseRecognitionSettings, UploadExpenseAttachmentBody, ValidationError } from '../model/index.cjs';
|
|
9
9
|
/**
|
|
10
10
|
* This is the recommended endpoint for normal expense creation. Use it when Space Invoices should validate the supplied totals, tax summaries, and line items, then apply supplier handling, payment tracking initialization, and lifecycle rules.
|
|
11
11
|
* @summary Create expense
|
|
@@ -35,7 +35,7 @@ export type createExpenseResponse409 = {
|
|
|
35
35
|
status: 409;
|
|
36
36
|
};
|
|
37
37
|
export type createExpenseResponse422 = {
|
|
38
|
-
data: ValidationError;
|
|
38
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
39
39
|
status: 422;
|
|
40
40
|
};
|
|
41
41
|
export type createExpenseResponse500 = {
|
|
@@ -124,7 +124,7 @@ export type createCustomExpenseResponse409 = {
|
|
|
124
124
|
status: 409;
|
|
125
125
|
};
|
|
126
126
|
export type createCustomExpenseResponse422 = {
|
|
127
|
-
data: ValidationError;
|
|
127
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
128
128
|
status: 422;
|
|
129
129
|
};
|
|
130
130
|
export type createCustomExpenseResponse500 = {
|
|
@@ -896,6 +896,7 @@ export type getExpensePaymentsResponse = (getExpensePaymentsResponseSuccess | ge
|
|
|
896
896
|
export declare const getGetExpensePaymentsUrl: (id: string) => string;
|
|
897
897
|
export declare const getExpensePayments: (id: string, options?: RequestInit) => Promise<getExpensePaymentsResponse>;
|
|
898
898
|
/**
|
|
899
|
+
* Record a direct payment against a finalized supplier invoice expense. The payment is capped at the expense's open balance (total_with_tax minus the payments already recorded), compared at the currency's minor unit (0.01 EUR, 1 JPY, 0.001 KWD). A payment that would exceed it returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and records nothing. Concurrent payments on one expense are serialized, so they can never together exceed its total.
|
|
899
900
|
* @summary Create a payment for an expense
|
|
900
901
|
*/
|
|
901
902
|
export type createExpensePaymentResponse201 = {
|
|
@@ -923,7 +924,7 @@ export type createExpensePaymentResponse409 = {
|
|
|
923
924
|
status: 409;
|
|
924
925
|
};
|
|
925
926
|
export type createExpensePaymentResponse422 = {
|
|
926
|
-
data: ValidationError;
|
|
927
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
927
928
|
status: 422;
|
|
928
929
|
};
|
|
929
930
|
export type createExpensePaymentResponse500 = {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking.
|
|
6
6
|
* OpenAPI spec version: 1.0.0
|
|
7
7
|
*/
|
|
8
|
-
import type { CreateExpenseBody, CreateExpensePaymentBody, CreateExpenseRecognitionBody, CustomExpenseWrite, Error, Expense, ExpenseCategoryReportResponse, ExpenseDuplicateConflictError, ExpenseRecognitionBackfill, ExpenseRecognitionBackfillResponse, ExpenseRecognitionCreateResponse, ExpenseRecognitionJob, ExpenseRecognitionLookupResponse, ExpenseRecognitionSettingsResponse, ExportExpensesParams, FileMetadata, GetExpenseAttachments200, GetExpenseAttachmentsParams, GetExpenseCategoryReportParams, GetExpensePayments200, GetExpenses200, GetExpensesParams, IdempotencyError, Payment, UpdateExpenseBody, UpdateExpenseRecognitionSettings, UploadExpenseAttachmentBody, ValidationError } from '../model/index.js';
|
|
8
|
+
import type { CreateExpenseBody, CreateExpensePaymentBody, CreateExpenseRecognitionBody, CustomExpenseWrite, Error, Expense, ExpenseCategoryReportResponse, ExpenseDuplicateConflictError, ExpensePaymentOpenBalanceError, ExpenseRecognitionBackfill, ExpenseRecognitionBackfillResponse, ExpenseRecognitionCreateResponse, ExpenseRecognitionJob, ExpenseRecognitionLookupResponse, ExpenseRecognitionSettingsResponse, ExportExpensesParams, FileMetadata, GetExpenseAttachments200, GetExpenseAttachmentsParams, GetExpenseCategoryReportParams, GetExpensePayments200, GetExpenses200, GetExpensesParams, IdempotencyError, Payment, UpdateExpenseBody, UpdateExpenseRecognitionSettings, UploadExpenseAttachmentBody, ValidationError } from '../model/index.js';
|
|
9
9
|
/**
|
|
10
10
|
* This is the recommended endpoint for normal expense creation. Use it when Space Invoices should validate the supplied totals, tax summaries, and line items, then apply supplier handling, payment tracking initialization, and lifecycle rules.
|
|
11
11
|
* @summary Create expense
|
|
@@ -35,7 +35,7 @@ export type createExpenseResponse409 = {
|
|
|
35
35
|
status: 409;
|
|
36
36
|
};
|
|
37
37
|
export type createExpenseResponse422 = {
|
|
38
|
-
data: ValidationError;
|
|
38
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
39
39
|
status: 422;
|
|
40
40
|
};
|
|
41
41
|
export type createExpenseResponse500 = {
|
|
@@ -124,7 +124,7 @@ export type createCustomExpenseResponse409 = {
|
|
|
124
124
|
status: 409;
|
|
125
125
|
};
|
|
126
126
|
export type createCustomExpenseResponse422 = {
|
|
127
|
-
data: ValidationError;
|
|
127
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
128
128
|
status: 422;
|
|
129
129
|
};
|
|
130
130
|
export type createCustomExpenseResponse500 = {
|
|
@@ -896,6 +896,7 @@ export type getExpensePaymentsResponse = (getExpensePaymentsResponseSuccess | ge
|
|
|
896
896
|
export declare const getGetExpensePaymentsUrl: (id: string) => string;
|
|
897
897
|
export declare const getExpensePayments: (id: string, options?: RequestInit) => Promise<getExpensePaymentsResponse>;
|
|
898
898
|
/**
|
|
899
|
+
* Record a direct payment against a finalized supplier invoice expense. The payment is capped at the expense's open balance (total_with_tax minus the payments already recorded), compared at the currency's minor unit (0.01 EUR, 1 JPY, 0.001 KWD). A payment that would exceed it returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and records nothing. Concurrent payments on one expense are serialized, so they can never together exceed its total.
|
|
899
900
|
* @summary Create a payment for an expense
|
|
900
901
|
*/
|
|
901
902
|
export type createExpensePaymentResponse201 = {
|
|
@@ -923,7 +924,7 @@ export type createExpensePaymentResponse409 = {
|
|
|
923
924
|
status: 409;
|
|
924
925
|
};
|
|
925
926
|
export type createExpensePaymentResponse422 = {
|
|
926
|
-
data: ValidationError;
|
|
927
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
927
928
|
status: 422;
|
|
928
929
|
};
|
|
929
930
|
export type createExpensePaymentResponse500 = {
|
|
@@ -91,7 +91,7 @@ export type CreateExpenseBody = {
|
|
|
91
91
|
*/
|
|
92
92
|
expected_total_with_tax?: number | null;
|
|
93
93
|
/**
|
|
94
|
-
* Optional payments to record with the expense. If amounts are omitted, the remaining total_with_tax is split equally. Automatically updates expense payment status.
|
|
94
|
+
* Optional payments to record with the expense. If amounts are omitted, the remaining total_with_tax is split equally. Explicit amounts together may not exceed total_with_tax; otherwise the request returns 422 with `cause.code` `expense_payment_exceeds_open_balance` and creates nothing. Automatically updates expense payment status.
|
|
95
95
|
* @nullable
|
|
96
96
|
*/
|
|
97
97
|
payments?: CreateExpenseBodyPaymentsItem[] | null;
|
|
@@ -91,7 +91,7 @@ export type CreateExpenseBody = {
|
|
|
91
91
|
*/
|
|
92
92
|
expected_total_with_tax?: number | null;
|
|
93
93
|
/**
|
|
94
|
-
* Optional payments to record with the expense. If amounts are omitted, the remaining total_with_tax is split equally. Automatically updates expense payment status.
|
|
94
|
+
* Optional payments to record with the expense. If amounts are omitted, the remaining total_with_tax is split equally. Explicit amounts together may not exceed total_with_tax; otherwise the request returns 422 with `cause.code` `expense_payment_exceeds_open_balance` and creates nothing. Automatically updates expense payment status.
|
|
95
95
|
* @nullable
|
|
96
96
|
*/
|
|
97
97
|
payments?: CreateExpenseBodyPaymentsItem[] | null;
|
|
@@ -88,7 +88,7 @@ export interface CustomExpenseWrite {
|
|
|
88
88
|
*/
|
|
89
89
|
expected_total_with_tax?: number | null;
|
|
90
90
|
/**
|
|
91
|
-
* Optional payments to record with the expense. If amounts are omitted, the remaining total_with_tax is split equally. Automatically updates expense payment status.
|
|
91
|
+
* Optional payments to record with the expense. If amounts are omitted, the remaining total_with_tax is split equally. Explicit amounts together may not exceed total_with_tax; otherwise the request returns 422 with `cause.code` `expense_payment_exceeds_open_balance` and creates nothing. Automatically updates expense payment status.
|
|
92
92
|
* @nullable
|
|
93
93
|
*/
|
|
94
94
|
payments?: CustomExpenseWritePaymentsItem[] | null;
|
|
@@ -88,7 +88,7 @@ export interface CustomExpenseWrite {
|
|
|
88
88
|
*/
|
|
89
89
|
expected_total_with_tax?: number | null;
|
|
90
90
|
/**
|
|
91
|
-
* Optional payments to record with the expense. If amounts are omitted, the remaining total_with_tax is split equally. Automatically updates expense payment status.
|
|
91
|
+
* Optional payments to record with the expense. If amounts are omitted, the remaining total_with_tax is split equally. Explicit amounts together may not exceed total_with_tax; otherwise the request returns 422 with `cause.code` `expense_payment_exceeds_open_balance` and creates nothing. Automatically updates expense payment status.
|
|
92
92
|
* @nullable
|
|
93
93
|
*/
|
|
94
94
|
payments?: CustomExpenseWritePaymentsItem[] | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.5.3 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Space Invoices API
|
|
5
|
+
* REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import type { Error } from './error.cjs';
|
|
9
|
+
import type { ExpensePaymentOpenBalanceErrorCause } from './expensePaymentOpenBalanceErrorCause.cjs';
|
|
10
|
+
/**
|
|
11
|
+
* An expense payment would exceed the expense's open balance by at least half of the currency's minor unit (0.01 EUR, 1 JPY, 0.001 KWD). Nothing was recorded.
|
|
12
|
+
*/
|
|
13
|
+
export type ExpensePaymentOpenBalanceError = Error & {
|
|
14
|
+
cause: ExpensePaymentOpenBalanceErrorCause;
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.5.3 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Space Invoices API
|
|
5
|
+
* REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import type { Error } from './error.js';
|
|
9
|
+
import type { ExpensePaymentOpenBalanceErrorCause } from './expensePaymentOpenBalanceErrorCause.js';
|
|
10
|
+
/**
|
|
11
|
+
* An expense payment would exceed the expense's open balance by at least half of the currency's minor unit (0.01 EUR, 1 JPY, 0.001 KWD). Nothing was recorded.
|
|
12
|
+
*/
|
|
13
|
+
export type ExpensePaymentOpenBalanceError = Error & {
|
|
14
|
+
cause: ExpensePaymentOpenBalanceErrorCause;
|
|
15
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.5.3 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Space Invoices API
|
|
5
|
+
* REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import type { ExpensePaymentOpenBalanceErrorCauseCode } from './expensePaymentOpenBalanceErrorCauseCode.cjs';
|
|
9
|
+
export type ExpensePaymentOpenBalanceErrorCause = {
|
|
10
|
+
code: ExpensePaymentOpenBalanceErrorCauseCode;
|
|
11
|
+
/**
|
|
12
|
+
* The expense the payment is for; null when the expense was being created in the same request.
|
|
13
|
+
* @nullable
|
|
14
|
+
*/
|
|
15
|
+
expense_id: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Currency of the expense and its payments.
|
|
18
|
+
* @nullable
|
|
19
|
+
*/
|
|
20
|
+
currency_code: string | null;
|
|
21
|
+
/** The requested payment amount as sent, in the expense currency's major unit (for inline payments on expense create, their sum). */
|
|
22
|
+
amount: number;
|
|
23
|
+
/** The largest amount at the currency's minor-unit precision that this payment can have. When it is above zero, retrying with it is accepted; zero means no whole minor unit can be recorded. It is based on the open balance for a new or restored payment, and on the open balance plus the payment's current amount for an amount edit. */
|
|
24
|
+
max_amount: number;
|
|
25
|
+
/** The expense's open balance (total_with_tax minus the payments already recorded) at the currency's minor-unit precision, never negative. */
|
|
26
|
+
open_balance: number;
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.5.3 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Space Invoices API
|
|
5
|
+
* REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import type { ExpensePaymentOpenBalanceErrorCauseCode } from './expensePaymentOpenBalanceErrorCauseCode.js';
|
|
9
|
+
export type ExpensePaymentOpenBalanceErrorCause = {
|
|
10
|
+
code: ExpensePaymentOpenBalanceErrorCauseCode;
|
|
11
|
+
/**
|
|
12
|
+
* The expense the payment is for; null when the expense was being created in the same request.
|
|
13
|
+
* @nullable
|
|
14
|
+
*/
|
|
15
|
+
expense_id: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Currency of the expense and its payments.
|
|
18
|
+
* @nullable
|
|
19
|
+
*/
|
|
20
|
+
currency_code: string | null;
|
|
21
|
+
/** The requested payment amount as sent, in the expense currency's major unit (for inline payments on expense create, their sum). */
|
|
22
|
+
amount: number;
|
|
23
|
+
/** The largest amount at the currency's minor-unit precision that this payment can have. When it is above zero, retrying with it is accepted; zero means no whole minor unit can be recorded. It is based on the open balance for a new or restored payment, and on the open balance plus the payment's current amount for an amount edit. */
|
|
24
|
+
max_amount: number;
|
|
25
|
+
/** The expense's open balance (total_with_tax minus the payments already recorded) at the currency's minor-unit precision, never negative. */
|
|
26
|
+
open_balance: number;
|
|
27
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.5.3 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Space Invoices API
|
|
5
|
+
* REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
export type ExpensePaymentOpenBalanceErrorCauseCode = typeof ExpensePaymentOpenBalanceErrorCauseCode[keyof typeof ExpensePaymentOpenBalanceErrorCauseCode];
|
|
9
|
+
export declare const ExpensePaymentOpenBalanceErrorCauseCode: {
|
|
10
|
+
readonly expense_payment_exceeds_open_balance: "expense_payment_exceeds_open_balance";
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v8.5.3 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Space Invoices API
|
|
5
|
+
* REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
export type ExpensePaymentOpenBalanceErrorCauseCode = typeof ExpensePaymentOpenBalanceErrorCauseCode[keyof typeof ExpensePaymentOpenBalanceErrorCauseCode];
|
|
9
|
+
export declare const ExpensePaymentOpenBalanceErrorCauseCode: {
|
|
10
|
+
readonly expense_payment_exceeds_open_balance: "expense_payment_exceeds_open_balance";
|
|
11
|
+
};
|
|
@@ -570,6 +570,9 @@ export * from './expenseItemRecognitionMethod.cjs';
|
|
|
570
570
|
export * from './expenseItemTranslations.cjs';
|
|
571
571
|
export * from './expenseItemType.cjs';
|
|
572
572
|
export * from './expenseMetadata.cjs';
|
|
573
|
+
export * from './expensePaymentOpenBalanceError.cjs';
|
|
574
|
+
export * from './expensePaymentOpenBalanceErrorCause.cjs';
|
|
575
|
+
export * from './expensePaymentOpenBalanceErrorCauseCode.cjs';
|
|
573
576
|
export * from './expenseRecognitionBackfill.cjs';
|
|
574
577
|
export * from './expenseRecognitionBackfillResponse.cjs';
|
|
575
578
|
export * from './expenseRecognitionCreateResponse.cjs';
|
|
@@ -570,6 +570,9 @@ export * from './expenseItemRecognitionMethod.js';
|
|
|
570
570
|
export * from './expenseItemTranslations.js';
|
|
571
571
|
export * from './expenseItemType.js';
|
|
572
572
|
export * from './expenseMetadata.js';
|
|
573
|
+
export * from './expensePaymentOpenBalanceError.js';
|
|
574
|
+
export * from './expensePaymentOpenBalanceErrorCause.js';
|
|
575
|
+
export * from './expensePaymentOpenBalanceErrorCauseCode.js';
|
|
573
576
|
export * from './expenseRecognitionBackfill.js';
|
|
574
577
|
export * from './expenseRecognitionBackfillResponse.js';
|
|
575
578
|
export * from './expenseRecognitionCreateResponse.js';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking.
|
|
6
6
|
* OpenAPI spec version: 1.0.0
|
|
7
7
|
*/
|
|
8
|
-
import type { CreatePaymentBody, Error, FiscalRecoveryError, GetPaymentByIdParams, GetPayments200, GetPaymentsParams, IdempotencyError, Payment, UpdatePaymentBody, ValidationError } from '../model/index.cjs';
|
|
8
|
+
import type { CreatePaymentBody, Error, ExpensePaymentOpenBalanceError, FiscalRecoveryError, GetPaymentByIdParams, GetPayments200, GetPaymentsParams, IdempotencyError, Payment, UpdatePaymentBody, ValidationError } from '../model/index.cjs';
|
|
9
9
|
/**
|
|
10
10
|
* Record a payment against an outgoing document or a supplier expense.
|
|
11
11
|
At least one document reference is required.
|
|
@@ -16,6 +16,7 @@ Expense payments support direct supplier invoice payments in V1; AP credit-note
|
|
|
16
16
|
Document payment totals are automatically updated. Ordinary payments on invoices with linked advances atomically reduce the auto-applied advance amount so combined settlement never exceeds the invoice total.
|
|
17
17
|
Credit note refunds or settlements cannot exceed the remaining credit balance.
|
|
18
18
|
Draft advance invoices may accumulate payments up to their total and must be fully paid before they can be issued. Issued advance invoices must retain exact full payment coverage.
|
|
19
|
+
Expense payments are capped at the expense's open balance (total_with_tax minus the payments already recorded), compared at the currency's minor unit (0.01 EUR, 1 JPY, 0.001 KWD). A payment that would exceed it returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and records nothing. Concurrent payments on one expense are serialized, so they can never together exceed its total.
|
|
19
20
|
* @summary Create a new payment
|
|
20
21
|
*/
|
|
21
22
|
export type createPaymentResponse201 = {
|
|
@@ -43,7 +44,7 @@ export type createPaymentResponse409 = {
|
|
|
43
44
|
status: 409;
|
|
44
45
|
};
|
|
45
46
|
export type createPaymentResponse422 = {
|
|
46
|
-
data: ValidationError;
|
|
47
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
47
48
|
status: 422;
|
|
48
49
|
};
|
|
49
50
|
export type createPaymentResponse500 = {
|
|
@@ -140,6 +141,7 @@ Document references cannot be changed.
|
|
|
140
141
|
If amount is changed, payment totals on all linked outgoing or incoming documents are automatically recalculated. Ordinary invoice payment increases atomically reduce any linked advance allocation.
|
|
141
142
|
System-managed settlement payments cannot be modified.
|
|
142
143
|
For active issued advance invoices, non-amount metadata may be updated, but amount changes must preserve exact full payment coverage.
|
|
144
|
+
An expense payment's amount can be raised up to the expense's open balance plus the payment's current amount; a larger amount returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and leaves the payment unchanged. Lowering an amount is always allowed.
|
|
143
145
|
|
|
144
146
|
Changing `type` on a payment attached to a fiscalized invoice is not a local edit — the payment method is part of what was reported, so the change is validated and, in Croatia, reported onward. A `422` carries a `cause.code` naming which rule applied:
|
|
145
147
|
|
|
@@ -176,7 +178,7 @@ export type updatePaymentResponse409 = {
|
|
|
176
178
|
status: 409;
|
|
177
179
|
};
|
|
178
180
|
export type updatePaymentResponse422 = {
|
|
179
|
-
data: ValidationError;
|
|
181
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
180
182
|
status: 422;
|
|
181
183
|
};
|
|
182
184
|
export type updatePaymentResponse500 = {
|
|
@@ -238,7 +240,7 @@ export type deletePaymentResponse = (deletePaymentResponseSuccess | deletePaymen
|
|
|
238
240
|
export declare const getDeletePaymentUrl: (id: string) => string;
|
|
239
241
|
export declare const deletePayment: (id: string, options?: RequestInit) => Promise<deletePaymentResponse>;
|
|
240
242
|
/**
|
|
241
|
-
* Restore a soft-deleted payment from the trash. Document payment totals are automatically recalculated. Restoring an ordinary invoice payment atomically reduces any linked advance allocation when needed to keep combined settlement within the invoice total.
|
|
243
|
+
* Restore a soft-deleted payment from the trash. Document payment totals are automatically recalculated. Restoring an ordinary invoice payment atomically reduces any linked advance allocation when needed to keep combined settlement within the invoice total. A restored expense payment must fit the expense's open balance; otherwise the request returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and the payment stays deleted.
|
|
242
244
|
* @summary Restore a deleted payment
|
|
243
245
|
*/
|
|
244
246
|
export type restorePaymentResponse200 = {
|
|
@@ -262,7 +264,7 @@ export type restorePaymentResponse404 = {
|
|
|
262
264
|
status: 404;
|
|
263
265
|
};
|
|
264
266
|
export type restorePaymentResponse422 = {
|
|
265
|
-
data: ValidationError;
|
|
267
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
266
268
|
status: 422;
|
|
267
269
|
};
|
|
268
270
|
export type restorePaymentResponse500 = {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* REST API for invoice management, customer management, and accounting operations. Features include cursor-based pagination for efficient data navigation, flexible JSON querying with MongoDB-style operators, full-text search across multiple fields, and comprehensive metadata support for custom tracking.
|
|
6
6
|
* OpenAPI spec version: 1.0.0
|
|
7
7
|
*/
|
|
8
|
-
import type { CreatePaymentBody, Error, FiscalRecoveryError, GetPaymentByIdParams, GetPayments200, GetPaymentsParams, IdempotencyError, Payment, UpdatePaymentBody, ValidationError } from '../model/index.js';
|
|
8
|
+
import type { CreatePaymentBody, Error, ExpensePaymentOpenBalanceError, FiscalRecoveryError, GetPaymentByIdParams, GetPayments200, GetPaymentsParams, IdempotencyError, Payment, UpdatePaymentBody, ValidationError } from '../model/index.js';
|
|
9
9
|
/**
|
|
10
10
|
* Record a payment against an outgoing document or a supplier expense.
|
|
11
11
|
At least one document reference is required.
|
|
@@ -16,6 +16,7 @@ Expense payments support direct supplier invoice payments in V1; AP credit-note
|
|
|
16
16
|
Document payment totals are automatically updated. Ordinary payments on invoices with linked advances atomically reduce the auto-applied advance amount so combined settlement never exceeds the invoice total.
|
|
17
17
|
Credit note refunds or settlements cannot exceed the remaining credit balance.
|
|
18
18
|
Draft advance invoices may accumulate payments up to their total and must be fully paid before they can be issued. Issued advance invoices must retain exact full payment coverage.
|
|
19
|
+
Expense payments are capped at the expense's open balance (total_with_tax minus the payments already recorded), compared at the currency's minor unit (0.01 EUR, 1 JPY, 0.001 KWD). A payment that would exceed it returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and records nothing. Concurrent payments on one expense are serialized, so they can never together exceed its total.
|
|
19
20
|
* @summary Create a new payment
|
|
20
21
|
*/
|
|
21
22
|
export type createPaymentResponse201 = {
|
|
@@ -43,7 +44,7 @@ export type createPaymentResponse409 = {
|
|
|
43
44
|
status: 409;
|
|
44
45
|
};
|
|
45
46
|
export type createPaymentResponse422 = {
|
|
46
|
-
data: ValidationError;
|
|
47
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
47
48
|
status: 422;
|
|
48
49
|
};
|
|
49
50
|
export type createPaymentResponse500 = {
|
|
@@ -140,6 +141,7 @@ Document references cannot be changed.
|
|
|
140
141
|
If amount is changed, payment totals on all linked outgoing or incoming documents are automatically recalculated. Ordinary invoice payment increases atomically reduce any linked advance allocation.
|
|
141
142
|
System-managed settlement payments cannot be modified.
|
|
142
143
|
For active issued advance invoices, non-amount metadata may be updated, but amount changes must preserve exact full payment coverage.
|
|
144
|
+
An expense payment's amount can be raised up to the expense's open balance plus the payment's current amount; a larger amount returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and leaves the payment unchanged. Lowering an amount is always allowed.
|
|
143
145
|
|
|
144
146
|
Changing `type` on a payment attached to a fiscalized invoice is not a local edit — the payment method is part of what was reported, so the change is validated and, in Croatia, reported onward. A `422` carries a `cause.code` naming which rule applied:
|
|
145
147
|
|
|
@@ -176,7 +178,7 @@ export type updatePaymentResponse409 = {
|
|
|
176
178
|
status: 409;
|
|
177
179
|
};
|
|
178
180
|
export type updatePaymentResponse422 = {
|
|
179
|
-
data: ValidationError;
|
|
181
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
180
182
|
status: 422;
|
|
181
183
|
};
|
|
182
184
|
export type updatePaymentResponse500 = {
|
|
@@ -238,7 +240,7 @@ export type deletePaymentResponse = (deletePaymentResponseSuccess | deletePaymen
|
|
|
238
240
|
export declare const getDeletePaymentUrl: (id: string) => string;
|
|
239
241
|
export declare const deletePayment: (id: string, options?: RequestInit) => Promise<deletePaymentResponse>;
|
|
240
242
|
/**
|
|
241
|
-
* Restore a soft-deleted payment from the trash. Document payment totals are automatically recalculated. Restoring an ordinary invoice payment atomically reduces any linked advance allocation when needed to keep combined settlement within the invoice total.
|
|
243
|
+
* Restore a soft-deleted payment from the trash. Document payment totals are automatically recalculated. Restoring an ordinary invoice payment atomically reduces any linked advance allocation when needed to keep combined settlement within the invoice total. A restored expense payment must fit the expense's open balance; otherwise the request returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and the payment stays deleted.
|
|
242
244
|
* @summary Restore a deleted payment
|
|
243
245
|
*/
|
|
244
246
|
export type restorePaymentResponse200 = {
|
|
@@ -262,7 +264,7 @@ export type restorePaymentResponse404 = {
|
|
|
262
264
|
status: 404;
|
|
263
265
|
};
|
|
264
266
|
export type restorePaymentResponse422 = {
|
|
265
|
-
data: ValidationError;
|
|
267
|
+
data: ExpensePaymentOpenBalanceError | ValidationError;
|
|
266
268
|
status: 422;
|
|
267
269
|
};
|
|
268
270
|
export type restorePaymentResponse500 = {
|
|
@@ -2953,6 +2953,7 @@ export declare const GetExpensePaymentsResponse: zod.ZodObject<{
|
|
|
2953
2953
|
}, zod.z.core.$strip>;
|
|
2954
2954
|
}, zod.z.core.$strip>;
|
|
2955
2955
|
/**
|
|
2956
|
+
* Record a direct payment against a finalized supplier invoice expense. The payment is capped at the expense's open balance (total_with_tax minus the payments already recorded), compared at the currency's minor unit (0.01 EUR, 1 JPY, 0.001 KWD). A payment that would exceed it returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and records nothing. Concurrent payments on one expense are serialized, so they can never together exceed its total.
|
|
2956
2957
|
* @summary Create a payment for an expense
|
|
2957
2958
|
*/
|
|
2958
2959
|
export declare const CreateExpensePaymentParams: zod.ZodObject<{
|
|
@@ -2953,6 +2953,7 @@ export declare const GetExpensePaymentsResponse: zod.ZodObject<{
|
|
|
2953
2953
|
}, zod.z.core.$strip>;
|
|
2954
2954
|
}, zod.z.core.$strip>;
|
|
2955
2955
|
/**
|
|
2956
|
+
* Record a direct payment against a finalized supplier invoice expense. The payment is capped at the expense's open balance (total_with_tax minus the payments already recorded), compared at the currency's minor unit (0.01 EUR, 1 JPY, 0.001 KWD). A payment that would exceed it returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and records nothing. Concurrent payments on one expense are serialized, so they can never together exceed its total.
|
|
2956
2957
|
* @summary Create a payment for an expense
|
|
2957
2958
|
*/
|
|
2958
2959
|
export declare const CreateExpensePaymentParams: zod.ZodObject<{
|
|
@@ -16,6 +16,7 @@ Expense payments support direct supplier invoice payments in V1; AP credit-note
|
|
|
16
16
|
Document payment totals are automatically updated. Ordinary payments on invoices with linked advances atomically reduce the auto-applied advance amount so combined settlement never exceeds the invoice total.
|
|
17
17
|
Credit note refunds or settlements cannot exceed the remaining credit balance.
|
|
18
18
|
Draft advance invoices may accumulate payments up to their total and must be fully paid before they can be issued. Issued advance invoices must retain exact full payment coverage.
|
|
19
|
+
Expense payments are capped at the expense's open balance (total_with_tax minus the payments already recorded), compared at the currency's minor unit (0.01 EUR, 1 JPY, 0.001 KWD). A payment that would exceed it returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and records nothing. Concurrent payments on one expense are serialized, so they can never together exceed its total.
|
|
19
20
|
* @summary Create a new payment
|
|
20
21
|
*/
|
|
21
22
|
export declare const createPaymentHeaderXRequestIdMax = 100;
|
|
@@ -338,6 +339,7 @@ Document references cannot be changed.
|
|
|
338
339
|
If amount is changed, payment totals on all linked outgoing or incoming documents are automatically recalculated. Ordinary invoice payment increases atomically reduce any linked advance allocation.
|
|
339
340
|
System-managed settlement payments cannot be modified.
|
|
340
341
|
For active issued advance invoices, non-amount metadata may be updated, but amount changes must preserve exact full payment coverage.
|
|
342
|
+
An expense payment's amount can be raised up to the expense's open balance plus the payment's current amount; a larger amount returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and leaves the payment unchanged. Lowering an amount is always allowed.
|
|
341
343
|
|
|
342
344
|
Changing `type` on a payment attached to a fiscalized invoice is not a local edit — the payment method is part of what was reported, so the change is validated and, in Croatia, reported onward. A `422` carries a `cause.code` naming which rule applied:
|
|
343
345
|
|
|
@@ -495,7 +497,7 @@ export declare const DeletePaymentHeader: zod.ZodObject<{
|
|
|
495
497
|
"x-entity-id": zod.ZodOptional<zod.ZodString>;
|
|
496
498
|
}, zod.z.core.$strip>;
|
|
497
499
|
/**
|
|
498
|
-
* Restore a soft-deleted payment from the trash. Document payment totals are automatically recalculated. Restoring an ordinary invoice payment atomically reduces any linked advance allocation when needed to keep combined settlement within the invoice total.
|
|
500
|
+
* Restore a soft-deleted payment from the trash. Document payment totals are automatically recalculated. Restoring an ordinary invoice payment atomically reduces any linked advance allocation when needed to keep combined settlement within the invoice total. A restored expense payment must fit the expense's open balance; otherwise the request returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and the payment stays deleted.
|
|
499
501
|
* @summary Restore a deleted payment
|
|
500
502
|
*/
|
|
501
503
|
export declare const restorePaymentPathIdRegExp: RegExp;
|
|
@@ -16,6 +16,7 @@ Expense payments support direct supplier invoice payments in V1; AP credit-note
|
|
|
16
16
|
Document payment totals are automatically updated. Ordinary payments on invoices with linked advances atomically reduce the auto-applied advance amount so combined settlement never exceeds the invoice total.
|
|
17
17
|
Credit note refunds or settlements cannot exceed the remaining credit balance.
|
|
18
18
|
Draft advance invoices may accumulate payments up to their total and must be fully paid before they can be issued. Issued advance invoices must retain exact full payment coverage.
|
|
19
|
+
Expense payments are capped at the expense's open balance (total_with_tax minus the payments already recorded), compared at the currency's minor unit (0.01 EUR, 1 JPY, 0.001 KWD). A payment that would exceed it returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and records nothing. Concurrent payments on one expense are serialized, so they can never together exceed its total.
|
|
19
20
|
* @summary Create a new payment
|
|
20
21
|
*/
|
|
21
22
|
export declare const createPaymentHeaderXRequestIdMax = 100;
|
|
@@ -338,6 +339,7 @@ Document references cannot be changed.
|
|
|
338
339
|
If amount is changed, payment totals on all linked outgoing or incoming documents are automatically recalculated. Ordinary invoice payment increases atomically reduce any linked advance allocation.
|
|
339
340
|
System-managed settlement payments cannot be modified.
|
|
340
341
|
For active issued advance invoices, non-amount metadata may be updated, but amount changes must preserve exact full payment coverage.
|
|
342
|
+
An expense payment's amount can be raised up to the expense's open balance plus the payment's current amount; a larger amount returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and leaves the payment unchanged. Lowering an amount is always allowed.
|
|
341
343
|
|
|
342
344
|
Changing `type` on a payment attached to a fiscalized invoice is not a local edit — the payment method is part of what was reported, so the change is validated and, in Croatia, reported onward. A `422` carries a `cause.code` naming which rule applied:
|
|
343
345
|
|
|
@@ -495,7 +497,7 @@ export declare const DeletePaymentHeader: zod.ZodObject<{
|
|
|
495
497
|
"x-entity-id": zod.ZodOptional<zod.ZodString>;
|
|
496
498
|
}, zod.z.core.$strip>;
|
|
497
499
|
/**
|
|
498
|
-
* Restore a soft-deleted payment from the trash. Document payment totals are automatically recalculated. Restoring an ordinary invoice payment atomically reduces any linked advance allocation when needed to keep combined settlement within the invoice total.
|
|
500
|
+
* Restore a soft-deleted payment from the trash. Document payment totals are automatically recalculated. Restoring an ordinary invoice payment atomically reduces any linked advance allocation when needed to keep combined settlement within the invoice total. A restored expense payment must fit the expense's open balance; otherwise the request returns `422` with `cause.code` `expense_payment_exceeds_open_balance` and the payment stays deleted.
|
|
499
501
|
* @summary Restore a deleted payment
|
|
500
502
|
*/
|
|
501
503
|
export declare const restorePaymentPathIdRegExp: RegExp;
|