@smartbills/sdk 1.1.0-alpha.26 → 1.1.0-alpha.28

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.
@@ -1,5 +1,578 @@
1
1
  import { AxiosRequestConfig } from 'axios';
2
2
 
3
+ /**
4
+ * A receipt in the Smartbills system.
5
+ *
6
+ * Receipts are the core documents that track purchases, expenses, and transactions.
7
+ * They can be created manually, via OCR scanning, through email extraction, or
8
+ * from third-party integrations.
9
+ *
10
+ * @see {@link ReceiptCreateRequest} for creating a new receipt
11
+ * @see {@link ReceiptUpdateRequest} for updating an existing receipt
12
+ */
13
+ interface SBReceipt extends SBEntity, SBTimestamps {
14
+ type: ReceiptType;
15
+ source: ReceiptSource;
16
+ title?: string;
17
+ receiptNumber?: string;
18
+ currency?: string;
19
+ subTotal: number;
20
+ total: number;
21
+ totalDiscounts: number;
22
+ totalItems: number;
23
+ totalFees: number;
24
+ totalTaxes: number;
25
+ totalShipping: number;
26
+ totalTip: number;
27
+ date?: string;
28
+ cancelReason?: string;
29
+ originalReceiptUrl?: string;
30
+ barcode?: SBReceiptBarcode;
31
+ billingAddress?: SBBillingAddress;
32
+ business?: SBReceiptBusiness;
33
+ customer?: SBReceiptCustomer;
34
+ discounts?: SBReceiptDiscount[];
35
+ documents?: SBReceiptDocument[];
36
+ items?: SBReceiptLineItem[];
37
+ fees?: SBReceiptFee[];
38
+ payments?: SBReceiptPayment[];
39
+ refunds?: SBReceiptRefund[];
40
+ taxes?: SBReceiptTax[];
41
+ transactions?: SBReceiptTransaction[];
42
+ vendor?: SBReceiptVendor;
43
+ userId?: number;
44
+ businessId?: number;
45
+ checkoutStatus?: number;
46
+ }
47
+ /**
48
+ * A barcode associated with a receipt.
49
+ */
50
+ interface SBReceiptBarcode {
51
+ value: string;
52
+ format?: string;
53
+ }
54
+ /**
55
+ * The business information displayed on a receipt.
56
+ */
57
+ interface SBReceiptBusiness {
58
+ id?: number;
59
+ name?: string;
60
+ logo?: string;
61
+ address?: string;
62
+ }
63
+ /**
64
+ * Customer information associated with a receipt.
65
+ */
66
+ interface SBReceiptCustomer {
67
+ id?: number;
68
+ name?: string;
69
+ email?: string;
70
+ phone?: string;
71
+ }
72
+ /**
73
+ * A discount applied to a receipt.
74
+ */
75
+ interface SBReceiptDiscount {
76
+ name?: string;
77
+ amount: number;
78
+ percentage?: number;
79
+ }
80
+ /**
81
+ * A document attached to a receipt (e.g., PDF, image).
82
+ */
83
+ interface SBReceiptDocument {
84
+ id?: number;
85
+ name: string;
86
+ url?: string;
87
+ mimeType?: string;
88
+ createdAt?: string;
89
+ }
90
+ /**
91
+ * An individual line item on a receipt.
92
+ */
93
+ interface SBReceiptLineItem extends SBEntity {
94
+ name: string;
95
+ description?: string;
96
+ quantity: number;
97
+ unitPrice: number;
98
+ total: number;
99
+ sku?: string;
100
+ category?: string;
101
+ taxes?: SBReceiptTax[];
102
+ discounts?: SBReceiptDiscount[];
103
+ }
104
+ /**
105
+ * A fee applied to a receipt (e.g., service charge, delivery fee).
106
+ */
107
+ interface SBReceiptFee {
108
+ name: string;
109
+ amount: number;
110
+ }
111
+ /**
112
+ * A payment recorded against a receipt.
113
+ */
114
+ interface SBReceiptPayment extends SBEntity {
115
+ type: ReceiptPaymentType;
116
+ status: ReceiptPaymentStatus;
117
+ amount: number;
118
+ tip?: number;
119
+ billingAddress?: SBBillingAddress;
120
+ card?: SBReceiptPaymentCard;
121
+ statementDescriptor?: string;
122
+ receiptNumber?: string;
123
+ receiptUrl?: string;
124
+ }
125
+ /**
126
+ * Credit or debit card details for a receipt payment.
127
+ */
128
+ interface SBReceiptPaymentCard {
129
+ brand?: string;
130
+ last4?: string;
131
+ expirationMonth?: number;
132
+ expirationYear?: number;
133
+ }
134
+ /**
135
+ * A refund issued against a receipt.
136
+ */
137
+ interface SBReceiptRefund extends SBEntity {
138
+ note?: string;
139
+ processedAt?: string;
140
+ amount?: SBMoney;
141
+ }
142
+ /**
143
+ * A tax line on a receipt.
144
+ */
145
+ interface SBReceiptTax {
146
+ name: string;
147
+ amount: number;
148
+ rate?: number;
149
+ taxNumber?: string;
150
+ }
151
+ /**
152
+ * A transaction linked to a receipt.
153
+ */
154
+ interface SBReceiptTransaction extends SBEntity {
155
+ amount: number;
156
+ currency?: string;
157
+ date?: string;
158
+ }
159
+ /**
160
+ * Vendor (merchant) information displayed on a receipt.
161
+ */
162
+ interface SBReceiptVendor {
163
+ id?: number;
164
+ name?: string;
165
+ logo?: string;
166
+ }
167
+ /**
168
+ * Request payload for creating a new receipt.
169
+ */
170
+ interface ReceiptCreateRequest {
171
+ title?: string;
172
+ receiptNumber?: string;
173
+ currency?: string;
174
+ date?: string;
175
+ subTotal?: number;
176
+ total?: number;
177
+ items?: Omit<SBReceiptLineItem, "id">[];
178
+ taxes?: SBReceiptTax[];
179
+ fees?: SBReceiptFee[];
180
+ discounts?: SBReceiptDiscount[];
181
+ payments?: Omit<SBReceiptPayment, "id">[];
182
+ }
183
+ /**
184
+ * Request payload for updating an existing receipt.
185
+ */
186
+ interface ReceiptUpdateRequest extends ReceiptCreateRequest {
187
+ id: number;
188
+ }
189
+ /**
190
+ * Request parameters for listing receipts with filters and pagination.
191
+ */
192
+ interface ReceiptListRequest {
193
+ page?: number;
194
+ limit?: number;
195
+ search?: string;
196
+ sortBy?: string;
197
+ sortDirection?: "asc" | "desc";
198
+ startDate?: string;
199
+ endDate?: string;
200
+ vendorId?: number;
201
+ businessId?: number;
202
+ }
203
+ /**
204
+ * Request payload for creating a receipt from an OCR-scanned image.
205
+ */
206
+ interface ReceiptOCRCreateRequest {
207
+ file: File | Blob;
208
+ businessId?: number;
209
+ }
210
+
211
+ /**
212
+ * Lifecycle status from the issuer's perspective (AR side). Set by the merchant
213
+ * who issued the invoice. Stripe-aligned. Distinct from {@link SBBillStatus} —
214
+ * when both businesses are on the platform, both fields exist on the same
215
+ * underlying row and evolve independently.
216
+ */
217
+ declare enum SBInvoiceStatus {
218
+ DRAFT = "Draft",
219
+ OPEN = "Open",
220
+ PAID = "Paid",
221
+ VOID = "Void",
222
+ UNCOLLECTIBLE = "Uncollectible"
223
+ }
224
+ /**
225
+ * Lifecycle status from the recipient's perspective (AP side — accounts payable).
226
+ * Captures the recipient's internal approval workflow → scheduling → payment
227
+ * execution. Distinct from {@link SBInvoiceStatus}; both can coexist on the same row.
228
+ */
229
+ declare enum SBBillStatus {
230
+ DRAFT = "Draft",
231
+ PENDING_APPROVAL = "PendingApproval",
232
+ APPROVED = "Approved",
233
+ READY_FOR_PAYMENT = "ReadyForPayment",
234
+ SCHEDULED = "Scheduled",
235
+ PROCESSING = "Processing",
236
+ PAYMENT_FAILED = "PaymentFailed",
237
+ DENIED = "Denied",
238
+ PAID = "Paid",
239
+ VOID = "Void"
240
+ }
241
+ /**
242
+ * Payment state — shared between issuer and recipient. Money is objective: when
243
+ * payment is received, both sides see the same value. Orthogonal to
244
+ * {@link SBInvoiceStatus} and {@link SBBillStatus}.
245
+ */
246
+ declare enum SBPaymentStatus {
247
+ UNPAID = "Unpaid",
248
+ PARTIALLY_PAID = "PartiallyPaid",
249
+ PAID = "Paid",
250
+ PARTIALLY_REFUNDED = "PartiallyRefunded",
251
+ REFUNDED = "Refunded"
252
+ }
253
+ declare enum PaymentTerms {
254
+ UPON_RECEIPT = "UponReceipt",
255
+ NET_7 = "Net7",
256
+ NET_15 = "Net15",
257
+ NET_30 = "Net30",
258
+ NET_45 = "Net45",
259
+ NET_60 = "Net60",
260
+ NET_90 = "Net90",
261
+ CUSTOM = "Custom"
262
+ }
263
+ /**
264
+ * Customer projection embedded on an invoice. Carries the billing/shipping address
265
+ * for the invoice — addresses live under the customer rather than at the top level
266
+ * because the customer is who's billed/shipped to.
267
+ */
268
+ interface SBInvoiceCustomer {
269
+ id?: number;
270
+ firstName?: string;
271
+ lastName?: string;
272
+ email?: string;
273
+ phoneNumber?: string;
274
+ company?: string;
275
+ billingAddress?: SBAddress;
276
+ shippingAddress?: SBAddress;
277
+ }
278
+ interface SBInvoiceMerchant {
279
+ businessId?: number;
280
+ name?: string;
281
+ logo?: string;
282
+ email?: string;
283
+ phoneNumber?: string;
284
+ website?: string;
285
+ address?: SBAddress;
286
+ }
287
+ interface SBInvoiceEmployee {
288
+ id?: number;
289
+ firstName?: string;
290
+ lastName?: string;
291
+ name?: string;
292
+ email?: string;
293
+ avatar?: string;
294
+ }
295
+ interface SBInvoiceLineItemTax {
296
+ id?: number;
297
+ name?: string;
298
+ rate?: number;
299
+ amount?: SBMoney;
300
+ taxId?: number;
301
+ }
302
+ interface SBInvoiceLineItem {
303
+ id?: number;
304
+ description?: string;
305
+ quantity?: number;
306
+ unitPrice?: number;
307
+ price?: SBMoney;
308
+ subTotal?: SBMoney;
309
+ total?: SBMoney;
310
+ amount?: number;
311
+ productId?: number;
312
+ product?: {
313
+ id?: number;
314
+ name?: string;
315
+ sku?: string;
316
+ };
317
+ taxable?: boolean;
318
+ taxIds?: number[];
319
+ taxes?: SBInvoiceLineItemTax[];
320
+ }
321
+ interface SBInvoiceRecurring {
322
+ isRecurring: boolean;
323
+ interval?: string;
324
+ intervalCount: number;
325
+ startDate?: string;
326
+ endDate?: string;
327
+ nextScheduledDate?: string;
328
+ lastGeneratedDate?: string;
329
+ maxOccurrences?: number;
330
+ occurrenceCount: number;
331
+ isPaused: boolean;
332
+ parentInvoiceId?: number;
333
+ }
334
+ interface SBInvoiceStripeLinks {
335
+ paymentIntentId?: string;
336
+ shortCode?: string;
337
+ paymentLinkUrl?: string;
338
+ checkoutUrl?: string;
339
+ }
340
+ interface SBPaymentMethodCardInfo {
341
+ last4?: string;
342
+ brand?: string;
343
+ bin?: string;
344
+ countryCode?: string;
345
+ fingerprint?: string;
346
+ expirationMonth?: number;
347
+ expirationYear?: number;
348
+ }
349
+ interface SBPaymentMethodBankAccountInfo {
350
+ last4?: string;
351
+ bankName?: string;
352
+ accountType?: string;
353
+ }
354
+ interface SBPaymentMethodInfo {
355
+ type?: string;
356
+ card?: SBPaymentMethodCardInfo;
357
+ bankAccount?: SBPaymentMethodBankAccountInfo;
358
+ }
359
+ /**
360
+ * Authenticated invoice projection. Totals and lifecycle dates are flat on the root
361
+ * (matches the .NET <c>SBInvoiceResponse</c> shape).
362
+ */
363
+ interface SBInvoice extends SBEntity, SBTimestamps {
364
+ invoiceNumber?: string;
365
+ /** Generic transaction-level status (Pending/Posted/etc.) — distinct from {@link status}. */
366
+ transactionStatus?: string;
367
+ /** Document lifecycle status (Draft/Open/Paid/Void/...). */
368
+ invoiceStatus?: SBInvoiceStatus;
369
+ /** Payment state (Unpaid/Partial/Paid/Refunded). Orthogonal to {@link status}. */
370
+ paymentStatus?: SBPaymentStatus;
371
+ isOverdue?: boolean;
372
+ isPaid?: boolean;
373
+ currency?: string;
374
+ merchant?: SBInvoiceMerchant;
375
+ customer?: SBInvoiceCustomer;
376
+ employee?: SBInvoiceEmployee;
377
+ lineItems?: SBInvoiceLineItem[];
378
+ lineItemGroups?: unknown[];
379
+ taxes?: SBInvoiceLineItemTax[];
380
+ discounts?: unknown[];
381
+ fees?: unknown[];
382
+ subTotal?: SBMoney;
383
+ totalTaxes?: SBMoney;
384
+ totalDiscounts?: SBMoney;
385
+ totalFees?: SBMoney;
386
+ total?: SBMoney;
387
+ amountPaid?: SBMoney;
388
+ amountDue?: SBMoney;
389
+ balanceForward?: SBMoney;
390
+ amountOverpaid?: SBMoney;
391
+ date?: string;
392
+ dueDate?: string;
393
+ paymentTerms?: string;
394
+ sentAt?: string;
395
+ viewedAt?: string;
396
+ paidAt?: string;
397
+ voidedAt?: string;
398
+ billingPeriodStartDate?: string;
399
+ billingPeriodEndDate?: string;
400
+ autoPaymentDate?: string;
401
+ payments?: SBReceiptPayment[];
402
+ recurring?: SBInvoiceRecurring | null;
403
+ stripe?: SBInvoiceStripeLinks;
404
+ reminders?: InvoiceReminder[];
405
+ }
406
+ interface InvoiceListRequest extends PaginationRequest {
407
+ invoiceStatus?: SBInvoiceStatus;
408
+ paymentStatus?: SBPaymentStatus;
409
+ customerId?: number;
410
+ customerName?: string;
411
+ invoiceNumber?: string;
412
+ fromIssueDate?: string;
413
+ toIssueDate?: string;
414
+ fromDueDate?: string;
415
+ toDueDate?: string;
416
+ minAmount?: number;
417
+ maxAmount?: number;
418
+ isOverdue?: boolean;
419
+ isPaid?: boolean;
420
+ isRecurring?: boolean;
421
+ search?: string;
422
+ }
423
+ declare enum InvoiceReminderFrequency {
424
+ ONCE = "ONCE",
425
+ WEEKLY = "WEEKLY",
426
+ BIWEEKLY = "BIWEEKLY",
427
+ MONTHLY = "MONTHLY"
428
+ }
429
+ declare enum InvoiceReminderTiming {
430
+ BEFORE_DUE = "BEFORE_DUE",
431
+ ON_DUE = "ON_DUE",
432
+ AFTER_DUE = "AFTER_DUE"
433
+ }
434
+ interface InvoiceReminder {
435
+ id?: number;
436
+ enabled: boolean;
437
+ timing: InvoiceReminderTiming;
438
+ daysOffset: number;
439
+ frequency: InvoiceReminderFrequency;
440
+ maxReminders: number;
441
+ message?: string;
442
+ }
443
+ interface InvoiceFeeCreateRequest {
444
+ feeId?: number;
445
+ name?: string;
446
+ amount?: number;
447
+ percentage?: number;
448
+ type?: "FIXED" | "PERCENTAGE";
449
+ }
450
+ interface InvoiceDiscountCreateRequest {
451
+ promoCodeId?: number;
452
+ name?: string;
453
+ amount?: number;
454
+ percentage?: number;
455
+ type?: "FIXED" | "PERCENTAGE";
456
+ }
457
+ interface InvoiceCreateRequest {
458
+ invoiceNumber?: string;
459
+ date?: string;
460
+ dueDate?: string;
461
+ paymentTerms?: PaymentTerms;
462
+ billingPeriodStartDate?: string;
463
+ billingPeriodEndDate?: string;
464
+ autoPaymentDate?: string;
465
+ amountDue?: SBMoney;
466
+ balanceForward?: SBMoney;
467
+ paymentLinkUrl?: string;
468
+ customerId?: number;
469
+ vendorId?: number;
470
+ employeeId?: number;
471
+ currency?: string;
472
+ note?: string;
473
+ lineItems?: Omit<SBInvoiceLineItem, "id" | "product" | "taxes" | "price" | "subTotal" | "total">[];
474
+ fees?: InvoiceFeeCreateRequest[];
475
+ discounts?: InvoiceDiscountCreateRequest[];
476
+ billingAddress?: SBAddress;
477
+ shippingAddress?: SBAddress;
478
+ reminders?: InvoiceReminder[];
479
+ }
480
+ type InvoiceUpdateRequest = Partial<InvoiceCreateRequest>;
481
+ interface NextInvoiceNumberResponse {
482
+ invoiceNumber: string;
483
+ prefix: string;
484
+ sequenceNumber: number;
485
+ }
486
+ interface InvoiceSummary {
487
+ totalRevenue: number;
488
+ outstanding: number;
489
+ overdueCount: number;
490
+ paidThisMonth: number;
491
+ totalCount: number;
492
+ draftCount: number;
493
+ sentCount: number;
494
+ paidCount: number;
495
+ }
496
+ interface PublicInvoiceMerchantSocial {
497
+ facebook?: string;
498
+ instagram?: string;
499
+ linkedIn?: string;
500
+ tikTok?: string;
501
+ twitter?: string;
502
+ youTube?: string;
503
+ }
504
+ interface PublicInvoiceMerchant {
505
+ businessId?: number;
506
+ name?: string;
507
+ logo?: string;
508
+ website?: string;
509
+ email?: string;
510
+ phoneNumber?: string;
511
+ address?: SBAddress;
512
+ social?: PublicInvoiceMerchantSocial;
513
+ }
514
+ interface PublicInvoiceCustomer {
515
+ firstName?: string;
516
+ lastName?: string;
517
+ company?: string;
518
+ email?: string;
519
+ billingAddress?: SBAddress;
520
+ shippingAddress?: SBAddress;
521
+ }
522
+ interface PublicInvoiceLineItem {
523
+ name?: string;
524
+ description?: string;
525
+ quantity?: number;
526
+ unitPrice?: SBMoney;
527
+ total?: SBMoney;
528
+ }
529
+ interface PublicInvoicePaymentCardSnippet {
530
+ brand?: string;
531
+ last4?: string;
532
+ }
533
+ interface PublicInvoicePayment {
534
+ /**
535
+ * Payment id. Used by the renderer to resolve a specific payment for
536
+ * receipt URLs (e.g. `/i/{shortCode}?receipt=1&paymentId={id}`).
537
+ */
538
+ id: number;
539
+ amount?: SBMoney;
540
+ paidAt?: string;
541
+ method?: string;
542
+ card?: PublicInvoicePaymentCardSnippet;
543
+ }
544
+ interface PublicInvoiceMerchantRating {
545
+ average: number;
546
+ count: number;
547
+ breakdown: Record<number, number>;
548
+ }
549
+ /**
550
+ * Public-payment-page projection. The public DTO is intentionally status-free; the
551
+ * only state surfaced is {@link isOverdue}.
552
+ */
553
+ interface PublicInvoiceResponse {
554
+ id: number;
555
+ invoiceNumber?: string;
556
+ currency?: string;
557
+ isOverdue?: boolean;
558
+ merchant?: PublicInvoiceMerchant;
559
+ customer?: PublicInvoiceCustomer;
560
+ lineItems?: PublicInvoiceLineItem[];
561
+ subTotal?: SBMoney;
562
+ totalTaxes?: SBMoney;
563
+ totalDiscounts?: SBMoney;
564
+ totalFees?: SBMoney;
565
+ total?: SBMoney;
566
+ amountPaid?: SBMoney;
567
+ amountDue?: SBMoney;
568
+ issuedAt?: string;
569
+ dueDate?: string;
570
+ shortCode?: string;
571
+ checkoutUrl?: string;
572
+ payments?: PublicInvoicePayment[];
573
+ merchantRating?: PublicInvoiceMerchantRating;
574
+ }
575
+
3
576
  /**
4
577
  * The type classification of a transaction.
5
578
  *
@@ -167,29 +740,7 @@ declare enum BillApprovalType {
167
740
  /** Direct manager approval is required */
168
741
  MANAGER = "MANAGER"
169
742
  }
170
- /**
171
- * The current status of a bill in its lifecycle.
172
- *
173
- * Bills progress through these states from creation to payment.
174
- */
175
- declare enum BillStatus {
176
- /** Bill is being drafted and has not been submitted */
177
- DRAFT = "DRAFT",
178
- /** Bill is awaiting approval from designated approvers */
179
- PENDING_APPROVAL = "PENDING_APPROVAL",
180
- /** Bill has been approved and is ready for payment */
181
- APPROVED = "APPROVED",
182
- /** Bill payment has been scheduled for a future date */
183
- SCHEDULED = "SCHEDULED",
184
- /** Bill has been fully paid */
185
- PAID = "PAID",
186
- /** Bill has been cancelled */
187
- CANCELLED = "CANCELLED",
188
- /** Bill is past the due date and unpaid */
189
- OVERDUE = "OVERDUE",
190
- /** Automated payment attempt failed */
191
- PAYMENT_FAILED = "PAYMENT_FAILED"
192
- }
743
+
193
744
  /**
194
745
  * The role of a user within a business organization.
195
746
  *
@@ -1567,41 +2118,82 @@ declare class BillingService extends BaseService {
1567
2118
  }
1568
2119
 
1569
2120
  /**
1570
- * A bill (accounts payable) in the Smartbills system.
2121
+ * AP (vendor bill) entity. Distinct from {@link SBInvoice} (AR) they share the same
2122
+ * backend table but the wire-format projections are intentionally separate so each can
2123
+ * evolve independently without cross-contamination.
1571
2124
  *
1572
- * Bills represent money owed to vendors. They support a full lifecycle
1573
- * from draft creation through approval, scheduling, and payment.
1574
- *
1575
- * @see {@link BillCreateRequest} for creating a new bill
1576
- * @see {@link BillUpdateRequest} for updating an existing bill
2125
+ * Bills carry the approval workflow (PendingApproval/Approved/Scheduled/...), vendor
2126
+ * info, and payment-execution details. Customer-facing concerns (Stripe links, recurring,
2127
+ * sent/viewed engagement) belong on {@link SBInvoice}.
1577
2128
  */
1578
2129
  interface SBBill extends SBEntity, SBTimestamps {
1579
- title?: string;
2130
+ businessId?: number;
1580
2131
  billNumber?: string;
1581
- referenceNumber?: string;
1582
- vendorId?: number;
1583
- vendorName?: string;
2132
+ /** Lifecycle status — shared enum with invoices. */
2133
+ status: SBBillStatus;
2134
+ /** Payment state — shared enum with invoices. */
2135
+ paymentStatus?: SBPaymentStatus;
2136
+ isOverdue?: boolean;
2137
+ isPaid?: boolean;
1584
2138
  currency?: string;
1585
- subTotal: number;
1586
- total: number;
1587
- totalTaxes: number;
1588
- dueDate?: string;
1589
- issueDate?: string;
1590
- paidDate?: string;
1591
- status: BillStatus;
1592
- approvalStatus?: BillApprovalStatus;
1593
- note?: string;
1594
- categoryId?: number;
1595
- categoryName?: string;
1596
- businessId: number;
1597
- items?: SBBillLineItem[];
2139
+ vendor?: SBBillVendor;
2140
+ vendorAccount?: SBBillVendorAccount;
2141
+ employee?: SBBillEmployee;
2142
+ lineItems?: SBBillLineItem[];
1598
2143
  taxes?: SBBillTax[];
1599
- attachments?: SBBillAttachment[];
2144
+ discounts?: unknown[];
2145
+ fees?: unknown[];
2146
+ subTotal?: SBMoney;
2147
+ totalTaxes?: SBMoney;
2148
+ totalDiscounts?: SBMoney;
2149
+ totalFees?: SBMoney;
2150
+ total?: SBMoney;
2151
+ amountPaid?: SBMoney;
2152
+ amountDue?: SBMoney;
2153
+ date?: string;
2154
+ dueDate?: string;
2155
+ paidAt?: string;
2156
+ voidedAt?: string;
2157
+ submittedForApprovalAt?: string;
2158
+ submittedByEmployee?: SBBillEmployee;
2159
+ fullyApprovedAt?: string;
2160
+ deniedAt?: string;
2161
+ denialReason?: string;
1600
2162
  approvals?: SBBillApproval[];
2163
+ scheduledPaymentDate?: string;
2164
+ scheduledPaymentMethod?: string;
2165
+ paymentInitiatedAt?: string;
2166
+ paymentCompletedAt?: string;
2167
+ paymentReference?: string;
2168
+ paymentMethod?: string;
2169
+ paymentFailureReason?: string;
2170
+ markedPaidAt?: string;
2171
+ markedPaidByEmployee?: SBBillEmployee;
2172
+ voidReason?: string;
2173
+ statusHistory?: SBBillStatusHistoryItem[];
2174
+ payments?: SBReceiptPayment[];
2175
+ attachments?: SBBillAttachment[];
2176
+ }
2177
+ interface SBBillVendor {
2178
+ id?: number;
2179
+ name?: string;
2180
+ logo?: string;
2181
+ email?: string;
2182
+ phoneNumber?: string;
2183
+ website?: string;
2184
+ }
2185
+ interface SBBillVendorAccount {
2186
+ id?: number;
2187
+ accountNumber?: string;
2188
+ accountId?: string;
2189
+ }
2190
+ interface SBBillEmployee {
2191
+ id?: number;
2192
+ firstName?: string;
2193
+ lastName?: string;
2194
+ name?: string;
2195
+ email?: string;
1601
2196
  }
1602
- /**
1603
- * An individual line item on a bill.
1604
- */
1605
2197
  interface SBBillLineItem extends SBEntity {
1606
2198
  description?: string;
1607
2199
  quantity: number;
@@ -1609,70 +2201,64 @@ interface SBBillLineItem extends SBEntity {
1609
2201
  total: number;
1610
2202
  categoryId?: number;
1611
2203
  }
1612
- /**
1613
- * A tax line on a bill.
1614
- */
1615
2204
  interface SBBillTax {
1616
2205
  name: string;
1617
2206
  amount: number;
1618
2207
  rate?: number;
1619
2208
  }
1620
- /**
1621
- * A file attachment associated with a bill (e.g., invoice PDF, supporting documents).
1622
- */
1623
2209
  interface SBBillAttachment extends SBEntity {
1624
2210
  name: string;
1625
2211
  url: string;
1626
2212
  mimeType?: string;
1627
2213
  size?: number;
1628
2214
  }
1629
- /**
1630
- * An approval record for a bill, representing one approver's decision.
1631
- */
1632
2215
  interface SBBillApproval extends SBEntity {
1633
- approverId: number;
2216
+ approverId?: number;
1634
2217
  approverName?: string;
1635
2218
  status: BillApprovalStatus;
1636
2219
  comment?: string;
1637
2220
  respondedAt?: string;
1638
2221
  }
2222
+ /**
2223
+ * Single entry in the bill's Status transition history.
2224
+ */
2225
+ interface SBBillStatusHistoryItem {
2226
+ fromStatus: SBBillStatus;
2227
+ toStatus: SBBillStatus;
2228
+ comment?: string;
2229
+ createdAt: string;
2230
+ }
1639
2231
  /**
1640
2232
  * Aggregated counts of bills by status for dashboard summaries.
1641
2233
  */
1642
2234
  interface SBBillStatusSummary {
1643
- draft: number;
1644
- pendingApproval: number;
1645
- approved: number;
1646
- scheduled: number;
1647
- paid: number;
1648
- overdue: number;
1649
- cancelled: number;
1650
- total: number;
2235
+ draftCount: number;
2236
+ pendingApprovalCount: number;
2237
+ readyForPaymentCount: number;
2238
+ scheduledCount: number;
2239
+ overdueCount: number;
2240
+ paidCount: number;
2241
+ totalPendingAmount: number;
2242
+ totalOverdueAmount: number;
2243
+ currency?: string;
1651
2244
  }
1652
2245
  /**
1653
- * A single entry in the bill approval history audit trail.
2246
+ * @deprecated Use {@link SBBillStatusHistoryItem}. Kept as an alias during migration.
1654
2247
  */
1655
- interface SBBillApprovalHistoryItem {
1656
- action: string;
1657
- performedBy: string;
1658
- performedAt: string;
1659
- comment?: string;
1660
- }
2248
+ type SBBillApprovalHistoryItem = SBBillStatusHistoryItem;
1661
2249
  /**
1662
2250
  * Request parameters for listing bills with filters and pagination.
1663
2251
  */
1664
2252
  interface BillListRequest extends PaginationRequest {
1665
2253
  search?: string;
1666
- status?: BillStatus;
2254
+ status?: SBBillStatus;
2255
+ paymentStatus?: SBPaymentStatus;
1667
2256
  vendorId?: number;
1668
2257
  startDate?: string;
1669
2258
  endDate?: string;
1670
2259
  minAmount?: number;
1671
2260
  maxAmount?: number;
1672
2261
  }
1673
- /**
1674
- * Request payload for creating a new bill.
1675
- */
1676
2262
  interface BillCreateRequest {
1677
2263
  title?: string;
1678
2264
  billNumber?: string;
@@ -1689,15 +2275,9 @@ interface BillCreateRequest {
1689
2275
  items?: Omit<SBBillLineItem, "id">[];
1690
2276
  taxes?: SBBillTax[];
1691
2277
  }
1692
- /**
1693
- * Request payload for updating an existing bill.
1694
- */
1695
2278
  interface BillUpdateRequest extends BillCreateRequest {
1696
2279
  id?: number;
1697
2280
  }
1698
- /**
1699
- * Request payload for batch-updating multiple bills.
1700
- */
1701
2281
  interface BillBatchUpdateRequest {
1702
2282
  id: number;
1703
2283
  title?: string;
@@ -1705,123 +2285,69 @@ interface BillBatchUpdateRequest {
1705
2285
  categoryId?: number;
1706
2286
  dueDate?: string;
1707
2287
  }
1708
- /**
1709
- * Base request for bill status transitions.
1710
- */
1711
2288
  interface BillTransitionRequest {
1712
2289
  comment?: string;
1713
2290
  }
1714
- /**
1715
- * Request payload for submitting a bill for approval.
1716
- */
1717
2291
  interface BillSubmitForApprovalRequest extends BillTransitionRequest {
1718
2292
  }
1719
- /**
1720
- * Request payload for approving a bill.
1721
- */
1722
2293
  interface BillApprovalRequest extends BillTransitionRequest {
2294
+ approved?: boolean;
2295
+ denialReason?: string;
1723
2296
  }
1724
- /**
1725
- * Request payload for scheduling a bill payment.
1726
- */
1727
2297
  interface BillSchedulePaymentRequest extends BillTransitionRequest {
1728
2298
  scheduledDate: string;
1729
2299
  paymentMethodId?: string;
1730
2300
  }
1731
- /**
1732
- * Request payload for marking a bill as paid.
1733
- */
1734
2301
  interface BillMarkPaidRequest extends BillTransitionRequest {
1735
2302
  paidDate?: string;
1736
2303
  paymentReference?: string;
1737
2304
  }
1738
- /**
1739
- * Request payload for cancelling a bill.
1740
- */
1741
2305
  interface BillCancelRequest extends BillTransitionRequest {
1742
2306
  reason?: string;
2307
+ cancelReason?: string;
1743
2308
  }
1744
- /**
1745
- * Request payload for rescheduling a bill payment.
1746
- */
1747
2309
  interface BillReschedulePaymentRequest extends BillTransitionRequest {
1748
2310
  scheduledDate: string;
1749
2311
  }
1750
- /**
1751
- * Request payload for retrying a failed bill payment.
1752
- */
1753
2312
  interface BillRetryPaymentRequest extends BillTransitionRequest {
1754
2313
  }
1755
- /**
1756
- * Response returned after a bill status transition.
1757
- */
1758
2314
  interface SBBillTransitionResponse {
1759
2315
  bill: SBBill;
1760
2316
  success: boolean;
1761
2317
  message?: string;
1762
2318
  }
1763
- /**
1764
- * Request payload for bulk-approving multiple bills.
1765
- */
1766
2319
  interface BulkBillApproveRequest {
1767
2320
  billIds: number[];
1768
2321
  comment?: string;
1769
2322
  }
1770
- /**
1771
- * Request payload for bulk-marking multiple bills as paid.
1772
- */
1773
2323
  interface BulkBillMarkPaidRequest {
1774
2324
  billIds: number[];
1775
2325
  paidDate?: string;
1776
2326
  paymentReference?: string;
1777
2327
  }
1778
- /**
1779
- * Request payload for bulk-scheduling payments for multiple bills.
1780
- */
1781
2328
  interface BulkBillSchedulePaymentRequest {
1782
2329
  billIds: number[];
1783
2330
  scheduledDate: string;
1784
2331
  }
1785
- /**
1786
- * Request payload for bulk-unscheduling payments for multiple bills.
1787
- */
1788
2332
  interface BulkBillUnscheduleRequest {
1789
2333
  billIds: number[];
1790
2334
  }
1791
- /**
1792
- * Request payload for bulk-cancelling payments for multiple bills.
1793
- */
1794
2335
  interface BulkBillCancelPaymentRequest {
1795
2336
  billIds: number[];
1796
2337
  reason?: string;
1797
2338
  }
1798
- /**
1799
- * Request payload for bulk-deleting multiple bills.
1800
- */
1801
2339
  interface BulkBillDeleteRequest {
1802
2340
  billIds: number[];
1803
2341
  }
1804
- /**
1805
- * Request payload for bulk-retrying payments for multiple bills.
1806
- */
1807
2342
  interface BulkBillRetryPaymentRequest {
1808
2343
  billIds: number[];
1809
2344
  }
1810
- /**
1811
- * Request payload for bulk-sending payment reminders for multiple bills.
1812
- */
1813
2345
  interface BulkBillRemindRequest {
1814
2346
  billIds: number[];
1815
2347
  }
1816
- /**
1817
- * Request payload for bulk-updating multiple bills.
1818
- */
1819
2348
  interface BulkBillUpdateRequest {
1820
2349
  bills: BillBatchUpdateRequest[];
1821
2350
  }
1822
- /**
1823
- * Response for bulk bill operations.
1824
- */
1825
2351
  type SBBillBulkActionResponse = SBBulkActionResponse;
1826
2352
 
1827
2353
  /**
@@ -2107,7 +2633,7 @@ declare class BillService extends BaseService {
2107
2633
  * @param options - Request options including business context and abort signal
2108
2634
  * @returns An array of allowed target statuses
2109
2635
  */
2110
- getAllowedTransitions(billId: number, options?: RequestOptions): Promise<BillStatus[]>;
2636
+ getAllowedTransitions(billId: number, options?: RequestOptions): Promise<SBBillStatus[]>;
2111
2637
  /**
2112
2638
  * Submits a bill for approval.
2113
2639
  *
@@ -4685,315 +5211,107 @@ declare class NotificationService extends BaseService {
4685
5211
  }
4686
5212
 
4687
5213
  /**
4688
- * A saved payment method for a business.
4689
- *
4690
- * Payment methods are used to pay bills and can be set as the default
4691
- * payment method for automatic payments.
4692
- */
4693
- interface SBPaymentMethod extends SBEntity, SBTimestamps {
4694
- type: string;
4695
- brand?: string;
4696
- last4?: string;
4697
- expirationMonth?: number;
4698
- expirationYear?: number;
4699
- isDefault: boolean;
4700
- billingDetails?: SBPaymentMethodBillingDetails;
4701
- stripePaymentMethodId?: string;
4702
- }
4703
- /**
4704
- * Billing details associated with a payment method.
4705
- */
4706
- interface SBPaymentMethodBillingDetails {
4707
- name?: string;
4708
- email?: string;
4709
- phone?: string;
4710
- address?: {
4711
- line1?: string;
4712
- line2?: string;
4713
- city?: string;
4714
- state?: string;
4715
- postalCode?: string;
4716
- country?: string;
4717
- };
4718
- }
4719
- /**
4720
- * Response from creating a Stripe SetupIntent for adding a new payment method.
4721
- */
4722
- interface SBPaymentMethodSetupIntentResponse {
4723
- clientSecret: string;
4724
- setupIntentId: string;
4725
- }
4726
- /**
4727
- * Request payload for creating a payment method from a completed SetupIntent.
4728
- */
4729
- interface CreatePaymentMethodRequest {
4730
- setupIntentId: string;
4731
- }
4732
- /**
4733
- * Request parameters for listing payment methods.
4734
- */
4735
- interface PaymentMethodListRequest extends PaginationRequest {
4736
- }
4737
-
4738
- /**
4739
- * Service for managing payment methods (cards, bank accounts).
4740
- *
4741
- * Provides methods to list, create, and delete payment methods,
4742
- * and to obtain setup intents for adding new payment methods securely.
4743
- */
4744
- declare class PaymentMethodService extends BaseService {
4745
- /**
4746
- * Lists payment methods for the current user.
4747
- *
4748
- * @param params - Optional filters and pagination for the payment method list
4749
- * @param options - Request options including locale and abort signal
4750
- * @returns Paginated list of payment methods
4751
- *
4752
- * @example
4753
- * ```typescript
4754
- * const { data } = await client.paymentMethods.list();
4755
- * ```
4756
- */
4757
- list(params?: PaymentMethodListRequest, options?: RequestOptions): Promise<SBListResponse<SBPaymentMethod>>;
4758
- /**
4759
- * Creates a payment method from a setup intent or token.
4760
- *
4761
- * @param data - The payment method creation data
4762
- * @param options - Request options including locale and abort signal
4763
- * @returns The created payment method
4764
- * @throws {SmartbillsValidationError} If the provided data fails validation
4765
- *
4766
- * @example
4767
- * ```typescript
4768
- * const setupIntent = await client.paymentMethods.createSetupIntent();
4769
- * const pm = await client.paymentMethods.create({ setupIntentId: setupIntent.id });
4770
- * ```
4771
- */
4772
- create(data: CreatePaymentMethodRequest, options?: RequestOptions): Promise<SBPaymentMethod>;
4773
- /**
4774
- * Creates a setup intent for adding a new payment method.
4775
- *
4776
- * @param options - Request options including locale and abort signal
4777
- * @returns The setup intent response with client secret for Stripe Elements
4778
- * @throws {SmartbillsAuthenticationError} If the user is not authenticated
4779
- */
4780
- createSetupIntent(options?: RequestOptions): Promise<SBPaymentMethodSetupIntentResponse>;
4781
- /**
4782
- * Deletes a payment method.
4783
- *
4784
- * @param id - The payment method ID
4785
- * @param options - Request options including locale and abort signal
4786
- * @throws {SmartbillsNotFoundError} If the payment method is not found
4787
- */
4788
- delete(id: number, options?: RequestOptions): Promise<void>;
4789
- }
4790
-
4791
- /**
4792
- * A receipt in the Smartbills system.
4793
- *
4794
- * Receipts are the core documents that track purchases, expenses, and transactions.
4795
- * They can be created manually, via OCR scanning, through email extraction, or
4796
- * from third-party integrations.
4797
- *
4798
- * @see {@link ReceiptCreateRequest} for creating a new receipt
4799
- * @see {@link ReceiptUpdateRequest} for updating an existing receipt
4800
- */
4801
- interface SBReceipt extends SBEntity, SBTimestamps {
4802
- type: ReceiptType;
4803
- source: ReceiptSource;
4804
- title?: string;
4805
- receiptNumber?: string;
4806
- currency?: string;
4807
- subTotal: number;
4808
- total: number;
4809
- totalDiscounts: number;
4810
- totalItems: number;
4811
- totalFees: number;
4812
- totalTaxes: number;
4813
- totalShipping: number;
4814
- totalTip: number;
4815
- date?: string;
4816
- cancelReason?: string;
4817
- originalReceiptUrl?: string;
4818
- barcode?: SBReceiptBarcode;
4819
- billingAddress?: SBBillingAddress;
4820
- business?: SBReceiptBusiness;
4821
- customer?: SBReceiptCustomer;
4822
- discounts?: SBReceiptDiscount[];
4823
- documents?: SBReceiptDocument[];
4824
- items?: SBReceiptLineItem[];
4825
- fees?: SBReceiptFee[];
4826
- payments?: SBReceiptPayment[];
4827
- refunds?: SBReceiptRefund[];
4828
- taxes?: SBReceiptTax[];
4829
- transactions?: SBReceiptTransaction[];
4830
- vendor?: SBReceiptVendor;
4831
- userId?: number;
4832
- businessId?: number;
4833
- checkoutStatus?: number;
4834
- }
4835
- /**
4836
- * A barcode associated with a receipt.
4837
- */
4838
- interface SBReceiptBarcode {
4839
- value: string;
4840
- format?: string;
4841
- }
4842
- /**
4843
- * The business information displayed on a receipt.
4844
- */
4845
- interface SBReceiptBusiness {
4846
- id?: number;
4847
- name?: string;
4848
- logo?: string;
4849
- address?: string;
4850
- }
4851
- /**
4852
- * Customer information associated with a receipt.
4853
- */
4854
- interface SBReceiptCustomer {
4855
- id?: number;
4856
- name?: string;
4857
- email?: string;
4858
- phone?: string;
4859
- }
4860
- /**
4861
- * A discount applied to a receipt.
4862
- */
4863
- interface SBReceiptDiscount {
4864
- name?: string;
4865
- amount: number;
4866
- percentage?: number;
4867
- }
4868
- /**
4869
- * A document attached to a receipt (e.g., PDF, image).
4870
- */
4871
- interface SBReceiptDocument {
4872
- id?: number;
4873
- name: string;
4874
- url?: string;
4875
- mimeType?: string;
4876
- createdAt?: string;
4877
- }
4878
- /**
4879
- * An individual line item on a receipt.
4880
- */
4881
- interface SBReceiptLineItem extends SBEntity {
4882
- name: string;
4883
- description?: string;
4884
- quantity: number;
4885
- unitPrice: number;
4886
- total: number;
4887
- sku?: string;
4888
- category?: string;
4889
- taxes?: SBReceiptTax[];
4890
- discounts?: SBReceiptDiscount[];
4891
- }
4892
- /**
4893
- * A fee applied to a receipt (e.g., service charge, delivery fee).
4894
- */
4895
- interface SBReceiptFee {
4896
- name: string;
4897
- amount: number;
4898
- }
4899
- /**
4900
- * A payment recorded against a receipt.
4901
- */
4902
- interface SBReceiptPayment extends SBEntity {
4903
- type: ReceiptPaymentType;
4904
- status: ReceiptPaymentStatus;
4905
- amount: number;
4906
- tip?: number;
4907
- billingAddress?: SBBillingAddress;
4908
- card?: SBReceiptPaymentCard;
4909
- statementDescriptor?: string;
4910
- receiptNumber?: string;
4911
- receiptUrl?: string;
4912
- }
4913
- /**
4914
- * Credit or debit card details for a receipt payment.
4915
- */
4916
- interface SBReceiptPaymentCard {
4917
- brand?: string;
4918
- last4?: string;
4919
- expirationMonth?: number;
4920
- expirationYear?: number;
4921
- }
4922
- /**
4923
- * A refund issued against a receipt.
4924
- */
4925
- interface SBReceiptRefund extends SBEntity {
4926
- note?: string;
4927
- processedAt?: string;
4928
- amount?: SBMoney;
4929
- }
4930
- /**
4931
- * A tax line on a receipt.
4932
- */
4933
- interface SBReceiptTax {
4934
- name: string;
4935
- amount: number;
4936
- rate?: number;
4937
- taxNumber?: string;
4938
- }
4939
- /**
4940
- * A transaction linked to a receipt.
5214
+ * A saved payment method for a business.
5215
+ *
5216
+ * Payment methods are used to pay bills and can be set as the default
5217
+ * payment method for automatic payments.
4941
5218
  */
4942
- interface SBReceiptTransaction extends SBEntity {
4943
- amount: number;
4944
- currency?: string;
4945
- date?: string;
5219
+ interface SBPaymentMethod extends SBEntity, SBTimestamps {
5220
+ type: string;
5221
+ brand?: string;
5222
+ last4?: string;
5223
+ expirationMonth?: number;
5224
+ expirationYear?: number;
5225
+ isDefault: boolean;
5226
+ billingDetails?: SBPaymentMethodBillingDetails;
5227
+ stripePaymentMethodId?: string;
4946
5228
  }
4947
5229
  /**
4948
- * Vendor (merchant) information displayed on a receipt.
5230
+ * Billing details associated with a payment method.
4949
5231
  */
4950
- interface SBReceiptVendor {
4951
- id?: number;
5232
+ interface SBPaymentMethodBillingDetails {
4952
5233
  name?: string;
4953
- logo?: string;
5234
+ email?: string;
5235
+ phone?: string;
5236
+ address?: {
5237
+ line1?: string;
5238
+ line2?: string;
5239
+ city?: string;
5240
+ state?: string;
5241
+ postalCode?: string;
5242
+ country?: string;
5243
+ };
4954
5244
  }
4955
5245
  /**
4956
- * Request payload for creating a new receipt.
5246
+ * Response from creating a Stripe SetupIntent for adding a new payment method.
4957
5247
  */
4958
- interface ReceiptCreateRequest {
4959
- title?: string;
4960
- receiptNumber?: string;
4961
- currency?: string;
4962
- date?: string;
4963
- subTotal?: number;
4964
- total?: number;
4965
- items?: Omit<SBReceiptLineItem, "id">[];
4966
- taxes?: SBReceiptTax[];
4967
- fees?: SBReceiptFee[];
4968
- discounts?: SBReceiptDiscount[];
4969
- payments?: Omit<SBReceiptPayment, "id">[];
5248
+ interface SBPaymentMethodSetupIntentResponse {
5249
+ clientSecret: string;
5250
+ setupIntentId: string;
4970
5251
  }
4971
5252
  /**
4972
- * Request payload for updating an existing receipt.
5253
+ * Request payload for creating a payment method from a completed SetupIntent.
4973
5254
  */
4974
- interface ReceiptUpdateRequest extends ReceiptCreateRequest {
4975
- id: number;
5255
+ interface CreatePaymentMethodRequest {
5256
+ setupIntentId: string;
4976
5257
  }
4977
5258
  /**
4978
- * Request parameters for listing receipts with filters and pagination.
5259
+ * Request parameters for listing payment methods.
4979
5260
  */
4980
- interface ReceiptListRequest {
4981
- page?: number;
4982
- limit?: number;
4983
- search?: string;
4984
- sortBy?: string;
4985
- sortDirection?: "asc" | "desc";
4986
- startDate?: string;
4987
- endDate?: string;
4988
- vendorId?: number;
4989
- businessId?: number;
5261
+ interface PaymentMethodListRequest extends PaginationRequest {
4990
5262
  }
5263
+
4991
5264
  /**
4992
- * Request payload for creating a receipt from an OCR-scanned image.
5265
+ * Service for managing payment methods (cards, bank accounts).
5266
+ *
5267
+ * Provides methods to list, create, and delete payment methods,
5268
+ * and to obtain setup intents for adding new payment methods securely.
4993
5269
  */
4994
- interface ReceiptOCRCreateRequest {
4995
- file: File | Blob;
4996
- businessId?: number;
5270
+ declare class PaymentMethodService extends BaseService {
5271
+ /**
5272
+ * Lists payment methods for the current user.
5273
+ *
5274
+ * @param params - Optional filters and pagination for the payment method list
5275
+ * @param options - Request options including locale and abort signal
5276
+ * @returns Paginated list of payment methods
5277
+ *
5278
+ * @example
5279
+ * ```typescript
5280
+ * const { data } = await client.paymentMethods.list();
5281
+ * ```
5282
+ */
5283
+ list(params?: PaymentMethodListRequest, options?: RequestOptions): Promise<SBListResponse<SBPaymentMethod>>;
5284
+ /**
5285
+ * Creates a payment method from a setup intent or token.
5286
+ *
5287
+ * @param data - The payment method creation data
5288
+ * @param options - Request options including locale and abort signal
5289
+ * @returns The created payment method
5290
+ * @throws {SmartbillsValidationError} If the provided data fails validation
5291
+ *
5292
+ * @example
5293
+ * ```typescript
5294
+ * const setupIntent = await client.paymentMethods.createSetupIntent();
5295
+ * const pm = await client.paymentMethods.create({ setupIntentId: setupIntent.id });
5296
+ * ```
5297
+ */
5298
+ create(data: CreatePaymentMethodRequest, options?: RequestOptions): Promise<SBPaymentMethod>;
5299
+ /**
5300
+ * Creates a setup intent for adding a new payment method.
5301
+ *
5302
+ * @param options - Request options including locale and abort signal
5303
+ * @returns The setup intent response with client secret for Stripe Elements
5304
+ * @throws {SmartbillsAuthenticationError} If the user is not authenticated
5305
+ */
5306
+ createSetupIntent(options?: RequestOptions): Promise<SBPaymentMethodSetupIntentResponse>;
5307
+ /**
5308
+ * Deletes a payment method.
5309
+ *
5310
+ * @param id - The payment method ID
5311
+ * @param options - Request options including locale and abort signal
5312
+ * @throws {SmartbillsNotFoundError} If the payment method is not found
5313
+ */
5314
+ delete(id: number, options?: RequestOptions): Promise<void>;
4997
5315
  }
4998
5316
 
4999
5317
  /**
@@ -6960,150 +7278,8 @@ declare class LoyaltyService extends BaseService {
6960
7278
  * @param id - The loyalty program ID
6961
7279
  * @param options - Request options including locale and abort signal
6962
7280
  * @throws {SmartbillsNotFoundError} If the loyalty program is not found
6963
- */
6964
- delete(id: string, options?: RequestOptions): Promise<void>;
6965
- }
6966
-
6967
- declare enum InvoiceStatus {
6968
- DRAFT = "Draft",
6969
- SENT = "Sent",
6970
- VIEWED = "Viewed",
6971
- PARTIALLY_PAID = "PartiallyPaid",
6972
- PAID = "Paid",
6973
- MARKED_PAID = "MarkedPaid",
6974
- OVERDUE = "Overdue",
6975
- CANCELLED = "Cancelled",
6976
- VOID = "Void"
6977
- }
6978
- interface SBInvoiceCustomer {
6979
- id?: number;
6980
- firstName?: string;
6981
- lastName?: string;
6982
- email?: string;
6983
- phoneNumber?: string;
6984
- company?: string;
6985
- }
6986
- interface SBInvoiceLineItemTax {
6987
- id?: number;
6988
- name?: string;
6989
- rate?: number;
6990
- amount?: SBMoney;
6991
- taxId?: number;
6992
- }
6993
- interface SBInvoiceLineItem {
6994
- id?: number;
6995
- description?: string;
6996
- quantity?: number;
6997
- unitPrice?: number;
6998
- price?: SBMoney;
6999
- subTotal?: SBMoney;
7000
- total?: SBMoney;
7001
- amount?: number;
7002
- productId?: number;
7003
- product?: {
7004
- id?: number;
7005
- name?: string;
7006
- sku?: string;
7007
- };
7008
- taxable?: boolean;
7009
- taxIds?: number[];
7010
- taxes?: SBInvoiceLineItemTax[];
7011
- }
7012
- interface SBInvoice extends SBEntity, SBTimestamps {
7013
- invoiceNumber?: string;
7014
- billStatus?: string;
7015
- dueDate?: string;
7016
- date?: string;
7017
- billingPeriodStartDate?: string;
7018
- billingPeriodEndDate?: string;
7019
- autoPaymentDate?: string;
7020
- amountDue?: SBMoney;
7021
- balanceForward?: SBMoney;
7022
- isOverdue?: boolean;
7023
- isPaid?: boolean;
7024
- paymentLinkToken?: string;
7025
- paymentLinkUrl?: string;
7026
- stripePaymentIntentId?: string;
7027
- sentAt?: string;
7028
- viewedAt?: string;
7029
- voidedAt?: string;
7030
- paidOn?: string;
7031
- customerId?: number;
7032
- vendorId?: number;
7033
- total?: SBMoney;
7034
- subTotal?: SBMoney;
7035
- totalTaxes?: SBMoney;
7036
- totalDiscounts?: SBMoney;
7037
- totalFees?: SBMoney;
7038
- totalBeforeTax?: SBMoney;
7039
- currency?: string;
7040
- hostedUrl?: string;
7041
- shortUrl?: string;
7042
- note?: string;
7043
- lineItems?: SBInvoiceLineItem[];
7044
- billingAddress?: SBAddress;
7045
- shippingAddress?: SBAddress;
7046
- reminders?: InvoiceReminder[];
7047
- customer?: SBInvoiceCustomer;
7048
- }
7049
- interface InvoiceListRequest extends PaginationRequest {
7050
- status?: string;
7051
- customerId?: number;
7052
- dateFrom?: string;
7053
- dateTo?: string;
7054
- minAmount?: number;
7055
- maxAmount?: number;
7056
- search?: string;
7057
- }
7058
- declare enum InvoiceReminderFrequency {
7059
- ONCE = "ONCE",
7060
- WEEKLY = "WEEKLY",
7061
- BIWEEKLY = "BIWEEKLY",
7062
- MONTHLY = "MONTHLY"
7063
- }
7064
- declare enum InvoiceReminderTiming {
7065
- BEFORE_DUE = "BEFORE_DUE",
7066
- ON_DUE = "ON_DUE",
7067
- AFTER_DUE = "AFTER_DUE"
7068
- }
7069
- interface InvoiceReminder {
7070
- id?: number;
7071
- enabled: boolean;
7072
- timing: InvoiceReminderTiming;
7073
- daysOffset: number;
7074
- frequency: InvoiceReminderFrequency;
7075
- maxReminders: number;
7076
- message?: string;
7077
- }
7078
- interface InvoiceCreateRequest {
7079
- invoiceNumber?: string;
7080
- date?: string;
7081
- dueDate?: string;
7082
- billingPeriodStartDate?: string;
7083
- billingPeriodEndDate?: string;
7084
- autoPaymentDate?: string;
7085
- amountDue?: SBMoney;
7086
- balanceForward?: SBMoney;
7087
- paymentLinkUrl?: string;
7088
- customerId?: number;
7089
- vendorId?: number;
7090
- currency?: string;
7091
- note?: string;
7092
- lineItems?: Omit<SBInvoiceLineItem, "id" | "product" | "taxes" | "price" | "subTotal" | "total">[];
7093
- billingAddress?: SBAddress;
7094
- shippingAddress?: SBAddress;
7095
- reminders?: InvoiceReminder[];
7096
- }
7097
- type InvoiceUpdateRequest = Partial<InvoiceCreateRequest>;
7098
- interface InvoiceSummary {
7099
- totalRevenue: number;
7100
- outstanding: number;
7101
- overdueCount: number;
7102
- paidThisMonth: number;
7103
- totalCount: number;
7104
- draftCount: number;
7105
- sentCount: number;
7106
- paidCount: number;
7281
+ */
7282
+ delete(id: string, options?: RequestOptions): Promise<void>;
7107
7283
  }
7108
7284
 
7109
7285
  declare class InvoiceService extends BaseService {
@@ -7116,9 +7292,15 @@ declare class InvoiceService extends BaseService {
7116
7292
  void(id: number, options?: RequestOptions): Promise<SBInvoice>;
7117
7293
  markPaid(id: number, options?: RequestOptions): Promise<SBInvoice>;
7118
7294
  duplicate(id: number, options?: RequestOptions): Promise<SBInvoice>;
7295
+ getNextInvoiceNumber(customerId?: number, options?: RequestOptions): Promise<NextInvoiceNumberResponse>;
7119
7296
  getSummary(options?: RequestOptions): Promise<InvoiceSummary>;
7120
7297
  downloadPdf(id: number, options?: RequestOptions): Promise<Blob>;
7121
- getByPaymentToken(token: string): Promise<SBInvoice>;
7298
+ /**
7299
+ * Fetch a public invoice by its short code — the URL-friendly identifier
7300
+ * that doubles as the authorization to view + pay (lives at
7301
+ * `https://invoice.smartbills.ca/i/{shortCode}`).
7302
+ */
7303
+ getByShortcode(shortCode: string): Promise<PublicInvoiceResponse>;
7122
7304
  }
7123
7305
 
7124
7306
  declare enum ConnectedAccountStatus {
@@ -7133,35 +7315,68 @@ declare enum ConnectedAccountType {
7133
7315
  STANDARD = "STANDARD",
7134
7316
  CUSTOM = "CUSTOM"
7135
7317
  }
7318
+ declare enum LateFeeType {
7319
+ PERCENTAGE = "Percentage",
7320
+ FIXED = "Fixed"
7321
+ }
7322
+ declare enum LateFeeFrequency {
7323
+ ONE_TIME = "OneTime",
7324
+ RECURRING = "Recurring"
7325
+ }
7326
+ interface ConnectedAccountLateFeeSettings {
7327
+ enabled: boolean;
7328
+ type: LateFeeType;
7329
+ amount: number;
7330
+ percentage: number;
7331
+ currency: string;
7332
+ gracePeriodDays: number;
7333
+ frequency: LateFeeFrequency;
7334
+ }
7335
+ interface ConnectedAccountProcessing {
7336
+ chargesEnabled: boolean;
7337
+ payoutsEnabled: boolean;
7338
+ detailsSubmitted: boolean;
7339
+ disabledReason?: string;
7340
+ }
7341
+ interface ConnectedAccountRequirements {
7342
+ currentlyDue?: string[];
7343
+ pastDue?: string[];
7344
+ }
7345
+ interface ConnectedAccountBankAccount {
7346
+ last4?: string;
7347
+ bankName?: string;
7348
+ currency?: string;
7349
+ country?: string;
7350
+ routingLast4?: string;
7351
+ }
7352
+ interface ConnectedAccountFees {
7353
+ percent: number;
7354
+ fixedAmount: number;
7355
+ currency: string;
7356
+ }
7357
+ interface ConnectedAccountSettings {
7358
+ acceptedPaymentMethods: string;
7359
+ defaultPaymentTermsDays: number;
7360
+ smsNotificationsEnabled: boolean;
7361
+ automaticTaxEnabled: boolean;
7362
+ lateFee?: ConnectedAccountLateFeeSettings;
7363
+ }
7136
7364
  interface SBConnectedAccount extends SBEntity, SBTimestamps {
7137
7365
  businessId: number;
7138
7366
  stripeAccountId?: string;
7139
7367
  accountType: ConnectedAccountType;
7140
7368
  status: ConnectedAccountStatus;
7141
- chargesEnabled: boolean;
7142
- payoutsEnabled: boolean;
7143
- detailsSubmitted: boolean;
7144
7369
  businessName?: string;
7145
7370
  businessUrl?: string;
7146
7371
  country?: string;
7147
7372
  defaultCurrency?: string;
7148
7373
  email?: string;
7149
- applicationFeePercent: number;
7150
- applicationFeeFixedAmount: number;
7151
- applicationFeeCurrency: string;
7152
- disabledReason?: string;
7153
- currentlyDue?: string;
7154
- pastDue?: string;
7155
- bankAccountLast4?: string;
7156
- bankAccountBankName?: string;
7157
- bankAccountCurrency?: string;
7158
- bankAccountCountry?: string;
7159
- bankAccountRoutingLast4?: string;
7160
7374
  stripeDashboardUrl?: string;
7161
- acceptedPaymentMethods: string;
7162
- defaultPaymentTermsDays: number;
7163
- smsNotificationsEnabled: boolean;
7164
- automaticTaxEnabled: boolean;
7375
+ processing?: ConnectedAccountProcessing;
7376
+ requirements?: ConnectedAccountRequirements;
7377
+ bankAccount?: ConnectedAccountBankAccount;
7378
+ fees?: ConnectedAccountFees;
7379
+ settings?: ConnectedAccountSettings;
7165
7380
  }
7166
7381
  interface ConnectedAccountOnboardingRequest {
7167
7382
  returnUrl: string;
@@ -7181,11 +7396,21 @@ interface FeeConfigurationRequest {
7181
7396
  applicationFeeFixedAmount: number;
7182
7397
  applicationFeeCurrency: string;
7183
7398
  }
7399
+ interface ConnectedAccountLateFeeSettingsRequest {
7400
+ enabled?: boolean;
7401
+ type?: LateFeeType;
7402
+ amount?: number;
7403
+ percentage?: number;
7404
+ currency?: string;
7405
+ gracePeriodDays?: number;
7406
+ frequency?: LateFeeFrequency;
7407
+ }
7184
7408
  interface ConnectedAccountSettingsRequest {
7185
7409
  acceptedPaymentMethods?: string;
7186
7410
  defaultPaymentTermsDays?: number;
7187
7411
  smsNotificationsEnabled?: boolean;
7188
7412
  automaticTaxEnabled?: boolean;
7413
+ lateFee?: ConnectedAccountLateFeeSettingsRequest;
7189
7414
  }
7190
7415
 
7191
7416
  declare class ConnectedAccountService extends BaseService {
@@ -7279,21 +7504,6 @@ interface RefundCreateRequest {
7279
7504
  reason?: string;
7280
7505
  notes?: string;
7281
7506
  }
7282
- interface SBDispute extends SBEntity, SBTimestamps {
7283
- invoicePaymentId: number;
7284
- stripeDisputeId?: string;
7285
- amount: number;
7286
- currency: string;
7287
- reason?: string;
7288
- status: string;
7289
- evidenceDueBy?: string;
7290
- isEvidenceSubmitted: boolean;
7291
- }
7292
- interface DisputeEvidenceRequest {
7293
- uncategorizedText?: string;
7294
- customerCommunication?: string;
7295
- serviceDocumentation?: string;
7296
- }
7297
7507
  interface LedgerSummary {
7298
7508
  grossRevenue: number;
7299
7509
  smartbillsFees: number;
@@ -7343,18 +7553,299 @@ declare class InvoicePaymentService extends BaseService {
7343
7553
  cancel(id: number, options?: RequestOptions): Promise<SBInvoicePayment>;
7344
7554
  createRefund(paymentId: number, data: RefundCreateRequest, options?: RequestOptions): Promise<SBRefund>;
7345
7555
  listRefunds(paymentId: number, options?: RequestOptions): Promise<SBRefund[]>;
7346
- listDisputes(params?: {
7347
- page?: number;
7348
- pageSize?: number;
7349
- }, options?: RequestOptions): Promise<SBDispute[]>;
7350
- submitEvidence(disputeId: number, data: DisputeEvidenceRequest, options?: RequestOptions): Promise<SBDispute>;
7351
- acceptDispute(disputeId: number, options?: RequestOptions): Promise<SBDispute>;
7352
7556
  getLedgerSummary(from: string, to: string, options?: RequestOptions): Promise<LedgerSummary>;
7353
7557
  getLedgerEntries(params?: Record<string, unknown>, options?: RequestOptions): Promise<LedgerEntry[]>;
7354
7558
  getPayouts(params?: Record<string, unknown>, options?: RequestOptions): Promise<Payout[]>;
7355
7559
  exportLedgerCsv(from: string, to: string, options?: RequestOptions): Promise<Blob>;
7356
7560
  }
7357
7561
 
7562
+ /**
7563
+ * Credit-note types — provider-agnostic. Mirrors `Smartbills.Core.DTO.CreditNotes` server-side.
7564
+ *
7565
+ * Two outcomes are supported (mutually exclusive per CN):
7566
+ * - "Refund" → triggers a Stripe refund through the Payments microservice.
7567
+ * - "CustomerBalance" → adds to a smartbills-side customer credit balance the customer
7568
+ * can apply to a future invoice via `applyCreditToInvoice`.
7569
+ *
7570
+ * Stripe's native CreditNote API is not used (would require creating Stripe Invoices,
7571
+ * which incur a per-invoice fee).
7572
+ */
7573
+ type CreditNoteType = "Refund" | "CustomerBalance";
7574
+ type CreditNoteStatus = "Draft" | "Issued" | "Voided";
7575
+ type CreditNoteReason = "Duplicate" | "Fraudulent" | "OrderChange" | "ProductUnsatisfactory" | "Other";
7576
+ type CustomerCreditLedgerSource = "CreditNote" | "Application" | "Reversal";
7577
+ interface CreditNoteLineItemRequest {
7578
+ invoiceLineItemId?: number | null;
7579
+ description?: string;
7580
+ quantity?: number;
7581
+ unitAmount: number;
7582
+ taxAmount?: number;
7583
+ }
7584
+ interface CreditNoteCreateRequest {
7585
+ type: CreditNoteType;
7586
+ reason: CreditNoteReason;
7587
+ /** Either supply lineItems or a flat amount in cents. lineItems take precedence. */
7588
+ lineItems?: CreditNoteLineItemRequest[];
7589
+ /** Smallest currency unit (cents). Used when lineItems are not provided. */
7590
+ amount?: number;
7591
+ currency?: string;
7592
+ memo?: string;
7593
+ }
7594
+ interface ApplyCustomerCreditRequest {
7595
+ /** Smallest currency unit (cents). */
7596
+ amount: number;
7597
+ currency?: string;
7598
+ notes?: string;
7599
+ }
7600
+ interface SBCreditNoteLineItem {
7601
+ id: number;
7602
+ sbCreditNoteId: number;
7603
+ invoiceLineItemId?: number | null;
7604
+ description?: string;
7605
+ quantity: number;
7606
+ unitAmount: number;
7607
+ currency: string;
7608
+ subtotal: number;
7609
+ taxAmount: number;
7610
+ total: number;
7611
+ }
7612
+ interface SBCreditNote {
7613
+ id: number;
7614
+ businessId?: number | null;
7615
+ merchantId?: number | null;
7616
+ customerId?: number | null;
7617
+ invoiceId: number;
7618
+ number: string;
7619
+ reason: CreditNoteReason;
7620
+ type: CreditNoteType;
7621
+ status: CreditNoteStatus;
7622
+ /** Total in dollars (matches server-side decimal storage). */
7623
+ totalAmount: number;
7624
+ totalCurrency: string;
7625
+ memo?: string;
7626
+ issuedAt?: string | null;
7627
+ voidedAt?: string | null;
7628
+ /** Set asynchronously once the agnostic payment.refunded webhook lands. */
7629
+ relatedRefundId?: number | null;
7630
+ customerCreditEntryId?: number | null;
7631
+ createdAt: string;
7632
+ lineItems: SBCreditNoteLineItem[];
7633
+ }
7634
+ interface CustomerCreditLedgerEntry {
7635
+ id: number;
7636
+ amountChange: number;
7637
+ currency: string;
7638
+ source: CustomerCreditLedgerSource;
7639
+ sourceCreditNoteId?: number | null;
7640
+ appliedToInvoiceId?: number | null;
7641
+ notes?: string;
7642
+ createdAt: string;
7643
+ }
7644
+ interface CustomerCreditBalance {
7645
+ customerId: number;
7646
+ /** Sum of ledger entries in the requested currency (or all if none specified). */
7647
+ balance: number;
7648
+ currency: string;
7649
+ entries: CustomerCreditLedgerEntry[];
7650
+ }
7651
+
7652
+ /**
7653
+ * Smartbills-owned credit notes. See `entities/credit-notes/models.ts` for the type-vs-status
7654
+ * model. All routes are tenant-scoped under `/v1/businesses/{businessId}`.
7655
+ */
7656
+ declare class CreditNoteService extends BaseService {
7657
+ /** Issue a credit note against an invoice. Returns the persisted CN; for refund-type CNs,
7658
+ * the `relatedRefundId` is back-filled asynchronously when the Stripe webhook lands. */
7659
+ issue(invoiceId: number, data: CreditNoteCreateRequest, options?: RequestOptions): Promise<SBCreditNote>;
7660
+ listByInvoice(invoiceId: number, options?: RequestOptions): Promise<SBCreditNote[]>;
7661
+ getById(id: number, options?: RequestOptions): Promise<SBCreditNote>;
7662
+ /** Void an issued CN. Allowed only when no money has moved (refund still pending) or
7663
+ * when a customer-balance credit hasn't been applied to another invoice yet. */
7664
+ void(id: number, options?: RequestOptions): Promise<SBCreditNote>;
7665
+ getCustomerCreditBalance(customerId: number, currency?: string, options?: RequestOptions): Promise<CustomerCreditBalance>;
7666
+ /** Apply a positive customer credit balance to an outstanding invoice. */
7667
+ applyCreditToInvoice(invoiceId: number, data: ApplyCustomerCreditRequest, options?: RequestOptions): Promise<void>;
7668
+ }
7669
+
7670
+ /**
7671
+ * A payment received against an invoice — flat read view exposed at
7672
+ * `GET /v1/businesses/{businessId}/payments`. Mirrors the same shape used inside
7673
+ * `SBInvoiceResponse.payments[]`, so a single component can render either source.
7674
+ */
7675
+ interface SBPayment extends SBEntity {
7676
+ type: ReceiptPaymentType;
7677
+ status: ReceiptPaymentStatus;
7678
+ amount: SBMoney;
7679
+ total?: SBMoney;
7680
+ approuved?: SBMoney;
7681
+ refunded?: SBMoney;
7682
+ applicationFee?: SBMoney;
7683
+ tip?: SBMoney;
7684
+ card?: SBPaymentCardSnippet;
7685
+ external?: SBPaymentExternalSnippet;
7686
+ paymentMethodId?: number;
7687
+ paidAt?: string;
7688
+ receiptNumber?: string;
7689
+ receiptUrl?: string;
7690
+ note?: string;
7691
+ }
7692
+ interface SBPaymentCardSnippet {
7693
+ brand?: string;
7694
+ last4?: string;
7695
+ expirationMonth?: number;
7696
+ expirationYear?: number;
7697
+ }
7698
+ interface SBPaymentExternalSnippet {
7699
+ source?: string;
7700
+ sourceId?: string;
7701
+ type?: string;
7702
+ fee?: number;
7703
+ }
7704
+ /** Filters accepted by `GET /v1/businesses/{businessId}/payments`. */
7705
+ interface PaymentListRequest extends PaginationRequest {
7706
+ invoiceId?: number;
7707
+ status?: ReceiptPaymentStatus;
7708
+ type?: ReceiptPaymentType;
7709
+ currency?: string;
7710
+ fromDate?: string;
7711
+ toDate?: string;
7712
+ minAmount?: number;
7713
+ maxAmount?: number;
7714
+ }
7715
+
7716
+ /**
7717
+ * Read-side service over `SBPayment` for the dashboard's top-level Payments tab.
7718
+ * Backed by `GET /v1/businesses/{businessId}/payments` (and `/{paymentId}` for
7719
+ * detail). Payments are also nested inside their parent invoice via
7720
+ * `SBInvoiceResponse.payments[]`; this service just flattens them so a Payments
7721
+ * page doesn't have to fan out across invoices.
7722
+ */
7723
+ declare class PaymentService extends BaseService {
7724
+ list(params?: PaymentListRequest, options?: RequestOptions): Promise<SBListResponse<SBPayment>>;
7725
+ getById(paymentId: number, options?: RequestOptions): Promise<SBPayment>;
7726
+ }
7727
+
7728
+ /**
7729
+ * Wire format for PaymentIntent / Charge / Statement enums is CONSTANT_CASE strings,
7730
+ * controlled by the API's JsonStringEnumConverter using ConstantCasePropertyNameResolver
7731
+ * (see Smartbills.API/Program.cs). The enum values below mirror what the JSON body
7732
+ * actually carries, NOT the .NET PascalCase identifier.
7733
+ */
7734
+ declare enum PaymentIntentStatus {
7735
+ REQUIRES_PAYMENT_METHOD = "REQUIRES_PAYMENT_METHOD",
7736
+ REQUIRES_CONFIRMATION = "REQUIRES_CONFIRMATION",
7737
+ REQUIRES_ACTION = "REQUIRES_ACTION",
7738
+ PROCESSING = "PROCESSING",
7739
+ REQUIRES_CAPTURE = "REQUIRES_CAPTURE",
7740
+ CANCELED = "CANCELED",
7741
+ SUCCEEDED = "SUCCEEDED",
7742
+ FAILED = "FAILED",
7743
+ PENDING = "PENDING",
7744
+ REFUNDED = "REFUNDED",
7745
+ PARTIALLY_REFUNDED = "PARTIALLY_REFUNDED",
7746
+ DISPUTED = "DISPUTED",
7747
+ EXPIRED = "EXPIRED"
7748
+ }
7749
+ declare enum ChargeStatus {
7750
+ PENDING = "PENDING",
7751
+ SUCCEEDED = "SUCCEEDED",
7752
+ FAILED = "FAILED"
7753
+ }
7754
+ interface SBCharge extends SBEntity, SBTimestamps {
7755
+ paymentIntentId: number;
7756
+ stripeChargeId?: string;
7757
+ amount: number;
7758
+ currency: string;
7759
+ status: ChargeStatus | string;
7760
+ failureCode?: string;
7761
+ failureMessage?: string;
7762
+ paymentMethodType?: string;
7763
+ paymentMethodBrand?: string;
7764
+ paymentMethodLast4?: string;
7765
+ riskLevel?: string;
7766
+ riskScore?: number;
7767
+ captured: boolean;
7768
+ capturedAt?: string;
7769
+ refunded: boolean;
7770
+ amountRefunded: number;
7771
+ stripeProcessingFee?: number;
7772
+ netAmount: number;
7773
+ stripeBalanceTransactionId?: string;
7774
+ }
7775
+ interface SBPaymentIntent extends SBEntity, SBTimestamps {
7776
+ connectedAccountId: number;
7777
+ businessId: number;
7778
+ invoiceId: number;
7779
+ externalInvoiceId?: string;
7780
+ customerId?: number;
7781
+ status: PaymentIntentStatus | string;
7782
+ amount: number;
7783
+ tipAmount: number;
7784
+ applicationFeeAmount: number;
7785
+ totalStripeProcessingFees?: number;
7786
+ netAmount: number;
7787
+ currency: string;
7788
+ stripePaymentIntentId?: string;
7789
+ stripeCheckoutSessionId?: string;
7790
+ checkoutUrl?: string;
7791
+ customerEmail?: string;
7792
+ customerName?: string;
7793
+ paymentMethodType?: string;
7794
+ paymentMethodBrand?: string;
7795
+ paymentMethodLast4?: string;
7796
+ failureCode?: string;
7797
+ failureMessage?: string;
7798
+ clientSecret?: string;
7799
+ paidAt?: string;
7800
+ canceledAt?: string;
7801
+ charges?: SBCharge[];
7802
+ disputeCount?: number;
7803
+ }
7804
+ interface PaymentIntentListRequest {
7805
+ status?: PaymentIntentStatus | string;
7806
+ dateFrom?: string;
7807
+ dateTo?: string;
7808
+ customerId?: number;
7809
+ search?: string;
7810
+ page?: number;
7811
+ pageSize?: number;
7812
+ }
7813
+ /**
7814
+ * Server-computed aggregation across the requested period. Sourced from
7815
+ * <c>GET /v1/businesses/{businessId}/payment-intents/summary</c>. Amounts are in cents
7816
+ * (Stripe convention) — the dashboard divides by 100 before rendering.
7817
+ */
7818
+ interface SBPaymentIntentSummary {
7819
+ totalGross: number;
7820
+ totalNet: number;
7821
+ totalStripeProcessingFees: number;
7822
+ totalApplicationFees: number;
7823
+ totalRefunded: number;
7824
+ count: number;
7825
+ succeededCount: number;
7826
+ failedCount: number;
7827
+ currency: string;
7828
+ }
7829
+
7830
+ /**
7831
+ * Read/write surface for `SBPaymentIntent` rows in the Smartbills.Payments service,
7832
+ * fronted by the API's <c>PaymentIntentsProxyController</c>. Backs the dashboard's
7833
+ * Stripe-side payments view (gross/net/fees/refunds), distinct from the
7834
+ * <c>PaymentService</c> which reads <c>SBPayment</c> rows recorded against invoices.
7835
+ */
7836
+ declare class PaymentIntentService extends BaseService {
7837
+ list(params?: PaymentIntentListRequest, options?: RequestOptions): Promise<PagedResult<SBPaymentIntent>>;
7838
+ getSummary(params: {
7839
+ dateFrom?: string;
7840
+ dateTo?: string;
7841
+ }, options?: RequestOptions): Promise<SBPaymentIntentSummary>;
7842
+ getById(id: number, options?: RequestOptions): Promise<SBPaymentIntent>;
7843
+ cancel(id: number, options?: RequestOptions): Promise<SBPaymentIntent>;
7844
+ listCharges(id: number, options?: RequestOptions): Promise<SBCharge[]>;
7845
+ createRefund(paymentIntentId: number, data: RefundCreateRequest, options?: RequestOptions): Promise<SBRefund>;
7846
+ listRefunds(paymentIntentId: number, options?: RequestOptions): Promise<SBRefund[]>;
7847
+ }
7848
+
7358
7849
  declare enum PayoutStatus {
7359
7850
  PAID = "paid",
7360
7851
  PENDING = "pending",
@@ -7424,6 +7915,212 @@ declare class PayoutService extends BaseService {
7424
7915
  getBalance(options?: RequestOptions): Promise<SBBalance>;
7425
7916
  }
7426
7917
 
7918
+ /**
7919
+ * Stripe-side dispute (chargeback) details exposed by Smartbills.Payments. Each row mirrors
7920
+ * Stripe's `dispute` object plus a few hydrated fields from the originating PaymentIntent so
7921
+ * the dashboard can render dispute context without a second lookup.
7922
+ */
7923
+ interface SBDispute {
7924
+ id: number;
7925
+ chargeId: number;
7926
+ paymentIntentId: number;
7927
+ stripeDisputeId?: string;
7928
+ amount: number;
7929
+ currency: string;
7930
+ reason?: string;
7931
+ status: string;
7932
+ evidenceDueBy?: string;
7933
+ isEvidenceSubmitted: boolean;
7934
+ createdAt: string;
7935
+ customerName?: string;
7936
+ customerEmail?: string;
7937
+ paymentMethodBrand?: string;
7938
+ paymentMethodLast4?: string;
7939
+ paymentPaidAt?: string;
7940
+ invoiceId?: number;
7941
+ }
7942
+ interface SBDisputeStats {
7943
+ /** Disputes that need merchant evidence (NeedsResponse + WarningNeedsResponse). */
7944
+ needsResponseCount: number;
7945
+ /** Total $ at risk across active disputes (cents). */
7946
+ amountAtRisk: number;
7947
+ currency: string;
7948
+ /** Dispute rate over the last 12 months (% as decimal). */
7949
+ disputeRate: number;
7950
+ totalCount: number;
7951
+ wonCount: number;
7952
+ lostCount: number;
7953
+ underReviewCount: number;
7954
+ }
7955
+ interface SBDisputeListResponse {
7956
+ data: SBDispute[];
7957
+ page: number;
7958
+ pageSize: number;
7959
+ totalCount: number;
7960
+ totalPages: number;
7961
+ stats: SBDisputeStats;
7962
+ }
7963
+ interface DisputeListRequest {
7964
+ status?: string;
7965
+ page?: number;
7966
+ pageSize?: number;
7967
+ }
7968
+ /**
7969
+ * One of Stripe's named evidence slots. Every slot accepts either text or a previously-uploaded
7970
+ * Stripe File ID (one per slot). The slot enum is shared with the backend so the client and
7971
+ * server agree on the S3 key prefix and the field that gets mapped to Stripe's
7972
+ * `DisputeEvidenceOptions`.
7973
+ */
7974
+ declare enum DisputeEvidenceSlot {
7975
+ CustomerCommunication = "CustomerCommunication",
7976
+ Receipt = "Receipt",
7977
+ ServiceDocumentation = "ServiceDocumentation",
7978
+ ShippingDocumentation = "ShippingDocumentation",
7979
+ RefundPolicy = "RefundPolicy",
7980
+ CancellationPolicy = "CancellationPolicy",
7981
+ CustomerSignature = "CustomerSignature",
7982
+ DuplicateChargeDocumentation = "DuplicateChargeDocumentation",
7983
+ Uncategorized = "Uncategorized"
7984
+ }
7985
+ interface DisputeEvidenceUploadUrlRequest {
7986
+ slot: DisputeEvidenceSlot;
7987
+ fileName: string;
7988
+ contentType?: string;
7989
+ }
7990
+ interface DisputeEvidenceUploadUrlResponse {
7991
+ uploadUrl: string;
7992
+ key: string;
7993
+ expires: string;
7994
+ }
7995
+ interface DisputeEvidenceFinalizeRequest {
7996
+ slot: DisputeEvidenceSlot;
7997
+ key: string;
7998
+ fileName: string;
7999
+ }
8000
+ interface DisputeEvidenceFinalizeResponse {
8001
+ /** Stripe File ID (file_xxx) — pass into the matching evidence slot when submitting. */
8002
+ stripeFileId: string;
8003
+ slot: DisputeEvidenceSlot;
8004
+ fileName: string;
8005
+ size: number;
8006
+ }
8007
+ /**
8008
+ * Stripe's evidence schema. Each free-text field has a corresponding `*FileId` slot — set one or
8009
+ * the other, not both, per Stripe's API contract. `submit: false` saves the evidence as a draft.
8010
+ */
8011
+ interface DisputeEvidenceRequest {
8012
+ uncategorizedText?: string;
8013
+ customerCommunication?: string;
8014
+ serviceDocumentation?: string;
8015
+ refundPolicy?: string;
8016
+ refundPolicyDisclosure?: string;
8017
+ refundRefusalExplanation?: string;
8018
+ cancellationPolicy?: string;
8019
+ cancellationPolicyDisclosure?: string;
8020
+ cancellationRebuttal?: string;
8021
+ accessActivityLog?: string;
8022
+ billingAddress?: string;
8023
+ customerName?: string;
8024
+ customerEmailAddress?: string;
8025
+ customerPurchaseIp?: string;
8026
+ productDescription?: string;
8027
+ duplicateChargeExplanation?: string;
8028
+ serviceDate?: string;
8029
+ shippingAddress?: string;
8030
+ shippingCarrier?: string;
8031
+ shippingDate?: string;
8032
+ shippingTrackingNumber?: string;
8033
+ customerCommunicationFileId?: string;
8034
+ receiptFileId?: string;
8035
+ serviceDocumentationFileId?: string;
8036
+ shippingDocumentationFileId?: string;
8037
+ refundPolicyFileId?: string;
8038
+ cancellationPolicyFileId?: string;
8039
+ customerSignatureFileId?: string;
8040
+ duplicateChargeDocumentationFileId?: string;
8041
+ uncategorizedFileId?: string;
8042
+ submit?: boolean;
8043
+ }
8044
+
8045
+ /**
8046
+ * Stripe disputes (chargebacks) for the active business. Backed by Smartbills.Payments via
8047
+ * the API's <c>DisputesProxyController</c>. Evidence file uploads use a two-step flow
8048
+ * (presigned PUT to S3 → finalize that streams the bytes into Stripe's File API as
8049
+ * `dispute_evidence`); the merchant collects file IDs across slots and submits them all in
8050
+ * the final <c>POST /evidence</c>.
8051
+ */
8052
+ declare class DisputeService extends BaseService {
8053
+ list(params?: DisputeListRequest, options?: RequestOptions): Promise<SBDisputeListResponse>;
8054
+ getById(disputeId: number, options?: RequestOptions): Promise<SBDispute>;
8055
+ submitEvidence(disputeId: number, data: DisputeEvidenceRequest, options?: RequestOptions): Promise<SBDispute>;
8056
+ accept(disputeId: number, options?: RequestOptions): Promise<SBDispute>;
8057
+ /**
8058
+ * Step 1 of the evidence file upload — returns a presigned PUT URL the dashboard uses to
8059
+ * stream the file directly to S3. URL expires in 15 minutes; the dashboard should not cache it.
8060
+ */
8061
+ createEvidenceUploadUrl(disputeId: number, data: DisputeEvidenceUploadUrlRequest, options?: RequestOptions): Promise<DisputeEvidenceUploadUrlResponse>;
8062
+ /**
8063
+ * Step 2 — once the file is in S3, the API streams it into Stripe's File API on the
8064
+ * connected account and returns the resulting Stripe File ID. The dashboard then sets that
8065
+ * ID on the matching slot in <c>DisputeEvidenceRequest</c> when submitting.
8066
+ */
8067
+ finalizeEvidence(disputeId: number, data: DisputeEvidenceFinalizeRequest, options?: RequestOptions): Promise<DisputeEvidenceFinalizeResponse>;
8068
+ /**
8069
+ * Convenience — runs the full upload+finalize flow against a browser File. The dashboard
8070
+ * uses this from a drag-and-drop dropzone; tests use the explicit two-call form.
8071
+ */
8072
+ uploadEvidenceFile(disputeId: number, slot: DisputeEvidenceUploadUrlRequest["slot"], file: File, options?: RequestOptions): Promise<DisputeEvidenceFinalizeResponse>;
8073
+ }
8074
+
8075
+ declare enum StatementStatus {
8076
+ PENDING = "PENDING",
8077
+ GENERATED = "GENERATED",
8078
+ SENT = "SENT",
8079
+ FAILED = "FAILED"
8080
+ }
8081
+ interface SBStatement extends SBEntity, SBTimestamps {
8082
+ businessId: number;
8083
+ periodStart: string;
8084
+ periodEnd: string;
8085
+ periodType: string;
8086
+ totalGross: number;
8087
+ totalStripeProcessingFees: number;
8088
+ totalApplicationFees: number;
8089
+ totalRefunded: number;
8090
+ totalNet: number;
8091
+ transactionCount: number;
8092
+ refundCount: number;
8093
+ currency: string;
8094
+ status: StatementStatus | string;
8095
+ pdfStorageKey?: string;
8096
+ generatedAt?: string;
8097
+ emailSentAt?: string;
8098
+ emailRecipient?: string;
8099
+ emailDeliveryAttempts: number;
8100
+ }
8101
+ interface StatementListRequest {
8102
+ status?: StatementStatus;
8103
+ fromDate?: string;
8104
+ toDate?: string;
8105
+ page?: number;
8106
+ pageSize?: number;
8107
+ }
8108
+ interface StatementListResponse {
8109
+ items: SBStatement[];
8110
+ totalCount: number;
8111
+ page: number;
8112
+ pageSize: number;
8113
+ totalPages: number;
8114
+ }
8115
+
8116
+ declare class StatementService extends BaseService {
8117
+ list(params?: StatementListRequest, options?: RequestOptions): Promise<StatementListResponse>;
8118
+ getById(id: number, options?: RequestOptions): Promise<SBStatement>;
8119
+ /** Returns a Blob for download. Callers are responsible for rendering or saving it. */
8120
+ downloadPdf(id: number, options?: RequestOptions): Promise<Blob>;
8121
+ resendEmail(id: number, options?: RequestOptions): Promise<SBStatement>;
8122
+ }
8123
+
7427
8124
  /**
7428
8125
  * Configuration options for initializing a {@link SmartbillsClient}.
7429
8126
  */
@@ -7507,7 +8204,12 @@ declare class SmartbillsClient {
7507
8204
  readonly invoices: InvoiceService;
7508
8205
  readonly connectedAccounts: ConnectedAccountService;
7509
8206
  readonly invoicePayments: InvoicePaymentService;
8207
+ readonly creditNotes: CreditNoteService;
8208
+ readonly payments: PaymentService;
8209
+ readonly paymentIntents: PaymentIntentService;
7510
8210
  readonly payouts: PayoutService;
8211
+ readonly disputes: DisputeService;
8212
+ readonly statements: StatementService;
7511
8213
  /**
7512
8214
  * Creates a new Smartbills client instance.
7513
8215
  *
@@ -7700,5 +8402,5 @@ declare function isRetryableError(error: unknown): boolean;
7700
8402
  declare function uploadFileToS3(uploadUrl: string, file: Blob | ArrayBuffer, contentType: string): Promise<void>;
7701
8403
  declare function uploadFileUriToS3(uploadUrl: string, fileUri: string, contentType: string): Promise<void>;
7702
8404
 
7703
- export { AccessToken, AppInstallationService, AppInstallationStatus, ApprobationService, AttachmentService, AuthorizedSenderService, BaseService, BillApprovalStatus, BillApprovalType, BillService, BillStatus, BillingService, BusinessService, BusinessUserService, CategoryService, CheckoutDocumentType, CheckoutPaymentStatus, CheckoutService, CheckoutStatus, ConnectAccountStatus, ConnectService, ConnectedAccountService, ConnectedAccountStatus, ConnectedAccountType, CustomerService, DEFAULT_BASE_URL, DepartmentService, EmailAccountService, EmailAccountStatus, EmailAccountSyncStatus, EmailAccountType, EmailForwardingService, EmployeeService, ErrorCode, ExpenseItemStatus, ExpenseJobService, ExpenseJobStatus, ExpenseReportAuditLogAction, ExpenseReportExpenseService, ExpenseReportPaymentService, ExpenseReportService, ExpenseReportStatus, ExpenseService, ExpenseSplitType, HttpClient, IntegrationService, IntegrationStatus, InvitationService, InvitationStatus, InvoicePaymentService, InvoicePaymentStatus, InvoiceReminderFrequency, InvoiceReminderTiming, InvoiceService, InvoiceStatus, LocationService, LoyaltyService, MailboxType, MembershipRole, MembershipService, NotificationService, NotificationType, PayerType, PaymentMethodService, PayoutInterval, PayoutService, PayoutStatus, ProductService, PromoCodeService, ReceiptPaymentStatus, ReceiptPaymentType, ReceiptService, ReceiptSource, ReceiptType, ReportingService, SmartbillsApiError, SmartbillsAuthenticationError, SmartbillsClient, SmartbillsConflictError, SmartbillsError, SmartbillsNetworkError, SmartbillsNotFoundError, SmartbillsPermissionError, SmartbillsQuotaError, SmartbillsRateLimitError, SmartbillsValidationError, SyncTriggerType, TableService, TaxService, TransactionService, TransactionType, UserService, VendorConnectionService, VendorConnectionStatus, VendorService, WorkflowService, WorkflowTriggerType, isApiError, isAuthenticationError, isConflictError, isNetworkError, isNotFoundError, isPermissionError, isQuotaError, isRateLimitError, isRetryableError, isSmartbillsError, isValidationError, uploadFileToS3, uploadFileUriToS3 };
7704
- export type { AddExpenseToReportRequest, AddExpensesToReportBatchRequest, ApprobationListRequest, AssociateExpenseReportUpdateRequest, AttachmentListRequest, AttachmentRenameRequest, BalanceAmount, BillApprovalRequest, BillBatchUpdateRequest, BillCancelRequest, BillCreateRequest, BillListRequest, BillMarkPaidRequest, BillReschedulePaymentRequest, BillRetryPaymentRequest, BillSchedulePaymentRequest, BillSubmitForApprovalRequest, BillTransitionRequest, BillUpdateRequest, BillingInvoiceListRequest, BulkApproveApprobationsRequest, BulkAssignCategoryRequest, BulkAssignExpenseReportRequest, BulkAssignPayerTypeRequest, BulkAssignReportCategoryRequest, BulkAssignVendorRequest, BulkBillApproveRequest, BulkBillCancelPaymentRequest, BulkBillDeleteRequest, BulkBillMarkPaidRequest, BulkBillRemindRequest, BulkBillRetryPaymentRequest, BulkBillSchedulePaymentRequest, BulkBillUnscheduleRequest, BulkBillUpdateRequest, BulkDeleteExpenseReportsRequest, BulkDeleteExpensesRequest, BulkDeleteVendorsRequest, BulkMarkReimbursedApprobationsRequest, BulkPlanReimbursementApprobationsRequest, BulkRecallExpenseReportsRequest, BulkRejectApprobationsRequest, BulkRemoveReportExpensesRequest, BulkRequestChangesApprobationsRequest, BulkRevertToReviewApprobationsRequest, BulkSetNoteRequest, BulkSubmitExpenseReportsRequest, BusinessBatchUpdateRequest, BusinessBrandCreateRequest, BusinessBrandUpdateRequest, BusinessCreateRequest, BusinessUpdateRequest, CategoryCreateRequest, CategoryListRequest, CategoryUpdateRequest, CheckoutLineItem, ConfirmUploadFileRequest, ConfirmUploadRequest, ConnectOnboardingRequest, ConnectedAccountOnboardingRequest, ConnectedAccountOnboardingResult, ConnectedAccountSettingsRequest, CreateAuthorizedSenderRequest, CreateCheckoutPaymentIntentRequest, CreatePaymentMethodRequest, CreatePayoutRequest, CreatePortalSessionRequest, CredentialProvider, CustomerCreateRequest, CustomerListRequest, CustomerUpdateRequest, DepartmentCreateRequest, DepartmentListRequest, DepartmentUpdateRequest, DisputeEvidenceRequest, EditExpenseInReportRequest, EmailAccountImapCreateRequest, EmailAccountListRequest, EmailAccountOAuth2CreateRequest, EmailAccountUpdateRequest, EmailForwardingConfigRequest, EmployeeBulkAssignManagerRequest, EmployeeCreateRequest, EmployeeListRequest, EmployeeSetManagerRequest, EmployeeUpdateRequest, ErrorCodeType, ExpenseAttachmentDownloadRequest, ExpenseCategoryUpdateRequest, ExpenseExportRequest, ExpenseJobListRequest, ExpenseListRequest, ExpenseNoteUpdateRequest, ExpenseOverTimeRequest, ExpensePayerTypeUpdateRequest, ExpenseReportApproveRequest, ExpenseReportAssignLedgerAccountRequest, ExpenseReportCommentCreateRequest, ExpenseReportCreateRequest, ExpenseReportExportRequest, ExpenseReportListRequest, ExpenseReportPartialReimburseRequest, ExpenseReportPlanReimbursementRequest, ExpenseReportRecallRequest, ExpenseReportReimburseRequest, ExpenseReportRejectRequest, ExpenseReportRequestChangesRequest, ExpenseReportUpdateRequest, ExpenseReviewUpdateRequest, ExpenseSplitItem, ExpenseSplitLineItem, ExpenseSplitRequest, FeeConfigurationRequest, HistoricalSyncRequest, HttpClientConfig, IntegrationCallbackRequest, IntegrationListRequest, InvitationCreateRequest, InvitationListRequest, InvoiceCreateRequest, InvoiceListRequest, InvoicePaymentCreateRequest, InvoicePaymentFilterRequest, InvoiceReminder, InvoiceSummary, InvoiceUpdateRequest, LedgerEntry, LedgerSummary, LocationBatchCreateRequest, LocationBatchUpdateRequest, LocationCreateRequest, LocationImageUrlRequest, LocationListRequest, LocationUpdateRequest, LoyaltyProgramCreateRequest, LoyaltyProgramListRequest, LoyaltyProgramStatus, LoyaltyProgramUpdateRequest, LoyaltyRewardType, LoyaltyRuleType, MailboxUpdateRequest, MembershipCreateRequest, MembershipEmailInviteRequest, MembershipListRequest, MembershipRoleUpdateRequest, NotificationListRequest, PagedResult, PaginateBusinessRequest, PaginateTransactionRequest, PaginationRequest, PaymentMethodListRequest, Payout, PayoutListRequest, PayoutListResponse, PayoutSchedule, PresignedUploadFileRequest, PresignedUploadFileResponse, PresignedUploadRequest, PresignedUploadResponse, PreviewPlanChangeRequest, ProductCreateRequest, ProductListRequest, ProductUpdateRequest, ReceiptCreateRequest, ReceiptListRequest, ReceiptOCRCreateRequest, ReceiptUpdateRequest, RefundCheckoutPaymentRequest, RefundCreateRequest, ReportDateRange, ReportingRequest, RequestOptions, SBAddress, SBAppInstallation, SBApprobationSummary, SBAttachment, SBAuthorizedSender, SBBalance, SBBatchResponse, SBBill, SBBillApproval, SBBillApprovalHistoryItem, SBBillAttachment, SBBillBulkActionResponse, SBBillLineItem, SBBillStatusSummary, SBBillTax, SBBillTransitionResponse, SBBillingAddress, SBBillingInvoice, SBBillingInvoiceLine, SBBillingPaymentMethod, SBBillingPlan, SBBillingUsage, SBBulkActionResponse, SBBulkActionResult, SBBusiness, SBBusinessBrand, SBBusinessPlan, SBCategory, SBCategoryRuleData, SBCheckoutLineItem, SBCheckoutPayment, SBCheckoutPaymentDispute, SBCheckoutPaymentRefund, SBCheckoutTax, SBCheckoutTransactionResponse, SBConnectAccount, SBConnectAccountRequirements, SBConnectDashboardResponse, SBConnectOnboardingResponse, SBConnectedAccount, SBCoordinate, SBCreateCheckoutPaymentIntentResponse, SBCustomer, SBDepartment, SBDepartmentMember, SBDispute, SBDowngradeValidation, SBEmailAccount, SBEmailAccountAuthorizeResponse, SBEmailForwardingConfig, SBEmployee, SBEmployeeCategoryBreakdownReport, SBEmployeeDepartment, SBEmployeeLocation, SBEmployeeManager, SBEntity, SBExpenseBulkActionResponse, SBExpenseByCategoryReport, SBExpenseByDayReport, SBExpenseByEmployeeReport, SBExpenseByVendorReport, SBExpenseJob, SBExpenseMonthlySummary, SBExpenseOverTimeDataPoint, SBExpenseOverTimeReport, SBExpenseReport, SBExpenseReportAuditLogEntry, SBExpenseReportBulkActionResponse, SBExpenseReportComment, SBExpenseReportItem, SBExpenseReportSummary, SBExpenseReportTimelineEntry, SBExpenseValidateResponse, SBFileDownloadResponse, SBHistoricalSyncResponse, SBIntegration, SBIntegrationAuthorizeResponse, SBInvitation, SBInvoice, SBInvoiceCustomer, SBInvoiceLineItem, SBInvoiceLineItemTax, SBInvoicePayment, SBItemVariationRuleData, SBListResponse, SBLocation, SBLocationImage, SBLoyaltyProgram, SBLoyaltyRule, SBLoyaltyRuleBase, SBMailbox, SBMarketplaceApp, SBMembership, SBMembershipBusinessSummary, SBMembershipUserSummary, SBMerchantLedger, SBMoney, SBNotification, SBPagination, SBPaymentMethod, SBPaymentMethodBillingDetails, SBPaymentMethodSetupIntentResponse, SBPayout, SBPlanChangePreview, SBPlanChangePreviewLineItem, SBPortalSession, SBProduct, SBProductImage, SBPromoCode, SBReceipt, SBReceiptBarcode, SBReceiptBusiness, SBReceiptCustomer, SBReceiptDiscount, SBReceiptDocument, SBReceiptFee, SBReceiptLineItem, SBReceiptPayment, SBReceiptPaymentCard, SBReceiptRefund, SBReceiptTax, SBReceiptTransaction, SBReceiptVendor, SBRefund, SBSessionTokenResponse, SBSetupIntent, SBSharedMailbox, SBSpendRuleData, SBSubscription, SBSyncSession, SBTable, SBTableColumn, SBTableRow, SBTax, SBTaxByCategoryReport, SBTaxByTypeReport, SBTaxByVendorReport, SBTaxSummaryReport, SBTimestamps, SBTransaction, SBTransactionAttachment, SBTransactionMerchant, SBTransactionTax, SBTransactionUploadResponse, SBTransactionVendor, SBUpcomingInvoice, SBUserAccount, SBValidateEmailResponse, SBValidateSharedMailboxResponse, SBVendor, SBVendorBulkActionResponse, SBVendorConnectResponse, SBVendorConnection, SBVendorImportResult, SBVisitRuleData, SBWorkflow, SBWorkflowCondition, SBWorkflowStep, SBWorkflowTestResponse, SmartbillsClientOptions, SmartbillsFieldError, SubmitDisputeEvidenceRequest, SyncSessionListRequest, TableCreateRequest, TableListRequest, TableUpdateRequest, TaxCreateRequest, TaxListRequest, TaxUpdateRequest, TransactionBatchUpdateRequest, TransactionCreateRequest, TransactionFeeRequest, TransactionLineItemRequest, TransactionMerchantRequest, TransactionTaxRequest, TransactionUpdateRequest, UpdateInstallationStatusRequest, UpdatePayoutScheduleRequest, UpgradeSubscriptionRequest, UsageHistoryRequest, UserUpdateRequest, VendorBatchUpdateRequest, VendorConnectRequest, VendorCreateRequest, VendorListRequest, VendorMergeRequest, VendorUpdateRequest, WorkflowCreateRequest, WorkflowListRequest, WorkflowTestRequest, WorkflowUpdateRequest };
8405
+ export { AccessToken, AppInstallationService, AppInstallationStatus, ApprobationService, AttachmentService, AuthorizedSenderService, BaseService, BillApprovalStatus, BillApprovalType, BillService, SBBillStatus as BillStatus, BillingService, BusinessService, BusinessUserService, CategoryService, ChargeStatus, CheckoutDocumentType, CheckoutPaymentStatus, CheckoutService, CheckoutStatus, ConnectAccountStatus, ConnectService, ConnectedAccountService, ConnectedAccountStatus, ConnectedAccountType, CreditNoteService, CustomerService, DEFAULT_BASE_URL, DepartmentService, DisputeEvidenceSlot, DisputeService, EmailAccountService, EmailAccountStatus, EmailAccountSyncStatus, EmailAccountType, EmailForwardingService, EmployeeService, ErrorCode, ExpenseItemStatus, ExpenseJobService, ExpenseJobStatus, ExpenseReportAuditLogAction, ExpenseReportExpenseService, ExpenseReportPaymentService, ExpenseReportService, ExpenseReportStatus, ExpenseService, ExpenseSplitType, HttpClient, IntegrationService, IntegrationStatus, InvitationService, InvitationStatus, InvoicePaymentService, InvoicePaymentStatus, InvoiceReminderFrequency, InvoiceReminderTiming, InvoiceService, LateFeeFrequency, LateFeeType, LocationService, LoyaltyService, MailboxType, MembershipRole, MembershipService, NotificationService, NotificationType, PayerType, PaymentIntentService, PaymentIntentStatus, PaymentMethodService, PaymentService, PaymentTerms, PayoutInterval, PayoutService, PayoutStatus, ProductService, PromoCodeService, ReceiptPaymentStatus, ReceiptPaymentType, ReceiptService, ReceiptSource, ReceiptType, ReportingService, SBBillStatus, SBInvoiceStatus, SBPaymentStatus, SmartbillsApiError, SmartbillsAuthenticationError, SmartbillsClient, SmartbillsConflictError, SmartbillsError, SmartbillsNetworkError, SmartbillsNotFoundError, SmartbillsPermissionError, SmartbillsQuotaError, SmartbillsRateLimitError, SmartbillsValidationError, StatementService, StatementStatus, SyncTriggerType, TableService, TaxService, TransactionService, TransactionType, UserService, VendorConnectionService, VendorConnectionStatus, VendorService, WorkflowService, WorkflowTriggerType, isApiError, isAuthenticationError, isConflictError, isNetworkError, isNotFoundError, isPermissionError, isQuotaError, isRateLimitError, isRetryableError, isSmartbillsError, isValidationError, uploadFileToS3, uploadFileUriToS3 };
8406
+ export type { AddExpenseToReportRequest, AddExpensesToReportBatchRequest, ApplyCustomerCreditRequest, ApprobationListRequest, AssociateExpenseReportUpdateRequest, AttachmentListRequest, AttachmentRenameRequest, BalanceAmount, BillApprovalRequest, BillBatchUpdateRequest, BillCancelRequest, BillCreateRequest, BillListRequest, BillMarkPaidRequest, BillReschedulePaymentRequest, BillRetryPaymentRequest, BillSchedulePaymentRequest, BillSubmitForApprovalRequest, BillTransitionRequest, BillUpdateRequest, BillingInvoiceListRequest, BulkApproveApprobationsRequest, BulkAssignCategoryRequest, BulkAssignExpenseReportRequest, BulkAssignPayerTypeRequest, BulkAssignReportCategoryRequest, BulkAssignVendorRequest, BulkBillApproveRequest, BulkBillCancelPaymentRequest, BulkBillDeleteRequest, BulkBillMarkPaidRequest, BulkBillRemindRequest, BulkBillRetryPaymentRequest, BulkBillSchedulePaymentRequest, BulkBillUnscheduleRequest, BulkBillUpdateRequest, BulkDeleteExpenseReportsRequest, BulkDeleteExpensesRequest, BulkDeleteVendorsRequest, BulkMarkReimbursedApprobationsRequest, BulkPlanReimbursementApprobationsRequest, BulkRecallExpenseReportsRequest, BulkRejectApprobationsRequest, BulkRemoveReportExpensesRequest, BulkRequestChangesApprobationsRequest, BulkRevertToReviewApprobationsRequest, BulkSetNoteRequest, BulkSubmitExpenseReportsRequest, BusinessBatchUpdateRequest, BusinessBrandCreateRequest, BusinessBrandUpdateRequest, BusinessCreateRequest, BusinessUpdateRequest, CategoryCreateRequest, CategoryListRequest, CategoryUpdateRequest, CheckoutLineItem, ConfirmUploadFileRequest, ConfirmUploadRequest, ConnectOnboardingRequest, ConnectedAccountBankAccount, ConnectedAccountFees, ConnectedAccountLateFeeSettings, ConnectedAccountLateFeeSettingsRequest, ConnectedAccountOnboardingRequest, ConnectedAccountOnboardingResult, ConnectedAccountProcessing, ConnectedAccountRequirements, ConnectedAccountSettings, ConnectedAccountSettingsRequest, CreateAuthorizedSenderRequest, CreateCheckoutPaymentIntentRequest, CreatePaymentMethodRequest, CreatePayoutRequest, CreatePortalSessionRequest, CredentialProvider, CreditNoteCreateRequest, CreditNoteLineItemRequest, CreditNoteReason, CreditNoteStatus, CreditNoteType, CustomerCreateRequest, CustomerCreditBalance, CustomerCreditLedgerEntry, CustomerCreditLedgerSource, CustomerListRequest, CustomerUpdateRequest, DepartmentCreateRequest, DepartmentListRequest, DepartmentUpdateRequest, DisputeEvidenceFinalizeRequest, DisputeEvidenceFinalizeResponse, DisputeEvidenceRequest, DisputeEvidenceUploadUrlRequest, DisputeEvidenceUploadUrlResponse, DisputeListRequest, EditExpenseInReportRequest, EmailAccountImapCreateRequest, EmailAccountListRequest, EmailAccountOAuth2CreateRequest, EmailAccountUpdateRequest, EmailForwardingConfigRequest, EmployeeBulkAssignManagerRequest, EmployeeCreateRequest, EmployeeListRequest, EmployeeSetManagerRequest, EmployeeUpdateRequest, ErrorCodeType, ExpenseAttachmentDownloadRequest, ExpenseCategoryUpdateRequest, ExpenseExportRequest, ExpenseJobListRequest, ExpenseListRequest, ExpenseNoteUpdateRequest, ExpenseOverTimeRequest, ExpensePayerTypeUpdateRequest, ExpenseReportApproveRequest, ExpenseReportAssignLedgerAccountRequest, ExpenseReportCommentCreateRequest, ExpenseReportCreateRequest, ExpenseReportExportRequest, ExpenseReportListRequest, ExpenseReportPartialReimburseRequest, ExpenseReportPlanReimbursementRequest, ExpenseReportRecallRequest, ExpenseReportReimburseRequest, ExpenseReportRejectRequest, ExpenseReportRequestChangesRequest, ExpenseReportUpdateRequest, ExpenseReviewUpdateRequest, ExpenseSplitItem, ExpenseSplitLineItem, ExpenseSplitRequest, FeeConfigurationRequest, HistoricalSyncRequest, HttpClientConfig, IntegrationCallbackRequest, IntegrationListRequest, InvitationCreateRequest, InvitationListRequest, InvoiceCreateRequest, InvoiceDiscountCreateRequest, InvoiceFeeCreateRequest, InvoiceListRequest, InvoicePaymentCreateRequest, InvoicePaymentFilterRequest, InvoiceReminder, InvoiceSummary, InvoiceUpdateRequest, LedgerEntry, LedgerSummary, LocationBatchCreateRequest, LocationBatchUpdateRequest, LocationCreateRequest, LocationImageUrlRequest, LocationListRequest, LocationUpdateRequest, LoyaltyProgramCreateRequest, LoyaltyProgramListRequest, LoyaltyProgramStatus, LoyaltyProgramUpdateRequest, LoyaltyRewardType, LoyaltyRuleType, MailboxUpdateRequest, MembershipCreateRequest, MembershipEmailInviteRequest, MembershipListRequest, MembershipRoleUpdateRequest, NextInvoiceNumberResponse, NotificationListRequest, PagedResult, PaginateBusinessRequest, PaginateTransactionRequest, PaginationRequest, PaymentIntentListRequest, PaymentListRequest, PaymentMethodListRequest, Payout, PayoutListRequest, PayoutListResponse, PayoutSchedule, PresignedUploadFileRequest, PresignedUploadFileResponse, PresignedUploadRequest, PresignedUploadResponse, PreviewPlanChangeRequest, ProductCreateRequest, ProductListRequest, ProductUpdateRequest, PublicInvoiceCustomer, PublicInvoiceLineItem, PublicInvoiceMerchant, PublicInvoiceMerchantRating, PublicInvoiceMerchantSocial, PublicInvoicePayment, PublicInvoicePaymentCardSnippet, PublicInvoiceResponse, ReceiptCreateRequest, ReceiptListRequest, ReceiptOCRCreateRequest, ReceiptUpdateRequest, RefundCheckoutPaymentRequest, RefundCreateRequest, ReportDateRange, ReportingRequest, RequestOptions, SBAddress, SBAppInstallation, SBApprobationSummary, SBAttachment, SBAuthorizedSender, SBBalance, SBBatchResponse, SBBill, SBBillApproval, SBBillApprovalHistoryItem, SBBillAttachment, SBBillBulkActionResponse, SBBillEmployee, SBBillLineItem, SBBillStatusHistoryItem, SBBillStatusSummary, SBBillTax, SBBillTransitionResponse, SBBillVendor, SBBillVendorAccount, SBBillingAddress, SBBillingInvoice, SBBillingInvoiceLine, SBBillingPaymentMethod, SBBillingPlan, SBBillingUsage, SBBulkActionResponse, SBBulkActionResult, SBBusiness, SBBusinessBrand, SBBusinessPlan, SBCategory, SBCategoryRuleData, SBCharge, SBCheckoutLineItem, SBCheckoutPayment, SBCheckoutPaymentDispute, SBCheckoutPaymentRefund, SBCheckoutTax, SBCheckoutTransactionResponse, SBConnectAccount, SBConnectAccountRequirements, SBConnectDashboardResponse, SBConnectOnboardingResponse, SBConnectedAccount, SBCoordinate, SBCreateCheckoutPaymentIntentResponse, SBCreditNote, SBCreditNoteLineItem, SBCustomer, SBDepartment, SBDepartmentMember, SBDispute, SBDisputeListResponse, SBDisputeStats, SBDowngradeValidation, SBEmailAccount, SBEmailAccountAuthorizeResponse, SBEmailForwardingConfig, SBEmployee, SBEmployeeCategoryBreakdownReport, SBEmployeeDepartment, SBEmployeeLocation, SBEmployeeManager, SBEntity, SBExpenseBulkActionResponse, SBExpenseByCategoryReport, SBExpenseByDayReport, SBExpenseByEmployeeReport, SBExpenseByVendorReport, SBExpenseJob, SBExpenseMonthlySummary, SBExpenseOverTimeDataPoint, SBExpenseOverTimeReport, SBExpenseReport, SBExpenseReportAuditLogEntry, SBExpenseReportBulkActionResponse, SBExpenseReportComment, SBExpenseReportItem, SBExpenseReportSummary, SBExpenseReportTimelineEntry, SBExpenseValidateResponse, SBFileDownloadResponse, SBHistoricalSyncResponse, SBIntegration, SBIntegrationAuthorizeResponse, SBInvitation, SBInvoice, SBInvoiceCustomer, SBInvoiceEmployee, SBInvoiceLineItem, SBInvoiceLineItemTax, SBInvoiceMerchant, SBInvoicePayment, SBInvoiceRecurring, SBInvoiceStripeLinks, SBItemVariationRuleData, SBListResponse, SBLocation, SBLocationImage, SBLoyaltyProgram, SBLoyaltyRule, SBLoyaltyRuleBase, SBMailbox, SBMarketplaceApp, SBMembership, SBMembershipBusinessSummary, SBMembershipUserSummary, SBMerchantLedger, SBMoney, SBNotification, SBPagination, SBPayment, SBPaymentCardSnippet, SBPaymentExternalSnippet, SBPaymentIntent, SBPaymentIntentSummary, SBPaymentMethod, SBPaymentMethodBankAccountInfo, SBPaymentMethodBillingDetails, SBPaymentMethodCardInfo, SBPaymentMethodInfo, SBPaymentMethodSetupIntentResponse, SBPayout, SBPlanChangePreview, SBPlanChangePreviewLineItem, SBPortalSession, SBProduct, SBProductImage, SBPromoCode, SBReceipt, SBReceiptBarcode, SBReceiptBusiness, SBReceiptCustomer, SBReceiptDiscount, SBReceiptDocument, SBReceiptFee, SBReceiptLineItem, SBReceiptPayment, SBReceiptPaymentCard, SBReceiptRefund, SBReceiptTax, SBReceiptTransaction, SBReceiptVendor, SBRefund, SBSessionTokenResponse, SBSetupIntent, SBSharedMailbox, SBSpendRuleData, SBStatement, SBSubscription, SBSyncSession, SBTable, SBTableColumn, SBTableRow, SBTax, SBTaxByCategoryReport, SBTaxByTypeReport, SBTaxByVendorReport, SBTaxSummaryReport, SBTimestamps, SBTransaction, SBTransactionAttachment, SBTransactionMerchant, SBTransactionTax, SBTransactionUploadResponse, SBTransactionVendor, SBUpcomingInvoice, SBUserAccount, SBValidateEmailResponse, SBValidateSharedMailboxResponse, SBVendor, SBVendorBulkActionResponse, SBVendorConnectResponse, SBVendorConnection, SBVendorImportResult, SBVisitRuleData, SBWorkflow, SBWorkflowCondition, SBWorkflowStep, SBWorkflowTestResponse, SmartbillsClientOptions, SmartbillsFieldError, StatementListRequest, StatementListResponse, SubmitDisputeEvidenceRequest, SyncSessionListRequest, TableCreateRequest, TableListRequest, TableUpdateRequest, TaxCreateRequest, TaxListRequest, TaxUpdateRequest, TransactionBatchUpdateRequest, TransactionCreateRequest, TransactionFeeRequest, TransactionLineItemRequest, TransactionMerchantRequest, TransactionTaxRequest, TransactionUpdateRequest, UpdateInstallationStatusRequest, UpdatePayoutScheduleRequest, UpgradeSubscriptionRequest, UsageHistoryRequest, UserUpdateRequest, VendorBatchUpdateRequest, VendorConnectRequest, VendorCreateRequest, VendorListRequest, VendorMergeRequest, VendorUpdateRequest, WorkflowCreateRequest, WorkflowListRequest, WorkflowTestRequest, WorkflowUpdateRequest };