@soledgic/sdk 0.2.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/README.md +212 -0
- package/dist/index.d.mts +1636 -0
- package/dist/index.d.ts +1636 -0
- package/dist/index.js +2227 -0
- package/dist/index.mjs +2183 -0
- package/package.json +54 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1636 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Soledgic SDK Type Definitions
|
|
3
|
+
* All request/response interfaces and type aliases
|
|
4
|
+
*/
|
|
5
|
+
interface SoledgicConfig {
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/** API base URL. Defaults to https://api.soledgic.com/v1. */
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
/** Request timeout in milliseconds. Default: 30000 (30s). */
|
|
10
|
+
timeout?: number;
|
|
11
|
+
/** API version header to send with requests. Default: 2026-03-01. */
|
|
12
|
+
apiVersion?: string;
|
|
13
|
+
}
|
|
14
|
+
type WebhookPayloadInput = string | ArrayBuffer | ArrayBufferView | Record<string, unknown>;
|
|
15
|
+
interface VerifyWebhookSignatureOptions {
|
|
16
|
+
toleranceSeconds?: number;
|
|
17
|
+
now?: number | Date;
|
|
18
|
+
}
|
|
19
|
+
interface ParsedWebhookEvent<T = Record<string, unknown>> {
|
|
20
|
+
id: string | null;
|
|
21
|
+
type: string;
|
|
22
|
+
createdAt: string | null;
|
|
23
|
+
livemode: boolean | null;
|
|
24
|
+
data: T | null;
|
|
25
|
+
raw: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
interface WebhookEndpoint {
|
|
28
|
+
id: string;
|
|
29
|
+
url: string;
|
|
30
|
+
description: string | null;
|
|
31
|
+
events: string[];
|
|
32
|
+
isActive: boolean;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
secretRotatedAt: string | null;
|
|
35
|
+
}
|
|
36
|
+
interface WebhookEndpointSecretResult extends WebhookEndpoint {
|
|
37
|
+
secret: string | null;
|
|
38
|
+
}
|
|
39
|
+
interface WebhookDelivery {
|
|
40
|
+
id: string;
|
|
41
|
+
endpointId: string | null;
|
|
42
|
+
endpointUrl: string | null;
|
|
43
|
+
eventType: string;
|
|
44
|
+
status: string;
|
|
45
|
+
attempts: number;
|
|
46
|
+
maxAttempts: number | null;
|
|
47
|
+
responseStatus: number | null;
|
|
48
|
+
responseBody: string | null;
|
|
49
|
+
responseTimeMs: number | null;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
deliveredAt: string | null;
|
|
52
|
+
nextRetryAt: string | null;
|
|
53
|
+
payload: Record<string, unknown> | null;
|
|
54
|
+
}
|
|
55
|
+
interface RecordIncomeRequest {
|
|
56
|
+
referenceId: string;
|
|
57
|
+
amount: number;
|
|
58
|
+
description?: string;
|
|
59
|
+
category?: string;
|
|
60
|
+
customerId?: string;
|
|
61
|
+
customerName?: string;
|
|
62
|
+
receivedTo?: string;
|
|
63
|
+
invoiceId?: string;
|
|
64
|
+
transactionDate?: string;
|
|
65
|
+
metadata?: Record<string, unknown>;
|
|
66
|
+
}
|
|
67
|
+
interface RecordExpenseRequest {
|
|
68
|
+
referenceId: string;
|
|
69
|
+
amount: number;
|
|
70
|
+
description?: string;
|
|
71
|
+
category?: string;
|
|
72
|
+
vendorId?: string;
|
|
73
|
+
vendorName?: string;
|
|
74
|
+
paidFrom?: 'cash' | 'credit_card' | string;
|
|
75
|
+
receiptUrl?: string;
|
|
76
|
+
taxDeductible?: boolean;
|
|
77
|
+
transactionDate?: string;
|
|
78
|
+
metadata?: Record<string, unknown>;
|
|
79
|
+
authorizingInstrumentId?: string;
|
|
80
|
+
riskEvaluationId?: string;
|
|
81
|
+
authorizationDecisionId?: string;
|
|
82
|
+
}
|
|
83
|
+
interface RecordBillRequest {
|
|
84
|
+
amount: number;
|
|
85
|
+
description: string;
|
|
86
|
+
vendorName: string;
|
|
87
|
+
vendorId?: string;
|
|
88
|
+
referenceId?: string;
|
|
89
|
+
dueDate?: string;
|
|
90
|
+
expenseCategory?: string;
|
|
91
|
+
paid?: boolean;
|
|
92
|
+
metadata?: Record<string, unknown>;
|
|
93
|
+
authorizingInstrumentId?: string;
|
|
94
|
+
riskEvaluationId?: string;
|
|
95
|
+
authorizationDecisionId?: string;
|
|
96
|
+
}
|
|
97
|
+
interface ExtractedTerms {
|
|
98
|
+
amount: number;
|
|
99
|
+
currency: string;
|
|
100
|
+
cadence?: 'one_time' | 'monthly' | 'quarterly' | 'annual' | 'weekly' | 'bi_weekly';
|
|
101
|
+
counterpartyName: string;
|
|
102
|
+
}
|
|
103
|
+
interface RegisterInstrumentRequest {
|
|
104
|
+
externalRef: string;
|
|
105
|
+
extractedTerms: ExtractedTerms;
|
|
106
|
+
}
|
|
107
|
+
interface RegisterInstrumentResponse {
|
|
108
|
+
success: boolean;
|
|
109
|
+
instrumentId: string;
|
|
110
|
+
fingerprint: string;
|
|
111
|
+
externalRef: string;
|
|
112
|
+
}
|
|
113
|
+
interface AuthorizationResult {
|
|
114
|
+
verified: boolean;
|
|
115
|
+
instrumentId: string;
|
|
116
|
+
externalRef: string;
|
|
117
|
+
mismatches?: string[];
|
|
118
|
+
}
|
|
119
|
+
interface ProjectIntentRequest {
|
|
120
|
+
authorizingInstrumentId: string;
|
|
121
|
+
untilDate: string;
|
|
122
|
+
horizonCount?: number;
|
|
123
|
+
}
|
|
124
|
+
interface ProjectIntentResponse {
|
|
125
|
+
success: boolean;
|
|
126
|
+
instrumentId: string;
|
|
127
|
+
externalRef: string;
|
|
128
|
+
cadence: string;
|
|
129
|
+
projectionsCreated: number;
|
|
130
|
+
projectionsRequested: number;
|
|
131
|
+
duplicatesSkipped: number;
|
|
132
|
+
dateRange: {
|
|
133
|
+
from: string;
|
|
134
|
+
to: string;
|
|
135
|
+
};
|
|
136
|
+
projectedDates: string[];
|
|
137
|
+
}
|
|
138
|
+
interface ProjectionMatch {
|
|
139
|
+
matched: boolean;
|
|
140
|
+
projectionId: string;
|
|
141
|
+
expectedDate: string;
|
|
142
|
+
instrumentId: string;
|
|
143
|
+
}
|
|
144
|
+
interface ObligationItem {
|
|
145
|
+
expectedDate: string;
|
|
146
|
+
amount: number;
|
|
147
|
+
currency: string;
|
|
148
|
+
counterparty: string | null;
|
|
149
|
+
}
|
|
150
|
+
interface Obligations {
|
|
151
|
+
pendingTotal: number;
|
|
152
|
+
pendingCount: number;
|
|
153
|
+
items: ObligationItem[];
|
|
154
|
+
}
|
|
155
|
+
interface BreachRisk {
|
|
156
|
+
atRisk: boolean;
|
|
157
|
+
shortfall: number;
|
|
158
|
+
coverageRatio: number;
|
|
159
|
+
}
|
|
160
|
+
type AlertType = 'breach_risk' | 'projection_created' | 'instrument_invalidated';
|
|
161
|
+
type AlertChannel = 'slack' | 'email' | 'webhook';
|
|
162
|
+
interface AlertThresholds {
|
|
163
|
+
coverageRatioBelow?: number;
|
|
164
|
+
shortfallAbove?: number;
|
|
165
|
+
}
|
|
166
|
+
interface SlackAlertConfig {
|
|
167
|
+
webhookUrl: string;
|
|
168
|
+
channel?: string;
|
|
169
|
+
}
|
|
170
|
+
interface EmailAlertConfig {
|
|
171
|
+
recipients: string[];
|
|
172
|
+
}
|
|
173
|
+
interface AlertConfiguration {
|
|
174
|
+
id: string;
|
|
175
|
+
alertType: AlertType;
|
|
176
|
+
channel: AlertChannel;
|
|
177
|
+
config: SlackAlertConfig | EmailAlertConfig | Record<string, any>;
|
|
178
|
+
thresholds: AlertThresholds;
|
|
179
|
+
isActive: boolean;
|
|
180
|
+
lastTriggeredAt?: string;
|
|
181
|
+
triggerCount: number;
|
|
182
|
+
createdAt: string;
|
|
183
|
+
}
|
|
184
|
+
interface CreateAlertRequest {
|
|
185
|
+
alertType: AlertType;
|
|
186
|
+
channel: AlertChannel;
|
|
187
|
+
config: SlackAlertConfig | EmailAlertConfig;
|
|
188
|
+
thresholds?: AlertThresholds;
|
|
189
|
+
isActive?: boolean;
|
|
190
|
+
}
|
|
191
|
+
interface UpdateAlertRequest {
|
|
192
|
+
configId: string;
|
|
193
|
+
config?: Partial<SlackAlertConfig | EmailAlertConfig>;
|
|
194
|
+
thresholds?: AlertThresholds;
|
|
195
|
+
isActive?: boolean;
|
|
196
|
+
}
|
|
197
|
+
interface AlertTestResult {
|
|
198
|
+
success: boolean;
|
|
199
|
+
message: string;
|
|
200
|
+
channel?: string;
|
|
201
|
+
error?: string;
|
|
202
|
+
}
|
|
203
|
+
type PolicyType = 'require_instrument' | 'budget_cap' | 'projection_guard';
|
|
204
|
+
type PolicySeverity = 'hard' | 'soft';
|
|
205
|
+
type AuthorizationDecisionType = 'allowed' | 'warn' | 'blocked';
|
|
206
|
+
interface PolicyViolation {
|
|
207
|
+
policyId: string;
|
|
208
|
+
policyType: PolicyType;
|
|
209
|
+
severity: PolicySeverity;
|
|
210
|
+
reason: string;
|
|
211
|
+
}
|
|
212
|
+
interface PreflightAuthorizationRequest {
|
|
213
|
+
idempotencyKey: string;
|
|
214
|
+
amount: number;
|
|
215
|
+
currency?: string;
|
|
216
|
+
counterpartyName?: string;
|
|
217
|
+
authorizingInstrumentId?: string;
|
|
218
|
+
expectedDate?: string;
|
|
219
|
+
category?: string;
|
|
220
|
+
}
|
|
221
|
+
interface PreflightAuthorizationResponse {
|
|
222
|
+
success: boolean;
|
|
223
|
+
cached: boolean;
|
|
224
|
+
decision: {
|
|
225
|
+
id: string;
|
|
226
|
+
decision: AuthorizationDecisionType;
|
|
227
|
+
violatedPolicies: PolicyViolation[];
|
|
228
|
+
expiresAt: string;
|
|
229
|
+
createdAt: string;
|
|
230
|
+
};
|
|
231
|
+
message?: string;
|
|
232
|
+
}
|
|
233
|
+
interface AuthorizationPolicy {
|
|
234
|
+
id: string;
|
|
235
|
+
policyType: PolicyType;
|
|
236
|
+
config: Record<string, any>;
|
|
237
|
+
severity: PolicySeverity;
|
|
238
|
+
priority: number;
|
|
239
|
+
isActive: boolean;
|
|
240
|
+
createdAt: string;
|
|
241
|
+
}
|
|
242
|
+
interface CreatePolicyRequest {
|
|
243
|
+
policyType: PolicyType;
|
|
244
|
+
config: Record<string, any>;
|
|
245
|
+
severity?: PolicySeverity;
|
|
246
|
+
priority?: number;
|
|
247
|
+
}
|
|
248
|
+
interface PreflightResult {
|
|
249
|
+
decisionId: string;
|
|
250
|
+
decision: AuthorizationDecisionType;
|
|
251
|
+
warning?: string;
|
|
252
|
+
}
|
|
253
|
+
interface RecordRefundResponse {
|
|
254
|
+
success: boolean;
|
|
255
|
+
transactionId: string | null;
|
|
256
|
+
referenceId: string | null;
|
|
257
|
+
saleReference: string | null;
|
|
258
|
+
refundedAmount: number | null;
|
|
259
|
+
currency: string | null;
|
|
260
|
+
status: string | null;
|
|
261
|
+
breakdown: {
|
|
262
|
+
fromCreator: number;
|
|
263
|
+
fromPlatform: number;
|
|
264
|
+
} | null;
|
|
265
|
+
isFullRefund: boolean | null;
|
|
266
|
+
repairPending?: boolean | null;
|
|
267
|
+
warning?: string | null;
|
|
268
|
+
warningCode?: string | null;
|
|
269
|
+
}
|
|
270
|
+
interface ListRefundsRequest {
|
|
271
|
+
saleReference?: string;
|
|
272
|
+
limit?: number;
|
|
273
|
+
}
|
|
274
|
+
interface RefundSummary {
|
|
275
|
+
id: string;
|
|
276
|
+
transactionId: string | null;
|
|
277
|
+
referenceId: string | null;
|
|
278
|
+
saleReference: string | null;
|
|
279
|
+
refundedAmount: number;
|
|
280
|
+
currency: string;
|
|
281
|
+
status: string;
|
|
282
|
+
reason: string | null;
|
|
283
|
+
refundFrom: string | null;
|
|
284
|
+
externalRefundId: string | null;
|
|
285
|
+
createdAt: string | null;
|
|
286
|
+
breakdown: {
|
|
287
|
+
fromCreator: number;
|
|
288
|
+
fromPlatform: number;
|
|
289
|
+
} | null;
|
|
290
|
+
repairPending?: boolean | null;
|
|
291
|
+
lastError?: string | null;
|
|
292
|
+
}
|
|
293
|
+
interface ListRefundsResponse {
|
|
294
|
+
success: boolean;
|
|
295
|
+
refunds: RefundSummary[];
|
|
296
|
+
count: number;
|
|
297
|
+
}
|
|
298
|
+
interface ReverseTransactionRequest {
|
|
299
|
+
transactionId: string;
|
|
300
|
+
reason: string;
|
|
301
|
+
partialAmount?: number;
|
|
302
|
+
idempotencyKey?: string;
|
|
303
|
+
metadata?: Record<string, unknown>;
|
|
304
|
+
}
|
|
305
|
+
interface CreatePeriodRequest {
|
|
306
|
+
startDate: string;
|
|
307
|
+
endDate: string;
|
|
308
|
+
name?: string;
|
|
309
|
+
}
|
|
310
|
+
interface ReconcileMatchRequest {
|
|
311
|
+
transactionId: string;
|
|
312
|
+
bankTransactionId: string;
|
|
313
|
+
}
|
|
314
|
+
interface CreateSnapshotRequest {
|
|
315
|
+
periodId?: string;
|
|
316
|
+
asOfDate?: string;
|
|
317
|
+
}
|
|
318
|
+
interface BackdatePolicyRequest {
|
|
319
|
+
policyType: 'none' | 'soft' | 'hard';
|
|
320
|
+
gracePeriodDays?: number;
|
|
321
|
+
maxBackdateDays?: number;
|
|
322
|
+
requireApproval?: boolean;
|
|
323
|
+
allowCurrentMonth?: boolean;
|
|
324
|
+
allowPriorMonth?: boolean;
|
|
325
|
+
blockPriorQuarter?: boolean;
|
|
326
|
+
}
|
|
327
|
+
interface ParticipantTaxInfo {
|
|
328
|
+
taxIdType?: 'ssn' | 'ein' | 'itin';
|
|
329
|
+
taxIdLast4?: string;
|
|
330
|
+
legalName?: string;
|
|
331
|
+
businessType?: 'individual' | 'sole_proprietor' | 'llc' | 'corporation' | 'partnership';
|
|
332
|
+
address?: {
|
|
333
|
+
line1?: string;
|
|
334
|
+
line2?: string;
|
|
335
|
+
city?: string;
|
|
336
|
+
state?: string;
|
|
337
|
+
postalCode?: string;
|
|
338
|
+
country?: string;
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
interface ParticipantPayoutPreferences {
|
|
342
|
+
schedule?: 'manual' | 'weekly' | 'biweekly' | 'monthly';
|
|
343
|
+
minimumAmount?: number;
|
|
344
|
+
method?: 'card' | 'manual';
|
|
345
|
+
}
|
|
346
|
+
interface CreateParticipantRequest {
|
|
347
|
+
participantId: string;
|
|
348
|
+
userId?: string;
|
|
349
|
+
displayName?: string;
|
|
350
|
+
email?: string;
|
|
351
|
+
defaultSplitPercent?: number;
|
|
352
|
+
taxInfo?: ParticipantTaxInfo;
|
|
353
|
+
payoutPreferences?: ParticipantPayoutPreferences;
|
|
354
|
+
metadata?: Record<string, unknown>;
|
|
355
|
+
}
|
|
356
|
+
interface CreateLedgerRequest {
|
|
357
|
+
businessName: string;
|
|
358
|
+
ownerEmail: string;
|
|
359
|
+
ledgerMode?: 'standard' | 'platform';
|
|
360
|
+
settings?: {
|
|
361
|
+
defaultTaxRate?: number;
|
|
362
|
+
defaultSplitPercent?: number;
|
|
363
|
+
platformFeePercent?: number;
|
|
364
|
+
minPayoutAmount?: number;
|
|
365
|
+
payoutSchedule?: 'manual' | 'weekly' | 'monthly';
|
|
366
|
+
taxWithholdingPercent?: number;
|
|
367
|
+
currency?: string;
|
|
368
|
+
fiscalYearStart?: string;
|
|
369
|
+
receiptThreshold?: number;
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
interface ExportReportRequest {
|
|
373
|
+
reportType: 'transaction_detail' | 'creator_earnings' | 'platform_revenue' | 'payout_summary' | 'reconciliation' | 'audit_log';
|
|
374
|
+
format: 'csv' | 'json';
|
|
375
|
+
startDate?: string;
|
|
376
|
+
endDate?: string;
|
|
377
|
+
creatorId?: string;
|
|
378
|
+
}
|
|
379
|
+
interface RecordAdjustmentRequest {
|
|
380
|
+
adjustmentType: 'correction' | 'reclassification' | 'accrual' | 'deferral' | 'depreciation' | 'write_off' | 'year_end' | 'opening_balance' | 'other';
|
|
381
|
+
entries: Array<{
|
|
382
|
+
accountType: string;
|
|
383
|
+
entityId?: string;
|
|
384
|
+
entryType: 'debit' | 'credit';
|
|
385
|
+
amount: number;
|
|
386
|
+
}>;
|
|
387
|
+
reason: string;
|
|
388
|
+
adjustmentDate?: string;
|
|
389
|
+
originalTransactionId?: string;
|
|
390
|
+
supportingDocumentation?: string;
|
|
391
|
+
preparedBy: string;
|
|
392
|
+
}
|
|
393
|
+
interface RecordOpeningBalanceRequest {
|
|
394
|
+
asOfDate: string;
|
|
395
|
+
source: 'manual' | 'imported' | 'migrated' | 'year_start';
|
|
396
|
+
sourceDescription?: string;
|
|
397
|
+
balances: Array<{
|
|
398
|
+
accountType: string;
|
|
399
|
+
entityId?: string;
|
|
400
|
+
balance: number;
|
|
401
|
+
}>;
|
|
402
|
+
}
|
|
403
|
+
interface RecordTransferRequest {
|
|
404
|
+
fromAccountType: string;
|
|
405
|
+
toAccountType: string;
|
|
406
|
+
amount: number;
|
|
407
|
+
transferType: 'tax_reserve' | 'payout_reserve' | 'owner_draw' | 'owner_contribution' | 'operating' | 'savings' | 'investment' | 'other';
|
|
408
|
+
description?: string;
|
|
409
|
+
referenceId?: string;
|
|
410
|
+
}
|
|
411
|
+
interface RiskEvaluationRequest {
|
|
412
|
+
idempotencyKey: string;
|
|
413
|
+
amount: number;
|
|
414
|
+
currency?: string;
|
|
415
|
+
counterpartyName?: string;
|
|
416
|
+
authorizingInstrumentId?: string;
|
|
417
|
+
expectedDate?: string;
|
|
418
|
+
category?: string;
|
|
419
|
+
}
|
|
420
|
+
interface UploadReceiptRequest {
|
|
421
|
+
fileUrl: string;
|
|
422
|
+
fileName?: string;
|
|
423
|
+
fileSize?: number;
|
|
424
|
+
mimeType?: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'application/pdf';
|
|
425
|
+
merchantName?: string;
|
|
426
|
+
transactionDate?: string;
|
|
427
|
+
totalAmount?: number;
|
|
428
|
+
transactionId?: string;
|
|
429
|
+
}
|
|
430
|
+
interface ReceivePaymentRequest {
|
|
431
|
+
amount: number;
|
|
432
|
+
invoiceTransactionId?: string;
|
|
433
|
+
customerName?: string;
|
|
434
|
+
customerId?: string;
|
|
435
|
+
referenceId?: string;
|
|
436
|
+
paymentMethod?: string;
|
|
437
|
+
paymentDate?: string;
|
|
438
|
+
metadata?: Record<string, unknown>;
|
|
439
|
+
}
|
|
440
|
+
interface ParticipantWalletMutationRequest {
|
|
441
|
+
participantId: string;
|
|
442
|
+
amount: number;
|
|
443
|
+
referenceId: string;
|
|
444
|
+
description?: string;
|
|
445
|
+
metadata?: Record<string, unknown>;
|
|
446
|
+
}
|
|
447
|
+
interface ParticipantTransferRequest {
|
|
448
|
+
fromParticipantId: string;
|
|
449
|
+
toParticipantId: string;
|
|
450
|
+
amount: number;
|
|
451
|
+
referenceId: string;
|
|
452
|
+
description?: string;
|
|
453
|
+
metadata?: Record<string, unknown>;
|
|
454
|
+
}
|
|
455
|
+
interface HoldQueryOptions {
|
|
456
|
+
participantId?: string;
|
|
457
|
+
ventureId?: string;
|
|
458
|
+
readyOnly?: boolean;
|
|
459
|
+
limit?: number;
|
|
460
|
+
}
|
|
461
|
+
interface ReleaseHoldRequest {
|
|
462
|
+
holdId: string;
|
|
463
|
+
executeTransfer?: boolean;
|
|
464
|
+
}
|
|
465
|
+
type CreateCheckoutSessionRequest = {
|
|
466
|
+
participantId: string;
|
|
467
|
+
amount: number;
|
|
468
|
+
currency?: string;
|
|
469
|
+
productId?: string;
|
|
470
|
+
productName?: string;
|
|
471
|
+
customerEmail?: string;
|
|
472
|
+
customerId?: string;
|
|
473
|
+
metadata?: Record<string, string>;
|
|
474
|
+
} & ({
|
|
475
|
+
paymentMethodId: string;
|
|
476
|
+
sourceId?: string;
|
|
477
|
+
idempotencyKey: string;
|
|
478
|
+
successUrl?: string;
|
|
479
|
+
cancelUrl?: string;
|
|
480
|
+
} | {
|
|
481
|
+
paymentMethodId?: string;
|
|
482
|
+
sourceId: string;
|
|
483
|
+
idempotencyKey: string;
|
|
484
|
+
successUrl?: string;
|
|
485
|
+
cancelUrl?: string;
|
|
486
|
+
} | {
|
|
487
|
+
paymentMethodId?: undefined;
|
|
488
|
+
sourceId?: undefined;
|
|
489
|
+
successUrl: string;
|
|
490
|
+
cancelUrl?: string;
|
|
491
|
+
idempotencyKey?: string;
|
|
492
|
+
});
|
|
493
|
+
interface CreatePayoutRequest {
|
|
494
|
+
participantId: string;
|
|
495
|
+
walletId?: string;
|
|
496
|
+
amount: number;
|
|
497
|
+
referenceId: string;
|
|
498
|
+
referenceType?: string;
|
|
499
|
+
description?: string;
|
|
500
|
+
payoutMethod?: string;
|
|
501
|
+
fees?: number;
|
|
502
|
+
feesPaidBy?: 'platform' | 'creator';
|
|
503
|
+
metadata?: Record<string, unknown>;
|
|
504
|
+
}
|
|
505
|
+
interface CreateRefundRequest {
|
|
506
|
+
saleReference: string;
|
|
507
|
+
reason: string;
|
|
508
|
+
amount?: number;
|
|
509
|
+
refundFrom?: 'both' | 'platform_only' | 'creator_only';
|
|
510
|
+
externalRefundId?: string;
|
|
511
|
+
idempotencyKey?: string;
|
|
512
|
+
metadata?: Record<string, unknown>;
|
|
513
|
+
}
|
|
514
|
+
interface SendBreachAlertRequest {
|
|
515
|
+
cashBalance: number;
|
|
516
|
+
pendingTotal: number;
|
|
517
|
+
shortfall?: number;
|
|
518
|
+
coverageRatio?: number;
|
|
519
|
+
triggeredBy: 'project_intent' | 'get_runway' | 'manual';
|
|
520
|
+
instrumentId?: string;
|
|
521
|
+
externalRef?: string;
|
|
522
|
+
projectionsCreated?: number;
|
|
523
|
+
channel?: 'slack' | 'email' | 'webhook';
|
|
524
|
+
}
|
|
525
|
+
interface InvoiceLineItem {
|
|
526
|
+
description: string;
|
|
527
|
+
quantity: number;
|
|
528
|
+
unitPrice: number;
|
|
529
|
+
amount?: number;
|
|
530
|
+
}
|
|
531
|
+
interface CreateInvoiceRequest {
|
|
532
|
+
customerName: string;
|
|
533
|
+
customerEmail?: string;
|
|
534
|
+
customerId?: string;
|
|
535
|
+
customerAddress?: {
|
|
536
|
+
line1?: string;
|
|
537
|
+
line2?: string;
|
|
538
|
+
city?: string;
|
|
539
|
+
state?: string;
|
|
540
|
+
postalCode?: string;
|
|
541
|
+
country?: string;
|
|
542
|
+
};
|
|
543
|
+
lineItems: InvoiceLineItem[];
|
|
544
|
+
dueDate?: string;
|
|
545
|
+
notes?: string;
|
|
546
|
+
terms?: string;
|
|
547
|
+
referenceId?: string;
|
|
548
|
+
metadata?: Record<string, unknown>;
|
|
549
|
+
}
|
|
550
|
+
interface RecordInvoicePaymentRequest {
|
|
551
|
+
amount: number;
|
|
552
|
+
paymentMethod?: string;
|
|
553
|
+
paymentDate?: string;
|
|
554
|
+
referenceId?: string;
|
|
555
|
+
notes?: string;
|
|
556
|
+
}
|
|
557
|
+
interface PayBillRequest {
|
|
558
|
+
billTransactionId?: string;
|
|
559
|
+
amount: number;
|
|
560
|
+
vendorName?: string;
|
|
561
|
+
referenceId?: string;
|
|
562
|
+
paymentMethod?: string;
|
|
563
|
+
paymentDate?: string;
|
|
564
|
+
metadata?: Record<string, unknown>;
|
|
565
|
+
}
|
|
566
|
+
interface CreateBudgetRequest {
|
|
567
|
+
name: string;
|
|
568
|
+
categoryCode?: string;
|
|
569
|
+
budgetAmount: number;
|
|
570
|
+
budgetPeriod: 'weekly' | 'monthly' | 'quarterly' | 'annual';
|
|
571
|
+
alertAtPercentage?: number;
|
|
572
|
+
}
|
|
573
|
+
interface CreateRecurringRequest {
|
|
574
|
+
name: string;
|
|
575
|
+
merchantName: string;
|
|
576
|
+
categoryCode: string;
|
|
577
|
+
amount: number;
|
|
578
|
+
recurrenceInterval: 'weekly' | 'monthly' | 'quarterly' | 'annual';
|
|
579
|
+
recurrenceDay?: number;
|
|
580
|
+
startDate: string;
|
|
581
|
+
endDate?: string;
|
|
582
|
+
businessPurpose: string;
|
|
583
|
+
isVariableAmount?: boolean;
|
|
584
|
+
}
|
|
585
|
+
interface CreateContractorRequest {
|
|
586
|
+
name: string;
|
|
587
|
+
email?: string;
|
|
588
|
+
companyName?: string;
|
|
589
|
+
}
|
|
590
|
+
interface RecordContractorPaymentRequest {
|
|
591
|
+
contractorId: string;
|
|
592
|
+
amount: number;
|
|
593
|
+
paymentDate: string;
|
|
594
|
+
paymentMethod?: string;
|
|
595
|
+
paymentReference?: string;
|
|
596
|
+
description?: string;
|
|
597
|
+
}
|
|
598
|
+
interface CreateBankAccountRequest {
|
|
599
|
+
bankName: string;
|
|
600
|
+
accountName: string;
|
|
601
|
+
accountType: 'checking' | 'savings' | 'credit_card' | 'other';
|
|
602
|
+
accountLastFour?: string;
|
|
603
|
+
}
|
|
604
|
+
interface SubmitTaxInfoRequest {
|
|
605
|
+
participantId: string;
|
|
606
|
+
legalName: string;
|
|
607
|
+
taxIdType: 'ssn' | 'ein' | 'itin';
|
|
608
|
+
taxIdLast4: string;
|
|
609
|
+
businessType: 'individual' | 'sole_proprietor' | 'llc' | 'corporation' | 'partnership';
|
|
610
|
+
address?: {
|
|
611
|
+
line1?: string;
|
|
612
|
+
line2?: string;
|
|
613
|
+
city?: string;
|
|
614
|
+
state?: string;
|
|
615
|
+
postalCode?: string;
|
|
616
|
+
country?: string;
|
|
617
|
+
};
|
|
618
|
+
certify: boolean;
|
|
619
|
+
}
|
|
620
|
+
interface ImportBankStatementLine {
|
|
621
|
+
transactionDate: string;
|
|
622
|
+
postDate?: string;
|
|
623
|
+
description: string;
|
|
624
|
+
amount: number;
|
|
625
|
+
referenceNumber?: string;
|
|
626
|
+
checkNumber?: string;
|
|
627
|
+
merchantName?: string;
|
|
628
|
+
categoryHint?: string;
|
|
629
|
+
}
|
|
630
|
+
interface ImportBankStatementRequest {
|
|
631
|
+
bankAccountId: string;
|
|
632
|
+
lines: ImportBankStatementLine[];
|
|
633
|
+
autoMatch?: boolean;
|
|
634
|
+
}
|
|
635
|
+
interface CheckoutBreakdown {
|
|
636
|
+
grossAmount: number;
|
|
637
|
+
creatorAmount: number;
|
|
638
|
+
platformAmount: number;
|
|
639
|
+
creatorPercent: number;
|
|
640
|
+
}
|
|
641
|
+
interface ReverseResponse {
|
|
642
|
+
success: boolean;
|
|
643
|
+
voidType: string;
|
|
644
|
+
message: string;
|
|
645
|
+
transactionId: string;
|
|
646
|
+
reversalId: string | null;
|
|
647
|
+
reversedAmount: number | null;
|
|
648
|
+
isPartial: boolean | null;
|
|
649
|
+
voidedAt: string | null;
|
|
650
|
+
reversedAt: string | null;
|
|
651
|
+
warning: string | null;
|
|
652
|
+
}
|
|
653
|
+
interface Period {
|
|
654
|
+
id: string;
|
|
655
|
+
name: string;
|
|
656
|
+
startDate: string;
|
|
657
|
+
endDate: string;
|
|
658
|
+
status: 'open' | 'closed' | 'locked' | 'archived';
|
|
659
|
+
lockedAt?: string;
|
|
660
|
+
balanceCheck?: {
|
|
661
|
+
isBalanced: boolean;
|
|
662
|
+
totalDebits: number;
|
|
663
|
+
totalCredits: number;
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
interface ReconciliationSnapshot {
|
|
667
|
+
id: string;
|
|
668
|
+
periodStart: string;
|
|
669
|
+
periodEnd: string;
|
|
670
|
+
integrityHash: string;
|
|
671
|
+
integrityValid: boolean;
|
|
672
|
+
summary: {
|
|
673
|
+
totalMatched: number;
|
|
674
|
+
totalUnmatched: number;
|
|
675
|
+
matchedAmount: number;
|
|
676
|
+
unmatchedAmount: number;
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
interface FrozenStatement {
|
|
680
|
+
type: 'profit_loss' | 'balance_sheet' | 'trial_balance';
|
|
681
|
+
periodId: string;
|
|
682
|
+
generatedAt: string;
|
|
683
|
+
integrityHash: string;
|
|
684
|
+
integrityValid: boolean;
|
|
685
|
+
readOnly: true;
|
|
686
|
+
data: any;
|
|
687
|
+
}
|
|
688
|
+
interface ParticipantSummary {
|
|
689
|
+
id: string;
|
|
690
|
+
linkedUserId: string | null;
|
|
691
|
+
name: string | null;
|
|
692
|
+
tier: string | null;
|
|
693
|
+
ledgerBalance: number;
|
|
694
|
+
heldAmount: number;
|
|
695
|
+
availableBalance: number;
|
|
696
|
+
}
|
|
697
|
+
interface ParticipantDetail {
|
|
698
|
+
id: string;
|
|
699
|
+
linkedUserId: string | null;
|
|
700
|
+
name: string | null;
|
|
701
|
+
tier: string | null;
|
|
702
|
+
customSplitPercent: number | null;
|
|
703
|
+
ledgerBalance: number;
|
|
704
|
+
heldAmount: number;
|
|
705
|
+
availableBalance: number;
|
|
706
|
+
holds: Array<{
|
|
707
|
+
amount: number;
|
|
708
|
+
reason: string | null;
|
|
709
|
+
releaseDate: string | null;
|
|
710
|
+
status: string;
|
|
711
|
+
}>;
|
|
712
|
+
}
|
|
713
|
+
interface CreateParticipantResponse {
|
|
714
|
+
success: boolean;
|
|
715
|
+
participant: {
|
|
716
|
+
id: string;
|
|
717
|
+
accountId: string;
|
|
718
|
+
linkedUserId: string | null;
|
|
719
|
+
displayName: string | null;
|
|
720
|
+
email: string | null;
|
|
721
|
+
defaultSplitPercent: number;
|
|
722
|
+
payoutPreferences: Record<string, unknown>;
|
|
723
|
+
createdAt: string;
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
interface ParticipantPayoutEligibilityResponse {
|
|
727
|
+
success: boolean;
|
|
728
|
+
eligibility: {
|
|
729
|
+
participantId: string;
|
|
730
|
+
eligible: boolean;
|
|
731
|
+
availableBalance: number;
|
|
732
|
+
issues: string[];
|
|
733
|
+
requirements: Record<string, unknown>;
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
interface CreateLedgerResponse {
|
|
737
|
+
success: boolean;
|
|
738
|
+
ledger: {
|
|
739
|
+
id: string;
|
|
740
|
+
businessName: string;
|
|
741
|
+
ledgerMode: string;
|
|
742
|
+
apiKey: string;
|
|
743
|
+
status: string;
|
|
744
|
+
createdAt: string;
|
|
745
|
+
};
|
|
746
|
+
warning: string;
|
|
747
|
+
}
|
|
748
|
+
interface ExportReportJsonResponse {
|
|
749
|
+
success: boolean;
|
|
750
|
+
reportType: string;
|
|
751
|
+
generatedAt: string;
|
|
752
|
+
rowCount: number;
|
|
753
|
+
data: any[];
|
|
754
|
+
}
|
|
755
|
+
interface ExportReportCsvResponse {
|
|
756
|
+
csv: string;
|
|
757
|
+
filename: string;
|
|
758
|
+
}
|
|
759
|
+
interface RiskEvaluationResponse {
|
|
760
|
+
success: boolean;
|
|
761
|
+
cached: boolean;
|
|
762
|
+
evaluation: {
|
|
763
|
+
id: string;
|
|
764
|
+
signal: 'within_policy' | 'elevated_risk' | 'high_risk';
|
|
765
|
+
riskFactors: Array<{
|
|
766
|
+
policyId: string;
|
|
767
|
+
policyType: string;
|
|
768
|
+
severity: 'hard' | 'soft';
|
|
769
|
+
indicator: string;
|
|
770
|
+
}>;
|
|
771
|
+
validUntil: string;
|
|
772
|
+
createdAt: string;
|
|
773
|
+
acknowledgedAt: string | null;
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
interface FraudPolicyResource {
|
|
777
|
+
id: string;
|
|
778
|
+
type: PolicyType;
|
|
779
|
+
severity: PolicySeverity;
|
|
780
|
+
priority: number;
|
|
781
|
+
isActive: boolean;
|
|
782
|
+
config: Record<string, unknown>;
|
|
783
|
+
createdAt: string | null;
|
|
784
|
+
updatedAt: string | null;
|
|
785
|
+
}
|
|
786
|
+
interface FraudPolicyListResponse {
|
|
787
|
+
success: boolean;
|
|
788
|
+
policies: FraudPolicyResource[];
|
|
789
|
+
}
|
|
790
|
+
interface FraudPolicyResponse {
|
|
791
|
+
success: boolean;
|
|
792
|
+
policy: FraudPolicyResource;
|
|
793
|
+
}
|
|
794
|
+
interface FraudPolicyDeleteResponse {
|
|
795
|
+
success: boolean;
|
|
796
|
+
deleted: boolean;
|
|
797
|
+
policyId: string;
|
|
798
|
+
}
|
|
799
|
+
interface ReconciliationMatchResponse {
|
|
800
|
+
success: boolean;
|
|
801
|
+
match: {
|
|
802
|
+
id: string;
|
|
803
|
+
transactionId: string;
|
|
804
|
+
bankTransactionId: string;
|
|
805
|
+
status: string;
|
|
806
|
+
matchedAt: string;
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
interface ReconciliationUnmatchResponse {
|
|
810
|
+
success: boolean;
|
|
811
|
+
deleted: boolean;
|
|
812
|
+
transactionId: string;
|
|
813
|
+
}
|
|
814
|
+
interface UnmatchedTransactionsResponse {
|
|
815
|
+
success: boolean;
|
|
816
|
+
unmatchedCount: number;
|
|
817
|
+
transactions: Array<{
|
|
818
|
+
id: string;
|
|
819
|
+
referenceId: string | null;
|
|
820
|
+
description: string | null;
|
|
821
|
+
amount: number;
|
|
822
|
+
currency: string;
|
|
823
|
+
createdAt: string;
|
|
824
|
+
status: string;
|
|
825
|
+
metadata: Record<string, unknown>;
|
|
826
|
+
}>;
|
|
827
|
+
}
|
|
828
|
+
interface AutoMatchReconciliationResponse {
|
|
829
|
+
success: boolean;
|
|
830
|
+
result: {
|
|
831
|
+
matched: boolean;
|
|
832
|
+
matchType: string | null;
|
|
833
|
+
matchedTransactionId: string | null;
|
|
834
|
+
bankAggregatorTransactionId: string;
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
interface TaxDocumentsResponse {
|
|
838
|
+
success: boolean;
|
|
839
|
+
taxYear: number;
|
|
840
|
+
summary: {
|
|
841
|
+
totalDocuments: number;
|
|
842
|
+
totalAmount: number;
|
|
843
|
+
byStatus: {
|
|
844
|
+
calculated: number;
|
|
845
|
+
exported: number;
|
|
846
|
+
filed: number;
|
|
847
|
+
};
|
|
848
|
+
};
|
|
849
|
+
documents: any[];
|
|
850
|
+
}
|
|
851
|
+
interface TaxDocumentResponse {
|
|
852
|
+
success: boolean;
|
|
853
|
+
document: any;
|
|
854
|
+
}
|
|
855
|
+
interface TaxDocumentGenerationResponse {
|
|
856
|
+
success: boolean;
|
|
857
|
+
generation: {
|
|
858
|
+
taxYear: number;
|
|
859
|
+
created: number;
|
|
860
|
+
skipped: number;
|
|
861
|
+
totalAmount: number;
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
interface TaxCalculationResponse {
|
|
865
|
+
success: boolean;
|
|
866
|
+
calculation: {
|
|
867
|
+
participantId: string;
|
|
868
|
+
taxYear: number;
|
|
869
|
+
grossPayments: number;
|
|
870
|
+
transactionCount: number;
|
|
871
|
+
requires1099: boolean;
|
|
872
|
+
monthlyTotals: Record<string, unknown>;
|
|
873
|
+
threshold: number;
|
|
874
|
+
linkedUserId: string | null;
|
|
875
|
+
sharedTaxProfile: {
|
|
876
|
+
status: string;
|
|
877
|
+
legalName: string | null;
|
|
878
|
+
taxIdLast4: string | null;
|
|
879
|
+
} | null;
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
interface TaxSummaryResponse {
|
|
883
|
+
success: boolean;
|
|
884
|
+
taxYear: number;
|
|
885
|
+
note: string;
|
|
886
|
+
summaries: Array<{
|
|
887
|
+
participantId: string;
|
|
888
|
+
linkedUserId: string | null;
|
|
889
|
+
grossEarnings: number;
|
|
890
|
+
refundsIssued: number;
|
|
891
|
+
netEarnings: number;
|
|
892
|
+
totalPaidOut: number;
|
|
893
|
+
requires1099: boolean;
|
|
894
|
+
sharedTaxProfile: {
|
|
895
|
+
status: string;
|
|
896
|
+
legalName: string | null;
|
|
897
|
+
taxIdLast4: string | null;
|
|
898
|
+
} | null;
|
|
899
|
+
}>;
|
|
900
|
+
totals: {
|
|
901
|
+
totalGross: number;
|
|
902
|
+
totalRefunds: number;
|
|
903
|
+
totalNet: number;
|
|
904
|
+
totalPaid: number;
|
|
905
|
+
participantsRequiring1099: number;
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
interface ComplianceOverviewResponse {
|
|
909
|
+
success: boolean;
|
|
910
|
+
overview: {
|
|
911
|
+
windowDays: number;
|
|
912
|
+
accessWindowHours: number;
|
|
913
|
+
totalEvents: number;
|
|
914
|
+
uniqueIps: number;
|
|
915
|
+
uniqueActors: number;
|
|
916
|
+
highRiskEvents: number;
|
|
917
|
+
criticalRiskEvents: number;
|
|
918
|
+
failedAuthEvents: number;
|
|
919
|
+
payoutsFailed: number;
|
|
920
|
+
refundsRecorded: number;
|
|
921
|
+
disputeEvents: number;
|
|
922
|
+
};
|
|
923
|
+
note: string;
|
|
924
|
+
}
|
|
925
|
+
interface ComplianceAccessPatternsResponse {
|
|
926
|
+
success: boolean;
|
|
927
|
+
windowHours: number;
|
|
928
|
+
count: number;
|
|
929
|
+
patterns: Array<{
|
|
930
|
+
ipAddress: string;
|
|
931
|
+
hour: string;
|
|
932
|
+
requestCount: number;
|
|
933
|
+
uniqueActions: number;
|
|
934
|
+
actions: string[];
|
|
935
|
+
maxRiskScore: number;
|
|
936
|
+
failedAuths: number;
|
|
937
|
+
}>;
|
|
938
|
+
}
|
|
939
|
+
interface ComplianceFinancialActivityResponse {
|
|
940
|
+
success: boolean;
|
|
941
|
+
windowDays: number;
|
|
942
|
+
activity: Array<{
|
|
943
|
+
date: string;
|
|
944
|
+
payoutsInitiated: number;
|
|
945
|
+
payoutsCompleted: number;
|
|
946
|
+
payoutsFailed: number;
|
|
947
|
+
salesRecorded: number;
|
|
948
|
+
refundsRecorded: number;
|
|
949
|
+
disputeEvents: number;
|
|
950
|
+
}>;
|
|
951
|
+
}
|
|
952
|
+
interface ComplianceSecuritySummaryResponse {
|
|
953
|
+
success: boolean;
|
|
954
|
+
windowDays: number;
|
|
955
|
+
summary: Array<{
|
|
956
|
+
date: string;
|
|
957
|
+
action: string;
|
|
958
|
+
eventCount: number;
|
|
959
|
+
uniqueIps: number;
|
|
960
|
+
uniqueActors: number;
|
|
961
|
+
avgRiskScore: number;
|
|
962
|
+
maxRiskScore: number;
|
|
963
|
+
highRiskCount: number;
|
|
964
|
+
criticalRiskCount: number;
|
|
965
|
+
}>;
|
|
966
|
+
}
|
|
967
|
+
interface UploadReceiptResponse {
|
|
968
|
+
success: boolean;
|
|
969
|
+
receiptId: string;
|
|
970
|
+
status: 'uploaded' | 'matched' | 'orphan';
|
|
971
|
+
linkedTransactionId: string | null;
|
|
972
|
+
}
|
|
973
|
+
interface ReceivePaymentResponse {
|
|
974
|
+
success: boolean;
|
|
975
|
+
transactionId: string;
|
|
976
|
+
amount: number;
|
|
977
|
+
}
|
|
978
|
+
interface SendBreachAlertResponse {
|
|
979
|
+
success: boolean;
|
|
980
|
+
message?: string;
|
|
981
|
+
alertsSent: number;
|
|
982
|
+
alertsFailed?: number;
|
|
983
|
+
alertsSkipped?: number;
|
|
984
|
+
results?: Array<{
|
|
985
|
+
channel: string;
|
|
986
|
+
success: boolean;
|
|
987
|
+
error?: string;
|
|
988
|
+
}>;
|
|
989
|
+
}
|
|
990
|
+
interface WalletObject {
|
|
991
|
+
id: string;
|
|
992
|
+
object: 'wallet';
|
|
993
|
+
walletType: 'consumer_credit' | 'creator_earnings';
|
|
994
|
+
scopeType: 'customer' | 'participant';
|
|
995
|
+
ownerId: string | null;
|
|
996
|
+
ownerType: string | null;
|
|
997
|
+
participantId: string | null;
|
|
998
|
+
accountType: string;
|
|
999
|
+
name: string | null;
|
|
1000
|
+
currency: string;
|
|
1001
|
+
status: string;
|
|
1002
|
+
balance: number;
|
|
1003
|
+
heldAmount: number;
|
|
1004
|
+
availableBalance: number;
|
|
1005
|
+
redeemable: boolean;
|
|
1006
|
+
transferable: boolean;
|
|
1007
|
+
topupSupported: boolean;
|
|
1008
|
+
payoutSupported: boolean;
|
|
1009
|
+
createdAt: string | null;
|
|
1010
|
+
metadata: Record<string, unknown>;
|
|
1011
|
+
}
|
|
1012
|
+
interface ListWalletsRequest {
|
|
1013
|
+
ownerId?: string;
|
|
1014
|
+
ownerType?: string;
|
|
1015
|
+
walletType?: WalletObject['walletType'];
|
|
1016
|
+
limit?: number;
|
|
1017
|
+
offset?: number;
|
|
1018
|
+
}
|
|
1019
|
+
interface ListWalletsResponse {
|
|
1020
|
+
success: boolean;
|
|
1021
|
+
wallets: WalletObject[];
|
|
1022
|
+
total: number;
|
|
1023
|
+
limit: number;
|
|
1024
|
+
offset: number;
|
|
1025
|
+
}
|
|
1026
|
+
interface CreateWalletRequest {
|
|
1027
|
+
ownerId?: string;
|
|
1028
|
+
participantId?: string;
|
|
1029
|
+
ownerType?: string;
|
|
1030
|
+
walletType: WalletObject['walletType'];
|
|
1031
|
+
name?: string;
|
|
1032
|
+
metadata?: Record<string, unknown>;
|
|
1033
|
+
}
|
|
1034
|
+
interface CreateWalletResponse {
|
|
1035
|
+
success: boolean;
|
|
1036
|
+
created: boolean;
|
|
1037
|
+
wallet: WalletObject;
|
|
1038
|
+
}
|
|
1039
|
+
interface GetWalletResponse {
|
|
1040
|
+
success: boolean;
|
|
1041
|
+
wallet: WalletObject;
|
|
1042
|
+
}
|
|
1043
|
+
interface WalletEntriesResponse {
|
|
1044
|
+
success: boolean;
|
|
1045
|
+
wallet: WalletObject | null;
|
|
1046
|
+
entries: WalletHistoryEntry[];
|
|
1047
|
+
total: number;
|
|
1048
|
+
limit: number;
|
|
1049
|
+
offset: number;
|
|
1050
|
+
}
|
|
1051
|
+
interface WalletTopupRequest {
|
|
1052
|
+
walletId: string;
|
|
1053
|
+
amount: number;
|
|
1054
|
+
referenceId: string;
|
|
1055
|
+
description?: string;
|
|
1056
|
+
metadata?: Record<string, unknown>;
|
|
1057
|
+
}
|
|
1058
|
+
interface WalletTopupResponse {
|
|
1059
|
+
success: boolean;
|
|
1060
|
+
walletId: string | null;
|
|
1061
|
+
ownerId: string | null;
|
|
1062
|
+
transactionId: string | null;
|
|
1063
|
+
balance: number | null;
|
|
1064
|
+
}
|
|
1065
|
+
interface WalletWithdrawRequest {
|
|
1066
|
+
walletId: string;
|
|
1067
|
+
/** Amount in cents */
|
|
1068
|
+
amount: number;
|
|
1069
|
+
referenceId: string;
|
|
1070
|
+
description?: string;
|
|
1071
|
+
metadata?: Record<string, unknown>;
|
|
1072
|
+
}
|
|
1073
|
+
interface WalletWithdrawalResponse {
|
|
1074
|
+
success: boolean;
|
|
1075
|
+
walletId: string | null;
|
|
1076
|
+
ownerId: string | null;
|
|
1077
|
+
transactionId: string | null;
|
|
1078
|
+
balance: number | null;
|
|
1079
|
+
}
|
|
1080
|
+
interface WalletHistoryEntry {
|
|
1081
|
+
entryId: string;
|
|
1082
|
+
entryType: 'debit' | 'credit';
|
|
1083
|
+
amount: number;
|
|
1084
|
+
transactionId: string;
|
|
1085
|
+
referenceId: string;
|
|
1086
|
+
transactionType: string;
|
|
1087
|
+
description: string | null;
|
|
1088
|
+
status: string;
|
|
1089
|
+
metadata: Record<string, unknown> | null;
|
|
1090
|
+
createdAt: string;
|
|
1091
|
+
}
|
|
1092
|
+
interface ParticipantTransferResponse {
|
|
1093
|
+
success: boolean;
|
|
1094
|
+
transfer: {
|
|
1095
|
+
transactionId: string;
|
|
1096
|
+
fromParticipantId: string;
|
|
1097
|
+
toParticipantId: string;
|
|
1098
|
+
fromBalance: number;
|
|
1099
|
+
toBalance: number;
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
interface HeldFund {
|
|
1103
|
+
id: string;
|
|
1104
|
+
participantId: string | null;
|
|
1105
|
+
participantName: string | null;
|
|
1106
|
+
amount: number;
|
|
1107
|
+
currency: string;
|
|
1108
|
+
heldSince: string;
|
|
1109
|
+
daysHeld: number;
|
|
1110
|
+
holdReason: string | null;
|
|
1111
|
+
holdUntil: string | null;
|
|
1112
|
+
readyForRelease: boolean;
|
|
1113
|
+
releaseStatus: string;
|
|
1114
|
+
transactionReference: string | null;
|
|
1115
|
+
productName: string | null;
|
|
1116
|
+
ventureId: string | null;
|
|
1117
|
+
connectedAccountReady: boolean;
|
|
1118
|
+
}
|
|
1119
|
+
interface HeldFundsResponse {
|
|
1120
|
+
success: boolean;
|
|
1121
|
+
holds: HeldFund[];
|
|
1122
|
+
count: number;
|
|
1123
|
+
}
|
|
1124
|
+
interface HeldFundsSummaryResponse {
|
|
1125
|
+
success: boolean;
|
|
1126
|
+
summary: Record<string, unknown>;
|
|
1127
|
+
}
|
|
1128
|
+
interface ReleaseHoldResponse {
|
|
1129
|
+
success: boolean;
|
|
1130
|
+
release: {
|
|
1131
|
+
id: string;
|
|
1132
|
+
holdId: string;
|
|
1133
|
+
executed: boolean;
|
|
1134
|
+
transferId: string | null;
|
|
1135
|
+
transferStatus: string | null;
|
|
1136
|
+
amount: number | null;
|
|
1137
|
+
currency: string | null;
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
interface CheckoutSessionResourceResponse {
|
|
1141
|
+
success: boolean;
|
|
1142
|
+
checkoutSession: {
|
|
1143
|
+
id: string;
|
|
1144
|
+
mode: 'session' | 'direct' | string;
|
|
1145
|
+
checkoutUrl: string | null;
|
|
1146
|
+
paymentId: string | null;
|
|
1147
|
+
paymentIntentId: string | null;
|
|
1148
|
+
status: string | null;
|
|
1149
|
+
requiresAction: boolean;
|
|
1150
|
+
amount: number;
|
|
1151
|
+
currency: string;
|
|
1152
|
+
expiresAt: string | null;
|
|
1153
|
+
fundingTransactionId: string | null;
|
|
1154
|
+
saleTransactionId: string | null;
|
|
1155
|
+
saleReference: string | null;
|
|
1156
|
+
breakdown: CheckoutBreakdown | null;
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
interface PayoutResourceResponse {
|
|
1160
|
+
success: boolean;
|
|
1161
|
+
payout: {
|
|
1162
|
+
id: string;
|
|
1163
|
+
transactionId: string;
|
|
1164
|
+
grossAmount: number | null;
|
|
1165
|
+
fees: number | null;
|
|
1166
|
+
netAmount: number | null;
|
|
1167
|
+
previousBalance: number | null;
|
|
1168
|
+
newBalance: number | null;
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
interface RefundResourceResponse {
|
|
1172
|
+
success: boolean;
|
|
1173
|
+
refund: {
|
|
1174
|
+
id: string;
|
|
1175
|
+
transactionId: string | null;
|
|
1176
|
+
referenceId: string | null;
|
|
1177
|
+
saleReference: string | null;
|
|
1178
|
+
refundedAmount: number | null;
|
|
1179
|
+
currency: string | null;
|
|
1180
|
+
status: string | null;
|
|
1181
|
+
breakdown: {
|
|
1182
|
+
fromCreator: number;
|
|
1183
|
+
fromPlatform: number;
|
|
1184
|
+
} | null;
|
|
1185
|
+
isFullRefund: boolean | null;
|
|
1186
|
+
repairPending?: boolean | null;
|
|
1187
|
+
};
|
|
1188
|
+
warning?: string | null;
|
|
1189
|
+
warningCode?: string | null;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* Soledgic SDK Error Classes
|
|
1194
|
+
* Typed errors with HTTP status mapping
|
|
1195
|
+
*/
|
|
1196
|
+
declare class SoledgicError extends Error {
|
|
1197
|
+
status: number;
|
|
1198
|
+
details?: unknown | undefined;
|
|
1199
|
+
code?: string | undefined;
|
|
1200
|
+
constructor(message: string, status: number, details?: unknown | undefined, code?: string | undefined);
|
|
1201
|
+
}
|
|
1202
|
+
declare class ValidationError extends SoledgicError {
|
|
1203
|
+
constructor(message: string, details?: unknown, code?: string);
|
|
1204
|
+
}
|
|
1205
|
+
declare class AuthenticationError extends SoledgicError {
|
|
1206
|
+
constructor(message?: string, details?: unknown, code?: string);
|
|
1207
|
+
}
|
|
1208
|
+
declare class NotFoundError extends SoledgicError {
|
|
1209
|
+
constructor(message: string, details?: unknown, code?: string);
|
|
1210
|
+
}
|
|
1211
|
+
declare class ConflictError extends SoledgicError {
|
|
1212
|
+
constructor(message: string, details?: unknown, code?: string);
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
/**
|
|
1216
|
+
* Soledgic SDK Webhook Utilities
|
|
1217
|
+
* Signature verification and event parsing
|
|
1218
|
+
*/
|
|
1219
|
+
|
|
1220
|
+
declare function isArrayBufferView(value: unknown): value is ArrayBufferView;
|
|
1221
|
+
declare function webhookPayloadToString(payload: WebhookPayloadInput): string;
|
|
1222
|
+
declare function timingSafeEqual(a: string, b: string): boolean;
|
|
1223
|
+
declare function hmacHex(secret: string, payload: string): Promise<string>;
|
|
1224
|
+
declare function parseWebhookSignatureHeader(signatureHeader: string): {
|
|
1225
|
+
timestamp: number | null;
|
|
1226
|
+
v1Signatures: string[];
|
|
1227
|
+
};
|
|
1228
|
+
declare function verifyWebhookSignature(payload: WebhookPayloadInput, signatureHeader: string, secret: string, options?: VerifyWebhookSignatureOptions): Promise<boolean>;
|
|
1229
|
+
declare function parseWebhookEvent<T = Record<string, unknown>>(payload: WebhookPayloadInput): ParsedWebhookEvent<T>;
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* Soledgic SDK Internal Helpers
|
|
1233
|
+
* Response mapping utilities
|
|
1234
|
+
*/
|
|
1235
|
+
|
|
1236
|
+
declare function mapWebhookEndpoint(endpoint: any): WebhookEndpoint;
|
|
1237
|
+
declare function resolveWebhookEndpointUrl(webhookEndpoints: unknown, endpointUrl: unknown): string | null;
|
|
1238
|
+
declare function mapWebhookDelivery(delivery: any): WebhookDelivery;
|
|
1239
|
+
|
|
1240
|
+
declare const DEFAULT_API_VERSION = "2026-03-01";
|
|
1241
|
+
declare const DEFAULT_BASE_URL = "https://api.soledgic.com/v1";
|
|
1242
|
+
declare class Soledgic {
|
|
1243
|
+
private _getKey;
|
|
1244
|
+
private baseUrl;
|
|
1245
|
+
private timeoutMs;
|
|
1246
|
+
private apiVersion;
|
|
1247
|
+
constructor(config: SoledgicConfig);
|
|
1248
|
+
/** Clear the API key from memory. After calling destroy(), all requests will throw. */
|
|
1249
|
+
destroy(): void;
|
|
1250
|
+
readonly webhooks: {
|
|
1251
|
+
verifySignature: (payload: WebhookPayloadInput, signatureHeader: string, secret: string, options?: VerifyWebhookSignatureOptions) => Promise<boolean>;
|
|
1252
|
+
parseEvent: <T = Record<string, unknown>>(payload: WebhookPayloadInput) => ParsedWebhookEvent<T>;
|
|
1253
|
+
};
|
|
1254
|
+
private throwTypedError;
|
|
1255
|
+
private request;
|
|
1256
|
+
private requestGet;
|
|
1257
|
+
private requestRaw;
|
|
1258
|
+
private requestGetRaw;
|
|
1259
|
+
private requestDelete;
|
|
1260
|
+
recordIncome(req: RecordIncomeRequest): Promise<unknown>;
|
|
1261
|
+
recordExpense(req: RecordExpenseRequest): Promise<unknown>;
|
|
1262
|
+
recordBill(req: RecordBillRequest): Promise<unknown>;
|
|
1263
|
+
registerInstrument(req: RegisterInstrumentRequest): Promise<RegisterInstrumentResponse>;
|
|
1264
|
+
projectIntent(req: ProjectIntentRequest): Promise<ProjectIntentResponse>;
|
|
1265
|
+
reverseTransaction(req: ReverseTransactionRequest): Promise<ReverseResponse>;
|
|
1266
|
+
listPeriods(): Promise<{
|
|
1267
|
+
success: boolean;
|
|
1268
|
+
periods: Period[];
|
|
1269
|
+
}>;
|
|
1270
|
+
createPeriod(req: CreatePeriodRequest): Promise<{
|
|
1271
|
+
success: boolean;
|
|
1272
|
+
period: Period;
|
|
1273
|
+
}>;
|
|
1274
|
+
closePeriod(year: number, month?: number, quarter?: number): Promise<any>;
|
|
1275
|
+
matchTransaction(req: ReconcileMatchRequest): Promise<ReconciliationMatchResponse>;
|
|
1276
|
+
unmatchTransaction(transactionId: string): Promise<ReconciliationUnmatchResponse>;
|
|
1277
|
+
listUnmatchedTransactions(): Promise<UnmatchedTransactionsResponse>;
|
|
1278
|
+
createReconciliationSnapshot(req: CreateSnapshotRequest): Promise<{
|
|
1279
|
+
success: boolean;
|
|
1280
|
+
snapshot_id: string;
|
|
1281
|
+
integrity_hash: string;
|
|
1282
|
+
}>;
|
|
1283
|
+
getReconciliationSnapshot(periodId: string): Promise<{
|
|
1284
|
+
success: boolean;
|
|
1285
|
+
snapshot: ReconciliationSnapshot;
|
|
1286
|
+
}>;
|
|
1287
|
+
autoMatchBankTransaction(bankAggregatorTransactionId: string): Promise<AutoMatchReconciliationResponse>;
|
|
1288
|
+
generateFrozenStatements(periodId: string): Promise<unknown>;
|
|
1289
|
+
getFrozenStatement(periodId: string, statementType: 'profit_loss' | 'balance_sheet' | 'trial_balance'): Promise<{
|
|
1290
|
+
success: boolean;
|
|
1291
|
+
statement: FrozenStatement;
|
|
1292
|
+
}>;
|
|
1293
|
+
listFrozenStatements(periodId?: string): Promise<unknown>;
|
|
1294
|
+
verifyFrozenStatements(periodId: string): Promise<{
|
|
1295
|
+
success: boolean;
|
|
1296
|
+
all_valid: boolean;
|
|
1297
|
+
verification_results: any[];
|
|
1298
|
+
}>;
|
|
1299
|
+
listTiers(): Promise<unknown>;
|
|
1300
|
+
getEffectiveSplit(creatorId: string): Promise<unknown>;
|
|
1301
|
+
setCreatorSplit(creatorId: string, splitPercent: number): Promise<unknown>;
|
|
1302
|
+
clearCreatorSplit(creatorId: string): Promise<unknown>;
|
|
1303
|
+
autoPromoteCreators(): Promise<unknown>;
|
|
1304
|
+
getSummary(): Promise<{
|
|
1305
|
+
success: any;
|
|
1306
|
+
data: any;
|
|
1307
|
+
}>;
|
|
1308
|
+
getProfitLoss(startDate: string, endDate: string): Promise<unknown>;
|
|
1309
|
+
getTrialBalance(asOf?: string): Promise<unknown>;
|
|
1310
|
+
get1099Summary(year: number): Promise<unknown>;
|
|
1311
|
+
getCreatorEarnings(startDate: string, endDate: string): Promise<unknown>;
|
|
1312
|
+
getHistoricalEarnings(options?: {
|
|
1313
|
+
startDate?: string;
|
|
1314
|
+
endDate?: string;
|
|
1315
|
+
creatorId?: string;
|
|
1316
|
+
granularity?: 'monthly' | 'quarterly' | 'daily' | 'total';
|
|
1317
|
+
}): Promise<unknown>;
|
|
1318
|
+
getTransactions(startDate?: string, endDate?: string, creatorId?: string): Promise<unknown>;
|
|
1319
|
+
/** Issue credits to a user. 1000 credits = $1 USD (Soledgic standard rate). */
|
|
1320
|
+
issueCredits(userId: string, credits: number, options?: {
|
|
1321
|
+
reason?: string;
|
|
1322
|
+
referenceId?: string;
|
|
1323
|
+
}): Promise<unknown>;
|
|
1324
|
+
/** Convert earned credits to spendable balance. Minimum 5000 credits ($5). */
|
|
1325
|
+
convertCredits(userId: string, credits: number): Promise<unknown>;
|
|
1326
|
+
/** Spend spendable balance on creator content. Amount in cents. Split applies. */
|
|
1327
|
+
redeemCredits(userId: string, creatorId: string, amountCents: number, referenceId: string, options?: {
|
|
1328
|
+
description?: string;
|
|
1329
|
+
splitPercent?: number;
|
|
1330
|
+
}): Promise<unknown>;
|
|
1331
|
+
/** Get user's credit balance (unconverted) and spendable balance (converted). */
|
|
1332
|
+
getCreditBalance(userId: string): Promise<unknown>;
|
|
1333
|
+
generatePDF(reportType: 'creator_statement' | 'profit_loss' | 'trial_balance' | '1099', options?: {
|
|
1334
|
+
creatorId?: string;
|
|
1335
|
+
startDate?: string;
|
|
1336
|
+
endDate?: string;
|
|
1337
|
+
taxYear?: number;
|
|
1338
|
+
periodId?: string;
|
|
1339
|
+
}): Promise<{
|
|
1340
|
+
success: boolean;
|
|
1341
|
+
filename: string;
|
|
1342
|
+
data: string;
|
|
1343
|
+
frozen?: boolean;
|
|
1344
|
+
}>;
|
|
1345
|
+
getCreatorStatement(creatorId: string, startDate: string, endDate: string): Promise<{
|
|
1346
|
+
success: boolean;
|
|
1347
|
+
filename: string;
|
|
1348
|
+
data: string;
|
|
1349
|
+
frozen?: boolean;
|
|
1350
|
+
}>;
|
|
1351
|
+
getProfitLossPDF(startDate: string, endDate: string, periodId?: string): Promise<{
|
|
1352
|
+
success: boolean;
|
|
1353
|
+
filename: string;
|
|
1354
|
+
data: string;
|
|
1355
|
+
frozen?: boolean;
|
|
1356
|
+
}>;
|
|
1357
|
+
getTrialBalancePDF(): Promise<{
|
|
1358
|
+
success: boolean;
|
|
1359
|
+
filename: string;
|
|
1360
|
+
data: string;
|
|
1361
|
+
frozen?: boolean;
|
|
1362
|
+
}>;
|
|
1363
|
+
get1099PDF(taxYear: number): Promise<{
|
|
1364
|
+
success: boolean;
|
|
1365
|
+
filename: string;
|
|
1366
|
+
data: string;
|
|
1367
|
+
frozen?: boolean;
|
|
1368
|
+
}>;
|
|
1369
|
+
configureEmail(config: {
|
|
1370
|
+
enabled: boolean;
|
|
1371
|
+
sendDay?: number;
|
|
1372
|
+
fromName?: string;
|
|
1373
|
+
fromEmail?: string;
|
|
1374
|
+
subjectTemplate?: string;
|
|
1375
|
+
bodyTemplate?: string;
|
|
1376
|
+
ccAdmin?: boolean;
|
|
1377
|
+
adminEmail?: string;
|
|
1378
|
+
}): Promise<unknown>;
|
|
1379
|
+
sendMonthlyStatements(year?: number, month?: number): Promise<unknown>;
|
|
1380
|
+
sendCreatorStatement(creatorId: string, year?: number, month?: number): Promise<unknown>;
|
|
1381
|
+
previewStatementEmail(creatorId: string, year?: number, month?: number): Promise<unknown>;
|
|
1382
|
+
getEmailHistory(): Promise<unknown>;
|
|
1383
|
+
listWebhookEndpoints(): Promise<{
|
|
1384
|
+
success: any;
|
|
1385
|
+
data: any;
|
|
1386
|
+
}>;
|
|
1387
|
+
createWebhookEndpoint(config: {
|
|
1388
|
+
url: string;
|
|
1389
|
+
description?: string;
|
|
1390
|
+
events?: string[];
|
|
1391
|
+
}): Promise<{
|
|
1392
|
+
success: any;
|
|
1393
|
+
data: {
|
|
1394
|
+
secret: any;
|
|
1395
|
+
id: string;
|
|
1396
|
+
url: string;
|
|
1397
|
+
description: string | null;
|
|
1398
|
+
events: string[];
|
|
1399
|
+
isActive: boolean;
|
|
1400
|
+
createdAt: string;
|
|
1401
|
+
secretRotatedAt: string | null;
|
|
1402
|
+
};
|
|
1403
|
+
message: any;
|
|
1404
|
+
}>;
|
|
1405
|
+
updateWebhookEndpoint(endpointId: string, updates: {
|
|
1406
|
+
url?: string;
|
|
1407
|
+
description?: string;
|
|
1408
|
+
events?: string[];
|
|
1409
|
+
isActive?: boolean;
|
|
1410
|
+
}): Promise<{
|
|
1411
|
+
success: any;
|
|
1412
|
+
data: WebhookEndpoint;
|
|
1413
|
+
}>;
|
|
1414
|
+
deleteWebhookEndpoint(endpointId: string): Promise<{
|
|
1415
|
+
success: any;
|
|
1416
|
+
message: any;
|
|
1417
|
+
}>;
|
|
1418
|
+
testWebhookEndpoint(endpointId: string): Promise<{
|
|
1419
|
+
success: any;
|
|
1420
|
+
error: any;
|
|
1421
|
+
data: {
|
|
1422
|
+
delivered: boolean;
|
|
1423
|
+
status: any;
|
|
1424
|
+
responseTimeMs: any;
|
|
1425
|
+
};
|
|
1426
|
+
}>;
|
|
1427
|
+
getWebhookDeliveries(endpointId?: string, limit?: number): Promise<{
|
|
1428
|
+
success: any;
|
|
1429
|
+
data: any;
|
|
1430
|
+
}>;
|
|
1431
|
+
retryWebhookDelivery(deliveryId: string): Promise<{
|
|
1432
|
+
success: any;
|
|
1433
|
+
message: any;
|
|
1434
|
+
}>;
|
|
1435
|
+
rotateWebhookSecret(endpointId: string): Promise<{
|
|
1436
|
+
success: any;
|
|
1437
|
+
data: {
|
|
1438
|
+
secret: any;
|
|
1439
|
+
};
|
|
1440
|
+
message: any;
|
|
1441
|
+
}>;
|
|
1442
|
+
listAlerts(): Promise<{
|
|
1443
|
+
success: boolean;
|
|
1444
|
+
data: AlertConfiguration[];
|
|
1445
|
+
}>;
|
|
1446
|
+
createAlert(req: CreateAlertRequest): Promise<{
|
|
1447
|
+
success: boolean;
|
|
1448
|
+
data: AlertConfiguration;
|
|
1449
|
+
}>;
|
|
1450
|
+
updateAlert(req: UpdateAlertRequest): Promise<{
|
|
1451
|
+
success: boolean;
|
|
1452
|
+
data: AlertConfiguration;
|
|
1453
|
+
}>;
|
|
1454
|
+
deleteAlert(configId: string): Promise<{
|
|
1455
|
+
success: boolean;
|
|
1456
|
+
message: string;
|
|
1457
|
+
}>;
|
|
1458
|
+
testAlert(configId: string): Promise<AlertTestResult>;
|
|
1459
|
+
preflightAuthorization(req: PreflightAuthorizationRequest): Promise<PreflightAuthorizationResponse>;
|
|
1460
|
+
preflightAndRecordExpense(preflight: PreflightAuthorizationRequest, expense: Omit<RecordExpenseRequest, 'authorizationDecisionId'>): Promise<{
|
|
1461
|
+
preflight: PreflightAuthorizationResponse;
|
|
1462
|
+
transaction?: any;
|
|
1463
|
+
}>;
|
|
1464
|
+
preflightAndRecordBill(preflight: PreflightAuthorizationRequest, bill: Omit<RecordBillRequest, 'authorizationDecisionId'>): Promise<{
|
|
1465
|
+
preflight: PreflightAuthorizationResponse;
|
|
1466
|
+
transaction?: any;
|
|
1467
|
+
}>;
|
|
1468
|
+
getImportTemplates(): Promise<unknown>;
|
|
1469
|
+
parseImportFile(fileBase64: string, format?: 'csv' | 'ofx' | 'qfx' | 'auto'): Promise<unknown>;
|
|
1470
|
+
importTransactions(transactions: Array<{
|
|
1471
|
+
date: string;
|
|
1472
|
+
description: string;
|
|
1473
|
+
amount: number;
|
|
1474
|
+
reference?: string;
|
|
1475
|
+
}>): Promise<unknown>;
|
|
1476
|
+
saveImportTemplate(template: {
|
|
1477
|
+
name: string;
|
|
1478
|
+
bank_name: string;
|
|
1479
|
+
format: string;
|
|
1480
|
+
mapping: Record<string, string | number>;
|
|
1481
|
+
skip_rows?: number;
|
|
1482
|
+
delimiter?: string;
|
|
1483
|
+
}): Promise<unknown>;
|
|
1484
|
+
getEscrowSummary(): Promise<{
|
|
1485
|
+
success: any;
|
|
1486
|
+
summary: any;
|
|
1487
|
+
}>;
|
|
1488
|
+
getHeldFunds(options?: {
|
|
1489
|
+
ventureId?: string;
|
|
1490
|
+
creatorId?: string;
|
|
1491
|
+
readyOnly?: boolean;
|
|
1492
|
+
limit?: number;
|
|
1493
|
+
}): Promise<unknown>;
|
|
1494
|
+
releaseFunds(entryId: string, executeTransfer?: boolean): Promise<{
|
|
1495
|
+
success: any;
|
|
1496
|
+
release_id: any;
|
|
1497
|
+
entry_id: any;
|
|
1498
|
+
executed: boolean;
|
|
1499
|
+
transfer_id: any;
|
|
1500
|
+
transfer_status: any;
|
|
1501
|
+
amount: any;
|
|
1502
|
+
currency: any;
|
|
1503
|
+
}>;
|
|
1504
|
+
checkPayoutEligibility(participantId: string): Promise<{
|
|
1505
|
+
success: any;
|
|
1506
|
+
participant_id: any;
|
|
1507
|
+
eligible: boolean;
|
|
1508
|
+
available_balance: any;
|
|
1509
|
+
issues: any;
|
|
1510
|
+
requirements: any;
|
|
1511
|
+
}>;
|
|
1512
|
+
runHealthCheck(): Promise<unknown>;
|
|
1513
|
+
getHealthStatus(): Promise<unknown>;
|
|
1514
|
+
getHealthHistory(): Promise<unknown>;
|
|
1515
|
+
getAPAging(asOfDate?: string): Promise<unknown>;
|
|
1516
|
+
getARAging(asOfDate?: string): Promise<unknown>;
|
|
1517
|
+
getBalanceSheet(asOfDate?: string): Promise<unknown>;
|
|
1518
|
+
getDetailedTrialBalance(options?: {
|
|
1519
|
+
asOf?: string;
|
|
1520
|
+
snapshot?: boolean;
|
|
1521
|
+
}): Promise<unknown>;
|
|
1522
|
+
getDetailedProfitLoss(options?: {
|
|
1523
|
+
year?: number;
|
|
1524
|
+
month?: number;
|
|
1525
|
+
quarter?: number;
|
|
1526
|
+
startDate?: string;
|
|
1527
|
+
endDate?: string;
|
|
1528
|
+
breakdown?: 'monthly';
|
|
1529
|
+
}): Promise<unknown>;
|
|
1530
|
+
getRunway(): Promise<unknown>;
|
|
1531
|
+
createParticipant(req: CreateParticipantRequest): Promise<CreateParticipantResponse>;
|
|
1532
|
+
listParticipants(): Promise<{
|
|
1533
|
+
success: boolean;
|
|
1534
|
+
participants: ParticipantSummary[];
|
|
1535
|
+
}>;
|
|
1536
|
+
getParticipant(participantId: string): Promise<{
|
|
1537
|
+
success: boolean;
|
|
1538
|
+
participant: ParticipantDetail;
|
|
1539
|
+
}>;
|
|
1540
|
+
getParticipantPayoutEligibility(participantId: string): Promise<ParticipantPayoutEligibilityResponse>;
|
|
1541
|
+
createLedger(req: CreateLedgerRequest): Promise<CreateLedgerResponse>;
|
|
1542
|
+
recordAdjustment(req: RecordAdjustmentRequest): Promise<unknown>;
|
|
1543
|
+
recordOpeningBalance(req: RecordOpeningBalanceRequest): Promise<unknown>;
|
|
1544
|
+
recordTransfer(req: RecordTransferRequest): Promise<unknown>;
|
|
1545
|
+
evaluateFraud(req: RiskEvaluationRequest): Promise<RiskEvaluationResponse>;
|
|
1546
|
+
createFraudPolicy(req: CreatePolicyRequest): Promise<FraudPolicyResponse>;
|
|
1547
|
+
listFraudPolicies(): Promise<FraudPolicyListResponse>;
|
|
1548
|
+
deleteFraudPolicy(policyId: string): Promise<FraudPolicyDeleteResponse>;
|
|
1549
|
+
calculateTaxForParticipant(participantId: string, taxYear?: number): Promise<TaxCalculationResponse>;
|
|
1550
|
+
generateAllTaxDocuments(taxYear?: number): Promise<TaxDocumentGenerationResponse>;
|
|
1551
|
+
listTaxDocuments(taxYear?: number): Promise<TaxDocumentsResponse>;
|
|
1552
|
+
getTaxDocument(documentId: string): Promise<TaxDocumentResponse>;
|
|
1553
|
+
exportTaxDocuments(taxYear?: number, format?: 'csv' | 'json'): Promise<unknown>;
|
|
1554
|
+
markTaxDocumentFiled(documentId: string): Promise<TaxDocumentResponse>;
|
|
1555
|
+
generateTaxSummary(taxYear: number, creatorId?: string): Promise<TaxSummaryResponse>;
|
|
1556
|
+
markTaxDocumentsFiledBulk(taxYear: number): Promise<any>;
|
|
1557
|
+
correctTaxDocument(documentId: string, params: {
|
|
1558
|
+
reason: string;
|
|
1559
|
+
grossAmount?: number;
|
|
1560
|
+
federalWithholding?: number;
|
|
1561
|
+
stateWithholding?: number;
|
|
1562
|
+
}): Promise<any>;
|
|
1563
|
+
deliverTaxDocumentCopyB(taxYear: number): Promise<any>;
|
|
1564
|
+
generateTaxDocumentPdf(documentId: string, copyType?: string): Promise<any>;
|
|
1565
|
+
generateTaxDocumentPdfBatch(taxYear: number, copyType?: string): Promise<any>;
|
|
1566
|
+
getComplianceOverview(options?: {
|
|
1567
|
+
days?: number;
|
|
1568
|
+
hours?: number;
|
|
1569
|
+
}): Promise<ComplianceOverviewResponse>;
|
|
1570
|
+
listComplianceAccessPatterns(options?: {
|
|
1571
|
+
hours?: number;
|
|
1572
|
+
limit?: number;
|
|
1573
|
+
}): Promise<ComplianceAccessPatternsResponse>;
|
|
1574
|
+
listComplianceFinancialActivity(options?: {
|
|
1575
|
+
days?: number;
|
|
1576
|
+
}): Promise<ComplianceFinancialActivityResponse>;
|
|
1577
|
+
listComplianceSecuritySummary(options?: {
|
|
1578
|
+
days?: number;
|
|
1579
|
+
}): Promise<ComplianceSecuritySummaryResponse>;
|
|
1580
|
+
exportReport(req: ExportReportRequest & {
|
|
1581
|
+
format: 'json';
|
|
1582
|
+
}): Promise<ExportReportJsonResponse>;
|
|
1583
|
+
exportReport(req: ExportReportRequest & {
|
|
1584
|
+
format: 'csv';
|
|
1585
|
+
}): Promise<ExportReportCsvResponse>;
|
|
1586
|
+
exportReport(req: ExportReportRequest): Promise<ExportReportJsonResponse | ExportReportCsvResponse>;
|
|
1587
|
+
uploadReceipt(req: UploadReceiptRequest): Promise<UploadReceiptResponse>;
|
|
1588
|
+
receivePayment(req: ReceivePaymentRequest): Promise<ReceivePaymentResponse>;
|
|
1589
|
+
sendBreachAlert(req: SendBreachAlertRequest): Promise<SendBreachAlertResponse>;
|
|
1590
|
+
private mapWalletObject;
|
|
1591
|
+
listWallets(filters?: ListWalletsRequest): Promise<ListWalletsResponse>;
|
|
1592
|
+
createWallet(req: CreateWalletRequest): Promise<CreateWalletResponse>;
|
|
1593
|
+
getWallet(walletId: string): Promise<GetWalletResponse>;
|
|
1594
|
+
getWalletEntries(walletId: string, options?: {
|
|
1595
|
+
limit?: number;
|
|
1596
|
+
offset?: number;
|
|
1597
|
+
}): Promise<WalletEntriesResponse>;
|
|
1598
|
+
topUpWallet(req: WalletTopupRequest): Promise<WalletTopupResponse>;
|
|
1599
|
+
withdrawFromWallet(req: WalletWithdrawRequest): Promise<WalletWithdrawalResponse>;
|
|
1600
|
+
createTransfer(req: ParticipantTransferRequest): Promise<ParticipantTransferResponse>;
|
|
1601
|
+
listHolds(options?: HoldQueryOptions): Promise<HeldFundsResponse>;
|
|
1602
|
+
getHoldSummary(): Promise<HeldFundsSummaryResponse>;
|
|
1603
|
+
releaseHold(req: ReleaseHoldRequest): Promise<ReleaseHoldResponse>;
|
|
1604
|
+
createCheckoutSession(req: CreateCheckoutSessionRequest): Promise<CheckoutSessionResourceResponse>;
|
|
1605
|
+
createPayout(req: CreatePayoutRequest): Promise<PayoutResourceResponse>;
|
|
1606
|
+
createRefund(req: CreateRefundRequest): Promise<RefundResourceResponse>;
|
|
1607
|
+
listRefunds(req?: ListRefundsRequest): Promise<ListRefundsResponse>;
|
|
1608
|
+
createInvoice(req: CreateInvoiceRequest): Promise<any>;
|
|
1609
|
+
listInvoices(options?: {
|
|
1610
|
+
status?: string;
|
|
1611
|
+
customerId?: string;
|
|
1612
|
+
limit?: number;
|
|
1613
|
+
offset?: number;
|
|
1614
|
+
}): Promise<any>;
|
|
1615
|
+
getInvoice(invoiceId: string): Promise<any>;
|
|
1616
|
+
sendInvoice(invoiceId: string): Promise<any>;
|
|
1617
|
+
recordInvoicePayment(invoiceId: string, req: RecordInvoicePaymentRequest): Promise<any>;
|
|
1618
|
+
voidInvoice(invoiceId: string, reason?: string): Promise<any>;
|
|
1619
|
+
payBill(req: PayBillRequest): Promise<any>;
|
|
1620
|
+
createBudget(req: CreateBudgetRequest): Promise<any>;
|
|
1621
|
+
listBudgets(): Promise<any>;
|
|
1622
|
+
createRecurring(req: CreateRecurringRequest): Promise<any>;
|
|
1623
|
+
listRecurring(): Promise<any>;
|
|
1624
|
+
getDueRecurring(days?: number): Promise<any>;
|
|
1625
|
+
createContractor(req: CreateContractorRequest): Promise<any>;
|
|
1626
|
+
listContractors(): Promise<any>;
|
|
1627
|
+
recordContractorPayment(req: RecordContractorPaymentRequest): Promise<any>;
|
|
1628
|
+
createBankAccount(req: CreateBankAccountRequest): Promise<any>;
|
|
1629
|
+
listBankAccounts(): Promise<any>;
|
|
1630
|
+
listLedgers(): Promise<any>;
|
|
1631
|
+
deleteCreator(creatorId: string): Promise<any>;
|
|
1632
|
+
submitTaxInfo(req: SubmitTaxInfoRequest): Promise<any>;
|
|
1633
|
+
importBankStatement(req: ImportBankStatementRequest): Promise<any>;
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
export { type AlertChannel, type AlertConfiguration, type AlertTestResult, type AlertThresholds, type AlertType, AuthenticationError, type AuthorizationDecisionType, type AuthorizationPolicy, type AuthorizationResult, type AutoMatchReconciliationResponse, type BackdatePolicyRequest, type BreachRisk, type CheckoutBreakdown, type CheckoutSessionResourceResponse, type ComplianceAccessPatternsResponse, type ComplianceFinancialActivityResponse, type ComplianceOverviewResponse, type ComplianceSecuritySummaryResponse, ConflictError, type CreateAlertRequest, type CreateBankAccountRequest, type CreateBudgetRequest, type CreateCheckoutSessionRequest, type CreateContractorRequest, type CreateInvoiceRequest, type CreateLedgerRequest, type CreateLedgerResponse, type CreateParticipantRequest, type CreateParticipantResponse, type CreatePayoutRequest, type CreatePeriodRequest, type CreatePolicyRequest, type CreateRecurringRequest, type CreateRefundRequest, type CreateSnapshotRequest, type CreateWalletRequest, type CreateWalletResponse, DEFAULT_API_VERSION, DEFAULT_BASE_URL, type EmailAlertConfig, type ExportReportCsvResponse, type ExportReportJsonResponse, type ExportReportRequest, type ExtractedTerms, type FraudPolicyDeleteResponse, type FraudPolicyListResponse, type FraudPolicyResource, type FraudPolicyResponse, type FrozenStatement, type GetWalletResponse, type HeldFund, type HeldFundsResponse, type HeldFundsSummaryResponse, type HoldQueryOptions, type ImportBankStatementLine, type ImportBankStatementRequest, type InvoiceLineItem, type ListRefundsRequest, type ListRefundsResponse, type ListWalletsRequest, type ListWalletsResponse, NotFoundError, type ObligationItem, type Obligations, type ParsedWebhookEvent, type ParticipantDetail, type ParticipantPayoutEligibilityResponse, type ParticipantPayoutPreferences, type ParticipantSummary, type ParticipantTaxInfo, type ParticipantTransferRequest, type ParticipantTransferResponse, type ParticipantWalletMutationRequest, type PayBillRequest, type PayoutResourceResponse, type Period, type PolicySeverity, type PolicyType, type PolicyViolation, type PreflightAuthorizationRequest, type PreflightAuthorizationResponse, type PreflightResult, type ProjectIntentRequest, type ProjectIntentResponse, type ProjectionMatch, type ReceivePaymentRequest, type ReceivePaymentResponse, type ReconcileMatchRequest, type ReconciliationMatchResponse, type ReconciliationSnapshot, type ReconciliationUnmatchResponse, type RecordAdjustmentRequest, type RecordBillRequest, type RecordContractorPaymentRequest, type RecordExpenseRequest, type RecordIncomeRequest, type RecordInvoicePaymentRequest, type RecordOpeningBalanceRequest, type RecordRefundResponse, type RecordTransferRequest, type RefundResourceResponse, type RefundSummary, type RegisterInstrumentRequest, type RegisterInstrumentResponse, type ReleaseHoldRequest, type ReleaseHoldResponse, type ReverseResponse, type ReverseTransactionRequest, type RiskEvaluationRequest, type RiskEvaluationResponse, type SendBreachAlertRequest, type SendBreachAlertResponse, type SlackAlertConfig, Soledgic, type SoledgicConfig, SoledgicError, type SubmitTaxInfoRequest, type TaxCalculationResponse, type TaxDocumentGenerationResponse, type TaxDocumentResponse, type TaxDocumentsResponse, type TaxSummaryResponse, type UnmatchedTransactionsResponse, type UpdateAlertRequest, type UploadReceiptRequest, type UploadReceiptResponse, ValidationError, type VerifyWebhookSignatureOptions, type WalletEntriesResponse, type WalletHistoryEntry, type WalletObject, type WalletTopupRequest, type WalletTopupResponse, type WalletWithdrawRequest, type WalletWithdrawalResponse, type WebhookDelivery, type WebhookEndpoint, type WebhookEndpointSecretResult, type WebhookPayloadInput, Soledgic as default, hmacHex, isArrayBufferView, mapWebhookDelivery, mapWebhookEndpoint, parseWebhookEvent, parseWebhookSignatureHeader, resolveWebhookEndpointUrl, timingSafeEqual, verifyWebhookSignature, webhookPayloadToString };
|