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

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.
@@ -215,11 +215,11 @@ interface ReceiptOCRCreateRequest {
215
215
  * underlying row and evolve independently.
216
216
  */
217
217
  declare enum SBInvoiceStatus {
218
- DRAFT = "Draft",
219
- OPEN = "Open",
220
- PAID = "Paid",
221
- VOID = "Void",
222
- UNCOLLECTIBLE = "Uncollectible"
218
+ DRAFT = "DRAFT",
219
+ OPEN = "OPEN",
220
+ PAID = "PAID",
221
+ VOID = "VOID",
222
+ UNCOLLECTIBLE = "UNCOLLECTIBLE"
223
223
  }
224
224
  /**
225
225
  * Lifecycle status from the recipient's perspective (AP side — accounts payable).
@@ -227,16 +227,16 @@ declare enum SBInvoiceStatus {
227
227
  * execution. Distinct from {@link SBInvoiceStatus}; both can coexist on the same row.
228
228
  */
229
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"
230
+ DRAFT = "DRAFT",
231
+ PENDING_APPROVAL = "PENDING_APPROVAL",
232
+ APPROVED = "APPROVED",
233
+ READY_FOR_PAYMENT = "READY_FOR_PAYMENT",
234
+ SCHEDULED = "SCHEDULED",
235
+ PROCESSING = "PROCESSING",
236
+ PAYMENT_FAILED = "PAYMENT_FAILED",
237
+ DENIED = "DENIED",
238
+ PAID = "PAID",
239
+ VOID = "VOID"
240
240
  }
241
241
  /**
242
242
  * Payment state — shared between issuer and recipient. Money is objective: when
@@ -244,21 +244,129 @@ declare enum SBBillStatus {
244
244
  * {@link SBInvoiceStatus} and {@link SBBillStatus}.
245
245
  */
246
246
  declare enum SBPaymentStatus {
247
- UNPAID = "Unpaid",
248
- PARTIALLY_PAID = "PartiallyPaid",
249
- PAID = "Paid",
250
- PARTIALLY_REFUNDED = "PartiallyRefunded",
251
- REFUNDED = "Refunded"
247
+ UNPAID = "UNPAID",
248
+ PARTIALLY_PAID = "PARTIALLY_PAID",
249
+ PAID = "PAID",
250
+ PARTIALLY_REFUNDED = "PARTIALLY_REFUNDED",
251
+ REFUNDED = "REFUNDED"
252
252
  }
253
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"
254
+ UPON_RECEIPT = "UPON_RECEIPT",
255
+ NET_7 = "NET_7",
256
+ NET_15 = "NET_15",
257
+ NET_30 = "NET_30",
258
+ NET_45 = "NET_45",
259
+ NET_60 = "NET_60",
260
+ NET_90 = "NET_90",
261
+ CUSTOM = "CUSTOM"
262
+ }
263
+ /**
264
+ * Payment method an invoice can be settled with on the hosted page. The
265
+ * allowlist on an invoice tells Stripe Checkout which `payment_method_types`
266
+ * to surface and is enforced server-side when the checkout session is created
267
+ * so the customer can't bypass the merchant's preference.
268
+ *
269
+ * Today only CARD is fully wired end-to-end; the other slots are reserved so
270
+ * the UI surface (toggle chips, public-page method icons) can be built once
271
+ * and lit up as backend support lands.
272
+ */
273
+ declare enum SBPaymentMethodType {
274
+ CARD = "CARD",
275
+ INTERAC = "INTERAC",
276
+ ACH = "ACH",
277
+ WIRE = "WIRE"
278
+ }
279
+ /**
280
+ * Channel-level notification preferences for an invoice. Each channel can
281
+ * inherit the merchant-wide default by setting `useBusinessDefault: true` —
282
+ * editing one channel doesn't detach the others.
283
+ */
284
+ interface InvoiceNotificationPrefs {
285
+ /** Whether the customer receives the initial "invoice sent" email + scheduled reminders. */
286
+ emailEnabled?: boolean;
287
+ /** Whether the customer receives SMS reminders (when phone is on file). */
288
+ smsEnabled?: boolean;
289
+ /** Whether the merchant gets a copy of customer-facing reminders. */
290
+ merchantCcOnReminders?: boolean;
291
+ /**
292
+ * Sentinel: when true, all of the above are ignored and the merchant's
293
+ * business-level defaults apply. The reminders editor in Step 3 of the
294
+ * creator flips this off only when the merchant overrides any channel.
295
+ */
296
+ useBusinessDefault?: boolean;
297
+ }
298
+ /**
299
+ * Merchant-wide reminder defaults applied to every new invoice. Mirrors the
300
+ * shape stored under `business_reminder_defaults` on the API side.
301
+ *
302
+ * Per-invoice `reminders[]` overrides this entirely when present; per-channel
303
+ * notification prefs override via {@link InvoiceNotificationPrefs.useBusinessDefault}.
304
+ */
305
+ interface BusinessReminderDefaults {
306
+ reminders: InvoiceReminder[];
307
+ notificationPrefs?: InvoiceNotificationPrefs;
308
+ /**
309
+ * Days past due before an unpaid invoice is auto-marked UNCOLLECTIBLE by
310
+ * the daily sweep. Defaults to 90 server-side when absent.
311
+ */
312
+ uncollectibleAfterDays?: number;
313
+ }
314
+ /**
315
+ * Payload for the manual "mark invoice as paid" endpoint. All fields are
316
+ * optional — sending an empty body falls back to method=EXTERNAL, amount=
317
+ * amount due, paidOn=now (the original one-click behaviour).
318
+ *
319
+ * Supports partial payments: when `amount` is less than amount due, the
320
+ * invoice stays Open with paymentStatus=PARTIALLY_PAID. The full amount due
321
+ * is auto-filled when `amount` is omitted.
322
+ */
323
+ /**
324
+ * Shared payload for all four invoice bulk-action endpoints (send /
325
+ * mark-paid / void / delete). Just the IDs to act on — per-action options
326
+ * (payment method, void reason, etc.) can be added as optional fields when
327
+ * product needs them.
328
+ */
329
+ interface BulkInvoiceActionRequest {
330
+ invoiceIds: number[];
331
+ }
332
+ /**
333
+ * Canonical bulk-action response. Top-level counts drive the success /
334
+ * warning / error toast pattern; the per-id `results` list carries
335
+ * structured error codes the dashboard groups by reason in the toast hint.
336
+ */
337
+ interface BulkInvoiceActionResponse {
338
+ successCount: number;
339
+ failedCount: number;
340
+ skippedCount: number;
341
+ results: BulkInvoiceActionResult[];
342
+ }
343
+ interface BulkInvoiceActionResult {
344
+ invoiceId: number;
345
+ success: boolean;
346
+ error?: string;
347
+ errorCode?: string;
348
+ }
349
+ interface InvoiceMarkPaidRequest {
350
+ /** Payment method used to settle (or partially settle) the invoice. Defaults to EXTERNAL. */
351
+ method?: ReceiptPaymentType;
352
+ /** Amount paid. Omit to use the full amount due. */
353
+ amount?: SBMoney;
354
+ /** When the payment was received. Defaults to now. */
355
+ paidOn?: string;
356
+ /** Free-text identifier — check number, wire reference, external transaction ID. */
357
+ reference?: string;
358
+ /** Internal notes about this payment. */
359
+ notes?: string;
360
+ /** Card snippet when method=CARD (offline / external terminal). */
361
+ card?: {
362
+ brand?: string;
363
+ last4?: string;
364
+ };
365
+ /** Bank snippet when method=BANK_ACCOUNT. */
366
+ bankAccount?: {
367
+ bankName?: string;
368
+ last4?: string;
369
+ };
262
370
  }
263
371
  /**
264
372
  * Customer projection embedded on an invoice. Carries the billing/shipping address
@@ -303,6 +411,8 @@ interface SBInvoiceLineItem {
303
411
  id?: number;
304
412
  description?: string;
305
413
  quantity?: number;
414
+ /** Unit label rendered between Qty and Unit price (e.g. "hours", "kg", "units"). */
415
+ unit?: string;
306
416
  unitPrice?: number;
307
417
  price?: SBMoney;
308
418
  subTotal?: SBMoney;
@@ -377,8 +487,16 @@ interface SBInvoice extends SBEntity, SBTimestamps {
377
487
  lineItems?: SBInvoiceLineItem[];
378
488
  lineItemGroups?: unknown[];
379
489
  taxes?: SBInvoiceLineItemTax[];
380
- discounts?: unknown[];
381
- fees?: unknown[];
490
+ /** Aggregated, named taxes for renderer display. Mirrors {@link PublicInvoiceResponse.taxes}. */
491
+ taxBreakdown?: PublicInvoiceTax[];
492
+ discounts?: PublicInvoiceDiscount[];
493
+ fees?: PublicInvoiceFee[];
494
+ /** Early-payment incentive — see {@link PublicInvoiceEarlyPaymentDiscount}. */
495
+ earlyPaymentDiscount?: PublicInvoiceEarlyPaymentDiscount;
496
+ /** Pay-by-wire / pay-online instructions. Mirrors {@link PublicInvoiceResponse.paymentInstructions}. */
497
+ paymentInstructions?: PublicInvoicePaymentInstructions;
498
+ /** Free-text memo from the merchant. Mirrored to {@link PublicInvoiceResponse.notes}. */
499
+ notes?: string;
382
500
  subTotal?: SBMoney;
383
501
  totalTaxes?: SBMoney;
384
502
  totalDiscounts?: SBMoney;
@@ -388,6 +506,12 @@ interface SBInvoice extends SBEntity, SBTimestamps {
388
506
  amountDue?: SBMoney;
389
507
  balanceForward?: SBMoney;
390
508
  amountOverpaid?: SBMoney;
509
+ /**
510
+ * Customer-credit balance auto-applied to this invoice at finalization. Mirrors the
511
+ * field on PublicInvoiceResponse. Renderers should show this as a negative line
512
+ * between Total and AmountDue when present.
513
+ */
514
+ creditApplied?: SBMoney;
391
515
  date?: string;
392
516
  dueDate?: string;
393
517
  paymentTerms?: string;
@@ -402,6 +526,32 @@ interface SBInvoice extends SBEntity, SBTimestamps {
402
526
  recurring?: SBInvoiceRecurring | null;
403
527
  stripe?: SBInvoiceStripeLinks;
404
528
  reminders?: InvoiceReminder[];
529
+ /**
530
+ * Payment methods the customer is allowed to settle this invoice with on the
531
+ * hosted page. When empty/absent the server defaults to `[CARD]`. Enforced
532
+ * server-side when the Stripe Checkout session is created.
533
+ */
534
+ paymentMethodAllowlist?: SBPaymentMethodType[];
535
+ /** Per-channel notification preferences. See {@link InvoiceNotificationPrefs}. */
536
+ notificationPrefs?: InvoiceNotificationPrefs;
537
+ /**
538
+ * When set, the invoice was created in DRAFT and is queued to send at this
539
+ * ISO timestamp. The merchant sees a "Scheduled" badge until dispatch.
540
+ */
541
+ scheduledSendAt?: string;
542
+ /**
543
+ * Additional email addresses CC'd on every invoice email (initial send and
544
+ * reminders). Order is preserved.
545
+ */
546
+ ccEmails?: string[];
547
+ /**
548
+ * When true, the public Pay button is disabled and the customer is told to
549
+ * contact support. The invoice's lifecycle `invoiceStatus` is unchanged —
550
+ * this is an orthogonal flag merchants can flip without losing OPEN state.
551
+ */
552
+ requiresManualReview?: boolean;
553
+ /** Free-text reason shown alongside the disabled Pay button on the public page. */
554
+ manualReviewReason?: string;
405
555
  }
406
556
  interface InvoiceListRequest extends PaginationRequest {
407
557
  invoiceStatus?: SBInvoiceStatus;
@@ -476,6 +626,10 @@ interface InvoiceCreateRequest {
476
626
  billingAddress?: SBAddress;
477
627
  shippingAddress?: SBAddress;
478
628
  reminders?: InvoiceReminder[];
629
+ paymentMethodAllowlist?: SBPaymentMethodType[];
630
+ notificationPrefs?: InvoiceNotificationPrefs;
631
+ scheduledSendAt?: string;
632
+ ccEmails?: string[];
479
633
  }
480
634
  type InvoiceUpdateRequest = Partial<InvoiceCreateRequest>;
481
635
  interface NextInvoiceNumberResponse {
@@ -523,8 +677,107 @@ interface PublicInvoiceLineItem {
523
677
  name?: string;
524
678
  description?: string;
525
679
  quantity?: number;
680
+ /**
681
+ * Unit label rendered between Qty and Unit price (e.g. "hours", "kg", "units").
682
+ * The renderer hides the column entirely when no line item carries a unit.
683
+ */
684
+ unit?: string;
526
685
  unitPrice?: SBMoney;
527
686
  total?: SBMoney;
687
+ /**
688
+ * Per-tax breakdown for this line. The renderer surfaces a "Tax" column
689
+ * showing each rate (e.g. "5%", "9.975%") when at least one line carries
690
+ * taxes — otherwise the column is hidden, same auto-hide rule as `unit`.
691
+ */
692
+ taxes?: PublicInvoiceLineItemTax[];
693
+ }
694
+ interface PublicInvoiceLineItemTax {
695
+ /** Human-readable tax name (e.g. "GST", "QST"). */
696
+ name?: string;
697
+ /** Percentage rate — 5 means 5%. */
698
+ rate?: number;
699
+ /** Monetary amount this tax contributes to the line. */
700
+ amount?: SBMoney;
701
+ }
702
+ /**
703
+ * Itemized fee on the public invoice projection. When the merchant attached
704
+ * one or more named fees, the renderer surfaces them as their own summary lines
705
+ * (e.g. "Processing fee +$15"). Falls back to the flat {@link PublicInvoiceResponse.totalFees}
706
+ * when this array is empty.
707
+ */
708
+ interface PublicInvoiceFee {
709
+ name?: string;
710
+ amount?: SBMoney;
711
+ /** Rate when {@link type} is PERCENTAGE — e.g. 2.9 for "2.9%". */
712
+ percentage?: number;
713
+ type?: "FIXED" | "PERCENTAGE";
714
+ }
715
+ /**
716
+ * Itemized discount on the public invoice projection. Mirrors {@link PublicInvoiceFee}
717
+ * but for reductions. Amount is always positive; the renderer prefixes it with "−".
718
+ */
719
+ interface PublicInvoiceDiscount {
720
+ name?: string;
721
+ amount?: SBMoney;
722
+ /** Rate when {@link type} is PERCENTAGE — e.g. 10 for "10%". */
723
+ percentage?: number;
724
+ type?: "FIXED" | "PERCENTAGE";
725
+ }
726
+ /**
727
+ * Early-payment incentive. The renderer shows both an inline summary line
728
+ * ("Early-payment discount −$30") and a callout near the amount-due hero
729
+ * ("Pay by May 20 to save $30"). The callout disappears once the deadline
730
+ * passes; the summary line stays so paid invoices still show the math.
731
+ */
732
+ interface PublicInvoiceEarlyPaymentDiscount {
733
+ /** Discount rate — e.g. 2 for "2% off". */
734
+ percentage?: number;
735
+ /** Pre-computed savings, in invoice currency. */
736
+ amount?: SBMoney;
737
+ /** ISO timestamp by which the customer must pay to claim the discount. */
738
+ deadline?: string;
739
+ }
740
+ /**
741
+ * Itemized tax on the public invoice projection. When provided, the renderer
742
+ * shows each tax on its own summary line with name + rate (e.g. "Sales tax
743
+ * (NY 8.875%)"). Falls back to the flat {@link PublicInvoiceResponse.totalTaxes}
744
+ * when this array is empty.
745
+ */
746
+ interface PublicInvoiceTax {
747
+ /** Display name — "Sales tax", "HST", "GST". */
748
+ name?: string;
749
+ /** Optional jurisdiction shown alongside the rate — "NY", "ON". */
750
+ jurisdiction?: string;
751
+ /** Rate in percent — e.g. 8.875 for 8.875%. */
752
+ rate?: number;
753
+ amount?: SBMoney;
754
+ }
755
+ /** Wire-transfer payment instructions for the second invoice card. */
756
+ interface PublicInvoiceWireInstructions {
757
+ /** Bank routing / transit number. */
758
+ routing?: string;
759
+ /** Account identifier. Server should mask before exposing — e.g. "•••• 4421". */
760
+ account?: string;
761
+ /** SWIFT / BIC code. */
762
+ swift?: string;
763
+ /** Optional bank name. */
764
+ bankName?: string;
765
+ }
766
+ /** Online (hosted-checkout) payment instructions. */
767
+ interface PublicInvoiceOnlinePaymentInstructions {
768
+ /** Display URL — e.g. "smartbills.app/i/k7x29q". */
769
+ url?: string;
770
+ /** Free-text label of accepted methods — "Card, ACH, Apple Pay accepted." */
771
+ methodsLabel?: string;
772
+ }
773
+ /**
774
+ * "Pay by wire / pay online" panel rendered as a separate card below the
775
+ * invoice. Either side is optional — render only the channels the merchant
776
+ * supports.
777
+ */
778
+ interface PublicInvoicePaymentInstructions {
779
+ wire?: PublicInvoiceWireInstructions;
780
+ online?: PublicInvoiceOnlinePaymentInstructions;
528
781
  }
529
782
  interface PublicInvoicePaymentCardSnippet {
530
783
  brand?: string;
@@ -565,12 +818,125 @@ interface PublicInvoiceResponse {
565
818
  total?: SBMoney;
566
819
  amountPaid?: SBMoney;
567
820
  amountDue?: SBMoney;
821
+ /**
822
+ * Customer-credit balance auto-applied at finalization. Always positive — reduces what
823
+ * the payer owes through the checkout. Renderer surfaces this as a "Crédit appliqué"
824
+ * line so the customer sees why their amount due is less than the invoice total.
825
+ */
826
+ creditApplied?: SBMoney;
827
+ /**
828
+ * Carry-over balance (from a prior negative customer-credit balance) rolled into this
829
+ * invoice. Always positive — adds to the amount due. Renderer surfaces this as a
830
+ * "Solde reporté" line above the total.
831
+ */
832
+ balanceForward?: SBMoney;
568
833
  issuedAt?: string;
569
834
  dueDate?: string;
835
+ /**
836
+ * Payment terms — the {@link PaymentTerms} enum value (e.g. "NET_30", "UPON_RECEIPT")
837
+ * or arbitrary free text for custom terms. The renderer maps known enum values to
838
+ * localized labels and falls back to the raw string otherwise.
839
+ */
840
+ paymentTerms?: string;
841
+ /**
842
+ * Free-text memo from the merchant — payment instructions, thank-you note,
843
+ * legal disclaimer. Rendered above the action bar when present, with line
844
+ * breaks preserved.
845
+ */
846
+ notes?: string;
847
+ /**
848
+ * Itemized fees. When provided, the renderer shows each fee on its own summary
849
+ * line. When empty/absent, falls back to {@link totalFees}.
850
+ */
851
+ fees?: PublicInvoiceFee[];
852
+ /**
853
+ * Itemized discounts. When provided, the renderer shows each discount on its
854
+ * own summary line. When empty/absent, falls back to {@link totalDiscounts}.
855
+ */
856
+ discounts?: PublicInvoiceDiscount[];
857
+ /**
858
+ * Itemized taxes. When provided, the renderer shows each tax on its own
859
+ * summary line with name + rate (e.g. "Sales tax (NY 8.875%)"). Falls back
860
+ * to {@link totalTaxes} when empty/absent.
861
+ */
862
+ taxes?: PublicInvoiceTax[];
863
+ /** Early-payment incentive. See {@link PublicInvoiceEarlyPaymentDiscount}. */
864
+ earlyPaymentDiscount?: PublicInvoiceEarlyPaymentDiscount;
865
+ /**
866
+ * Pay-by-wire / pay-online instructions. When provided, the renderer shows a
867
+ * second card below the invoice with these details. Either channel is optional.
868
+ */
869
+ paymentInstructions?: PublicInvoicePaymentInstructions;
570
870
  shortCode?: string;
571
871
  checkoutUrl?: string;
572
872
  payments?: PublicInvoicePayment[];
573
873
  merchantRating?: PublicInvoiceMerchantRating;
874
+ /**
875
+ * Payment methods the customer can settle this invoice with. Renderer maps
876
+ * these to the chips above the Pay button and the renderer's "accepted
877
+ * methods" label. Empty/absent → defaults to CARD only.
878
+ */
879
+ paymentMethodAllowlist?: SBPaymentMethodType[];
880
+ /**
881
+ * When true, the public Pay button is disabled with a "Contact support"
882
+ * message. {@link manualReviewReason} carries the human-readable reason.
883
+ */
884
+ requiresManualReview?: boolean;
885
+ manualReviewReason?: string;
886
+ /**
887
+ * Set when an open dispute exists for this invoice — derived server-side
888
+ * from the related Dispute entity. Renderer shows a "Disputed" status
889
+ * chip and disables the Pay button.
890
+ */
891
+ hasOpenDispute?: boolean;
892
+ }
893
+ /**
894
+ * Activity timeline event surfaced on the public hosted page and the
895
+ * merchant's invoice detail.
896
+ *
897
+ * The list is append-only on the API side; each kind corresponds to a
898
+ * webhook/cron action or a manual merchant intervention.
899
+ */
900
+ declare enum SBInvoiceActivityKind {
901
+ CREATED = "CREATED",
902
+ SENT = "SENT",
903
+ VIEWED = "VIEWED",
904
+ REMINDER_SENT = "REMINDER_SENT",
905
+ PARTIAL_PAYMENT = "PARTIAL_PAYMENT",
906
+ PAID = "PAID",
907
+ VOIDED = "VOIDED",
908
+ MARKED_UNCOLLECTIBLE = "MARKED_UNCOLLECTIBLE",
909
+ MANUAL_REVIEW_FLAGGED = "MANUAL_REVIEW_FLAGGED",
910
+ MANUAL_REVIEW_CLEARED = "MANUAL_REVIEW_CLEARED",
911
+ DISPUTE_OPENED = "DISPUTE_OPENED",
912
+ DISPUTE_RESOLVED = "DISPUTE_RESOLVED",
913
+ REFUND_ISSUED = "REFUND_ISSUED"
914
+ }
915
+ /**
916
+ * One row of the invoice activity log. Payload shape varies by {@link kind};
917
+ * consumers should type-narrow as needed. {@link occurredAt} is always set;
918
+ * {@link actor} identifies the agent (server, cron, user id) when relevant.
919
+ */
920
+ interface SBInvoiceActivityEvent {
921
+ id?: number;
922
+ invoiceId?: number;
923
+ kind: SBInvoiceActivityKind;
924
+ occurredAt: string;
925
+ actor?: string;
926
+ payload?: Record<string, unknown>;
927
+ }
928
+ /**
929
+ * Export format for the public invoice download menu.
930
+ */
931
+ type PublicInvoiceExportFormat = "json" | "csv";
932
+ /**
933
+ * Response from `POST /v1/invoices/pay/{shortCode}/attach-to-wallet`.
934
+ */
935
+ interface AttachInvoiceToWalletResponse {
936
+ /** True when the invoice now lives in the authenticated user's wallet. */
937
+ attached: boolean;
938
+ /** Wallet UI URL to redirect the user to after attaching. */
939
+ walletUrl?: string;
574
940
  }
575
941
 
576
942
  /**
@@ -628,51 +994,45 @@ declare enum CheckoutDocumentType {
628
994
  * Represents the current state of an individual payment on a receipt.
629
995
  */
630
996
  declare enum ReceiptPaymentStatus {
631
- /** Payment has been approved */
632
- APPROVED = 0,
997
+ /** Payment has been approved (note: matches API's historical "Approuved" spelling, serialized as APPROUVED) */
998
+ APPROUVED = "APPROUVED",
633
999
  /** Payment is pending processing */
634
- PENDING = 1,
1000
+ PENDING = "PENDING",
635
1001
  /** Payment has been completed */
636
- COMPLETED = 2,
1002
+ COMPLETED = "COMPLETED",
637
1003
  /** Payment has been cancelled */
638
- CANCELLED = 3,
1004
+ CANCELLED = "CANCELLED",
639
1005
  /** Payment attempt failed */
640
- FAILED = 4,
1006
+ FAILED = "FAILED",
641
1007
  /** Payment has been received */
642
- PAID = 5,
1008
+ PAID = "PAID",
643
1009
  /** Payment has not yet been made */
644
- UNPAID = 6,
1010
+ UNPAID = "UNPAID",
645
1011
  /** Payment is past the due date */
646
- OVERDUE = 7,
647
- /** Payment is currently being processed */
648
- PROCESSING = 8,
649
- /** Payment requires additional customer action */
650
- REQUIRES_ACTION = 9,
651
- /** Full refund has been issued */
652
- REFUNDED = 10,
653
- /** Partial refund has been issued */
654
- PARTIALLY_REFUNDED = 11,
655
- /** Payment is under dispute */
656
- DISPUTED = 12
1012
+ OVERDUE = "OVERDUE"
657
1013
  }
658
1014
  /**
659
1015
  * The payment method type used for a receipt payment.
660
1016
  */
661
1017
  declare enum ReceiptPaymentType {
662
1018
  /** Credit or debit card */
663
- CARD = 0,
1019
+ CARD = "CARD",
664
1020
  /** Cash payment */
665
- CASH = 1,
1021
+ CASH = "CASH",
666
1022
  /** Direct bank account transfer */
667
- BANK_ACCOUNT = 2,
668
- /** External payment method */
669
- EXTERNAL = 3,
1023
+ BANK_ACCOUNT = "BANK_ACCOUNT",
1024
+ /** Check payment */
1025
+ CHECK = "CHECK",
1026
+ /** External payment method (catch-all for manual entry) */
1027
+ EXTERNAL = "EXTERNAL",
670
1028
  /** Store credits or account balance */
671
- CREDITS = 4,
1029
+ CREDITS = "CREDITS",
672
1030
  /** Gift card */
673
- GIFT_CARD = 5,
1031
+ GIFT_CARD = "GIFT_CARD",
674
1032
  /** Other payment method */
675
- OTHER = 6
1033
+ OTHER = "OTHER",
1034
+ /** Settlement entry (internal reconciliation) */
1035
+ SETTLEMENT = "SETTLEMENT"
676
1036
  }
677
1037
  /**
678
1038
  * The type classification of a receipt.
@@ -2369,6 +2729,7 @@ interface SBTransaction extends SBEntity, SBTimestamps {
2369
2729
  merchant?: SBTransactionMerchant;
2370
2730
  categoryId?: number;
2371
2731
  categoryName?: string;
2732
+ departmentId?: number;
2372
2733
  note?: string;
2373
2734
  expenseReportId?: number;
2374
2735
  expenseReportName?: string;
@@ -2377,6 +2738,21 @@ interface SBTransaction extends SBEntity, SBTimestamps {
2377
2738
  attachments?: SBTransactionAttachment[];
2378
2739
  taxes?: SBTransactionTax[];
2379
2740
  reviewStatus?: string;
2741
+ /** True when a receipt attachment is linked. Derived server-side from AttachmentId. */
2742
+ hasReceipt?: boolean;
2743
+ /** How the transaction entered the system (Api, Dashboard, MobileApp, Manual, …). */
2744
+ source?: TransactionSource;
2745
+ }
2746
+ /**
2747
+ * How a transaction entered the system. Mirrors the API SBTransactionSource enum.
2748
+ */
2749
+ declare enum TransactionSource {
2750
+ API = "Api",
2751
+ Dashboard = "Dashboard",
2752
+ MobileApp = "MobileApp",
2753
+ ExpenseForwarding = "ExpenseForwarding",
2754
+ ThirdPartyApp = "ThirdPartyApp",
2755
+ Manual = "Manual"
2380
2756
  }
2381
2757
  /**
2382
2758
  * Vendor information associated with a transaction.
@@ -2467,6 +2843,17 @@ interface TransactionMerchantRequest {
2467
2843
  website?: string;
2468
2844
  email?: string;
2469
2845
  phoneNumber?: string;
2846
+ address?: TransactionMerchantAddressRequest;
2847
+ }
2848
+ interface TransactionMerchantAddressRequest {
2849
+ line1?: string;
2850
+ line2?: string;
2851
+ city?: string;
2852
+ state?: string;
2853
+ stateCode?: string;
2854
+ country?: string;
2855
+ countryCode?: string;
2856
+ postalCode?: string;
2470
2857
  }
2471
2858
  interface TransactionUpdateRequest {
2472
2859
  title?: string;
@@ -2513,6 +2900,40 @@ interface TransactionCreateRequest {
2513
2900
  vendorId?: number;
2514
2901
  payerType?: PayerType;
2515
2902
  expenseReportId?: number;
2903
+ /**
2904
+ * Manual-creation fields (server accepts these via ManualExpenseCreateRequest).
2905
+ * Send the picked vendor's identity via `merchant` so the API can
2906
+ * parse + find-or-create both the SBBusiness merchant and the matching
2907
+ * vendor — passing `vendorId` alone leaves the merchant unresolved and
2908
+ * list views render blank.
2909
+ */
2910
+ merchant?: TransactionMerchantRequest;
2911
+ totalAmount?: number;
2912
+ subTotalAmount?: number;
2913
+ taxAmount?: number;
2914
+ tipAmount?: number;
2915
+ departmentId?: number;
2916
+ attachmentId?: number;
2917
+ tags?: string[];
2918
+ taxes?: TransactionTaxCreateRequest[];
2919
+ fees?: TransactionFeeCreateRequest[];
2920
+ lineItems?: TransactionLineItemCreateRequest[];
2921
+ }
2922
+ interface TransactionTaxCreateRequest {
2923
+ name?: string;
2924
+ rate?: number;
2925
+ amount?: number;
2926
+ taxIncluded?: boolean;
2927
+ }
2928
+ interface TransactionFeeCreateRequest {
2929
+ name?: string;
2930
+ amount?: number;
2931
+ }
2932
+ interface TransactionLineItemCreateRequest {
2933
+ description?: string;
2934
+ quantity?: number;
2935
+ unitPrice?: number;
2936
+ taxIds?: number[];
2516
2937
  }
2517
2938
 
2518
2939
  /**
@@ -4568,6 +4989,20 @@ declare class ExpenseService extends BaseService {
4568
4989
  * @throws {SmartbillsValidationError} If the provided data fails validation
4569
4990
  */
4570
4991
  createForEmployee(employeeId: number, data: TransactionCreateRequest, options?: RequestOptions): Promise<SBTransaction>;
4992
+ /**
4993
+ * Links a pre-uploaded attachment to an existing expense. Does NOT trigger OCR.
4994
+ *
4995
+ * Use this for manually-entered expenses where the user adds a receipt
4996
+ * after the fact. The attachment must already exist (uploaded via
4997
+ * AttachmentService.uploadBatch).
4998
+ *
4999
+ * @param employeeId - The employee that owns the expense
5000
+ * @param expenseId - The expense to attach the receipt to
5001
+ * @param attachmentId - The id of the pre-uploaded attachment
5002
+ * @param options - Request options including business context
5003
+ * @returns The updated expense
5004
+ */
5005
+ attachReceipt(employeeId: number, expenseId: number, attachmentId: number, options?: RequestOptions): Promise<SBTransaction>;
4571
5006
  update(expenseId: number, data: TransactionUpdateRequest, options?: RequestOptions): Promise<SBTransaction>;
4572
5007
  /**
4573
5008
  * Deletes an expense.
@@ -6630,6 +7065,12 @@ declare class DepartmentService extends BaseService {
6630
7065
  delete(id: number, options?: RequestOptions): Promise<void>;
6631
7066
  }
6632
7067
 
7068
+ /**
7069
+ * Product type — matches the Square-style classification used in the
7070
+ * "Create catalog item" flow. Serialized as a CONSTANT_CASE string by the
7071
+ * API.
7072
+ */
7073
+ type SBProductType = "PHYSICAL" | "PREPARED_FOOD_AND_BEVERAGE" | "EVENT" | "DIGITAL" | "SERVICE" | "OTHER";
6633
7074
  interface SBProduct extends SBEntity, SBTimestamps {
6634
7075
  name: string;
6635
7076
  description?: string;
@@ -6649,6 +7090,20 @@ interface SBProduct extends SBEntity, SBTimestamps {
6649
7090
  lowStockThreshold?: number;
6650
7091
  weight?: number;
6651
7092
  weightUnit?: string;
7093
+ /** Quantity unit (e.g., "each", "hour", "kg") — free-text. */
7094
+ unit?: string;
7095
+ /** Product classification (physical, digital, service, etc.). */
7096
+ type?: SBProductType;
7097
+ /**
7098
+ * Tax IDs that auto-apply when this product is added to an invoice or
7099
+ * receipt. Resolved server-side from the merchant's tax catalog.
7100
+ */
7101
+ taxIds?: number[];
7102
+ /**
7103
+ * The product's priced variants. The API always returns this collection;
7104
+ * a "default variant" product still has exactly one entry here.
7105
+ */
7106
+ variants?: SBProductVariant[];
6652
7107
  currency?: string;
6653
7108
  status?: string;
6654
7109
  active?: boolean;
@@ -6674,6 +7129,10 @@ interface ProductCreateRequest {
6674
7129
  taxCode?: string;
6675
7130
  trackInventory?: boolean;
6676
7131
  stockQuantity?: number;
7132
+ unit?: string;
7133
+ type?: SBProductType;
7134
+ /** Tax IDs that auto-apply when this product is added to an invoice. */
7135
+ taxIds?: number[];
6677
7136
  }
6678
7137
  interface ProductUpdateRequest {
6679
7138
  name?: string;
@@ -6688,6 +7147,82 @@ interface ProductUpdateRequest {
6688
7147
  taxCode?: string;
6689
7148
  trackInventory?: boolean;
6690
7149
  stockQuantity?: number;
7150
+ unit?: string;
7151
+ type?: SBProductType;
7152
+ /** Pass `null` to keep existing taxes, `[]` to clear, or specific IDs to replace. */
7153
+ taxIds?: number[] | null;
7154
+ }
7155
+ interface SBProductVariant extends SBEntity, SBTimestamps {
7156
+ name: string;
7157
+ price: number;
7158
+ initialPrice?: number;
7159
+ sku?: string;
7160
+ upc?: string;
7161
+ taxable?: boolean;
7162
+ weight?: number;
7163
+ weightUnit?: string;
7164
+ productId: number;
7165
+ }
7166
+ interface ProductVariantCreateRequest {
7167
+ name: string;
7168
+ price: number;
7169
+ initialPrice?: number;
7170
+ sku?: string;
7171
+ upc?: string;
7172
+ taxable?: boolean;
7173
+ weight?: number;
7174
+ weightUnit?: string;
7175
+ imageIds?: number[];
7176
+ }
7177
+ interface ProductVariantUpdateRequest {
7178
+ name?: string;
7179
+ price?: number;
7180
+ initialPrice?: number;
7181
+ sku?: string;
7182
+ upc?: string;
7183
+ taxable?: boolean;
7184
+ weight?: number;
7185
+ weightUnit?: string;
7186
+ imageIds?: number[];
7187
+ }
7188
+ interface SBProductImageDetail {
7189
+ id: number;
7190
+ name?: string;
7191
+ url: string;
7192
+ height?: number;
7193
+ width?: number;
7194
+ productVariantIds?: number[];
7195
+ createdAt: string;
7196
+ updatedAt?: string;
7197
+ }
7198
+ interface ProductImagePresignedUploadFileRequest {
7199
+ fileName: string;
7200
+ contentType: string;
7201
+ fileSize: number;
7202
+ }
7203
+ interface ProductImagePresignedUploadRequest {
7204
+ files: ProductImagePresignedUploadFileRequest[];
7205
+ }
7206
+ interface ProductImagePresignedUploadFileResponse {
7207
+ fileName: string;
7208
+ s3Key: string;
7209
+ uploadUrl: string;
7210
+ contentType: string;
7211
+ }
7212
+ interface ProductImagePresignedUploadResponse {
7213
+ uploadSessionId: string;
7214
+ files: ProductImagePresignedUploadFileResponse[];
7215
+ }
7216
+ interface ProductImageConfirmUploadFileRequest {
7217
+ s3Key: string;
7218
+ fileName: string;
7219
+ contentType: string;
7220
+ altText?: string;
7221
+ productVariantIds?: number[];
7222
+ }
7223
+ interface ProductImageConfirmUploadRequest {
7224
+ uploadSessionId: string;
7225
+ files: ProductImageConfirmUploadFileRequest[];
6691
7226
  }
6692
7227
 
6693
7228
  declare class ProductService extends BaseService {
@@ -6698,6 +7233,22 @@ declare class ProductService extends BaseService {
6698
7233
  delete(id: number, options?: RequestOptions): Promise<void>;
6699
7234
  }
6700
7235
 
7236
+ declare class ProductVariantService extends BaseService {
7237
+ list(productId: number, options?: RequestOptions): Promise<SBProductVariant[]>;
7238
+ getById(productId: number, variantId: number, options?: RequestOptions): Promise<SBProductVariant>;
7239
+ create(productId: number, data: ProductVariantCreateRequest, options?: RequestOptions): Promise<SBProductVariant>;
7240
+ update(productId: number, variantId: number, data: ProductVariantUpdateRequest, options?: RequestOptions): Promise<SBProductVariant>;
7241
+ delete(productId: number, variantId: number, options?: RequestOptions): Promise<SBProductVariant>;
7242
+ }
7243
+
7244
+ declare class ProductImageService extends BaseService {
7245
+ presign(productId: number, data: ProductImagePresignedUploadRequest, options?: RequestOptions): Promise<ProductImagePresignedUploadResponse>;
7246
+ confirm(productId: number, data: ProductImageConfirmUploadRequest, options?: RequestOptions): Promise<SBProductImageDetail[]>;
7247
+ list(productId: number, options?: RequestOptions): Promise<SBProductImageDetail[]>;
7248
+ getById(productId: number, imageId: number, options?: RequestOptions): Promise<SBProductImageDetail>;
7249
+ delete(productId: number, imageId: number, options?: RequestOptions): Promise<void>;
7250
+ }
7251
+
6701
7252
  interface SBTax extends SBEntity, SBTimestamps {
6702
7253
  name: string;
6703
7254
  percentage: number;
@@ -6734,30 +7285,141 @@ declare class TaxService extends BaseService {
6734
7285
  delete(id: number, options?: RequestOptions): Promise<void>;
6735
7286
  }
6736
7287
 
6737
- /** Represents a promotional code that can be applied to receipts or transactions. */
7288
+ /**
7289
+ * Discriminator for how the promo-code value is interpreted.
7290
+ *
7291
+ * - `AMOUNT` — fixed amount subtracted from the invoice (uses {@link SBPromoCode.amount}).
7292
+ * - `PERCENTAGE` — rate applied to the post-fee subtotal (uses {@link SBPromoCode.percentage}).
7293
+ *
7294
+ * Serialized as UPPER_SNAKE_CASE on the wire by the API's `JsonStringEnumConverter`
7295
+ * (`ConstantCasePropertyNameResolver`).
7296
+ */
7297
+ type SBPromoCodeType = "AMOUNT" | "PERCENTAGE";
7298
+ /**
7299
+ * Promotional code attached to a business's discount catalog. Referenced by id
7300
+ * from {@link SBInvoice.discounts} when applied to a transaction. The catalog
7301
+ * row holds the canonical amount/percentage and active state; per-invoice
7302
+ * application copies the resolved amount onto the discount line.
7303
+ */
6738
7304
  interface SBPromoCode extends SBEntity, SBTimestamps {
6739
7305
  name: string;
6740
- code: string;
6741
- type: string;
6742
- value: number;
6743
- active: boolean;
7306
+ type: SBPromoCodeType;
7307
+ /** Present when `type === "AMOUNT"`. Currency-aware fixed reduction. */
7308
+ amount?: SBMoney;
7309
+ /** Present when `type === "PERCENTAGE"`. Whole-number rate (e.g. `10` for 10%). */
7310
+ percentage?: number;
7311
+ /** Whether this code can currently be redeemed. */
7312
+ isActive?: boolean;
7313
+ /** Optional redemption code the customer types at checkout (e.g. "SUMMER2024"). */
7314
+ code?: string;
7315
+ /** ISO timestamp — promo is invalid before this. Null = no lower bound. */
7316
+ startsAt?: string;
7317
+ /** ISO timestamp — promo is invalid after this. Null = no upper bound. */
7318
+ endsAt?: string;
7319
+ /** Hard cap on total redemptions across all customers. Null = unlimited. */
7320
+ maxRedemptions?: number;
7321
+ /** Read-only counter — incremented each time the promo is applied to a finalized invoice. */
7322
+ redemptionCount?: number;
7323
+ /** Restricts a given customer to a single redemption. */
7324
+ oncePerCustomer?: boolean;
7325
+ /** Subtotal floor the order must meet for the promo to apply. Null = no floor. */
7326
+ minimumOrderAmount?: SBMoney;
7327
+ /** Restricts redemption to customers with no prior paid invoices. */
7328
+ firstTimeCustomersOnly?: boolean;
7329
+ }
7330
+ interface PromoCodeListRequest extends PaginationRequest {
7331
+ search?: string;
7332
+ isActive?: boolean;
7333
+ }
7334
+ interface PromoCodeCreateRequest {
7335
+ name: string;
7336
+ type?: SBPromoCodeType;
7337
+ /** Required when `type === "AMOUNT"`. Currency must match the invoices it's applied to. */
7338
+ amount?: SBMoney;
7339
+ /** Required when `type === "PERCENTAGE"`. */
7340
+ percentage?: number;
7341
+ isActive?: boolean;
7342
+ code?: string;
7343
+ startsAt?: string;
7344
+ endsAt?: string;
7345
+ maxRedemptions?: number;
7346
+ oncePerCustomer?: boolean;
7347
+ minimumOrderAmount?: SBMoney;
7348
+ firstTimeCustomersOnly?: boolean;
7349
+ }
7350
+ /**
7351
+ * Update payload — all fields optional. Null/undefined means "leave the
7352
+ * persisted value alone" (the API treats omitted fields as untouched).
7353
+ */
7354
+ interface PromoCodeUpdateRequest {
7355
+ name?: string;
7356
+ type?: SBPromoCodeType;
7357
+ amount?: SBMoney;
7358
+ percentage?: number;
7359
+ isActive?: boolean;
7360
+ code?: string;
7361
+ startsAt?: string;
7362
+ endsAt?: string;
7363
+ maxRedemptions?: number;
7364
+ oncePerCustomer?: boolean;
7365
+ minimumOrderAmount?: SBMoney;
7366
+ firstTimeCustomersOnly?: boolean;
6744
7367
  }
6745
7368
 
6746
7369
  /**
6747
7370
  * Service for managing promotional codes within a business.
6748
7371
  *
6749
- * Promo codes provide discounts to customers on receipts and invoices.
7372
+ * Promo codes hold the canonical amount/percentage in the merchant's catalog
7373
+ * and are referenced by id when applied to a receipt or invoice — the apply
7374
+ * path resolves the value server-side so clients can't override it.
6750
7375
  */
6751
7376
  declare class PromoCodeService extends BaseService {
7377
+ /**
7378
+ * Retrieves a paginated list of promo codes for the business.
7379
+ *
7380
+ * @param params - Optional filters and pagination parameters (`search`, `isActive`, plus standard pagination).
7381
+ * @param options - Request options including business context and abort signal.
7382
+ * @returns A paginated list of promo codes.
7383
+ */
7384
+ list(params?: PromoCodeListRequest, options?: RequestOptions): Promise<SBListResponse<SBPromoCode>>;
6752
7385
  /**
6753
7386
  * Retrieves a single promotional code by ID.
6754
7387
  *
6755
- * @param id - The promo code ID
6756
- * @param options - Request options including business context and abort signal
6757
- * @returns The promotional code
6758
- * @throws {SmartbillsNotFoundError} If the promo code is not found
7388
+ * @param id - The promo code ID.
7389
+ * @param options - Request options including business context and abort signal.
7390
+ * @returns The promotional code.
7391
+ * @throws {SmartbillsNotFoundError} If the promo code is not found.
6759
7392
  */
6760
7393
  getById(id: number, options?: RequestOptions): Promise<SBPromoCode>;
7394
+ /**
7395
+ * Creates a new promotional code in the business catalog.
7396
+ *
7397
+ * @param data - The promo code creation payload (`name`, `type`, plus `amount` or `percentage`).
7398
+ * @param options - Request options including business context and abort signal.
7399
+ * @returns The newly created promo code.
7400
+ * @throws {SmartbillsValidationError} If the provided data fails validation.
7401
+ */
7402
+ create(data: PromoCodeCreateRequest, options?: RequestOptions): Promise<SBPromoCode>;
7403
+ /**
7404
+ * Updates an existing promotional code. The backend currently only persists
7405
+ * the `isActive` flip; extra fields are accepted on the SDK side so callers
7406
+ * can pass a full edit shape without breaking when the contract expands.
7407
+ *
7408
+ * @param id - The promo code ID.
7409
+ * @param data - The fields to update.
7410
+ * @param options - Request options including business context and abort signal.
7411
+ * @returns The updated promo code.
7412
+ * @throws {SmartbillsNotFoundError} If the promo code is not found.
7413
+ */
7414
+ update(id: number, data: PromoCodeUpdateRequest, options?: RequestOptions): Promise<SBPromoCode>;
7415
+ /**
7416
+ * Deletes a promotional code from the business catalog.
7417
+ *
7418
+ * @param id - The promo code ID.
7419
+ * @param options - Request options including business context and abort signal.
7420
+ * @throws {SmartbillsNotFoundError} If the promo code is not found.
7421
+ */
7422
+ delete(id: number, options?: RequestOptions): Promise<void>;
6761
7423
  }
6762
7424
 
6763
7425
  interface CategoryListRequest extends PaginationRequest {
@@ -7051,6 +7713,14 @@ declare class AttachmentService extends BaseService {
7051
7713
  * @throws {SmartbillsNotFoundError} If the attachment is not found
7052
7714
  */
7053
7715
  delete(id: number, options?: RequestOptions): Promise<void>;
7716
+ /**
7717
+ * Uploads one or more files via the no-OCR batch endpoint and returns the
7718
+ * created attachments.
7719
+ *
7720
+ * Pair with ExpenseService.attachReceipt to link an attachment to a
7721
+ * manually-entered expense without triggering Textract.
7722
+ */
7723
+ uploadBatch(files: File[], options?: RequestOptions): Promise<SBAttachment[]>;
7054
7724
  }
7055
7725
 
7056
7726
  /** Represents an email forwarding configuration for a user or business. */
@@ -7290,8 +7960,20 @@ declare class InvoiceService extends BaseService {
7290
7960
  delete(id: number, options?: RequestOptions): Promise<void>;
7291
7961
  send(id: number, options?: RequestOptions): Promise<SBInvoice>;
7292
7962
  void(id: number, options?: RequestOptions): Promise<SBInvoice>;
7293
- markPaid(id: number, options?: RequestOptions): Promise<SBInvoice>;
7963
+ markPaid(id: number, request?: InvoiceMarkPaidRequest, options?: RequestOptions): Promise<SBInvoice>;
7294
7964
  duplicate(id: number, options?: RequestOptions): Promise<SBInvoice>;
7965
+ /**
7966
+ * Bulk send a list of draft invoices. Returns success/failed/skipped counts
7967
+ * plus a per-id result list — the canonical bulk-action shape used by
7968
+ * `useBulkActionNotification` in the dashboard.
7969
+ */
7970
+ bulkSend(request: BulkInvoiceActionRequest, options?: RequestOptions): Promise<BulkInvoiceActionResponse>;
7971
+ /** Bulk void invoices. Skipped: already Paid or Void. */
7972
+ bulkVoid(request: BulkInvoiceActionRequest, options?: RequestOptions): Promise<BulkInvoiceActionResponse>;
7973
+ /** Bulk mark a list of open invoices as paid (full amount due, external method). */
7974
+ bulkMarkPaid(request: BulkInvoiceActionRequest, options?: RequestOptions): Promise<BulkInvoiceActionResponse>;
7975
+ /** Bulk delete draft invoices. */
7976
+ bulkDelete(request: BulkInvoiceActionRequest, options?: RequestOptions): Promise<BulkInvoiceActionResponse>;
7295
7977
  getNextInvoiceNumber(customerId?: number, options?: RequestOptions): Promise<NextInvoiceNumberResponse>;
7296
7978
  getSummary(options?: RequestOptions): Promise<InvoiceSummary>;
7297
7979
  downloadPdf(id: number, options?: RequestOptions): Promise<Blob>;
@@ -7301,6 +7983,46 @@ declare class InvoiceService extends BaseService {
7301
7983
  * `https://invoice.smartbills.ca/i/{shortCode}`).
7302
7984
  */
7303
7985
  getByShortcode(shortCode: string): Promise<PublicInvoiceResponse>;
7986
+ /**
7987
+ * Activity timeline for the public invoice page — append-only event log
7988
+ * (sent, viewed, reminders, payments, disputes, …). Public endpoint keyed
7989
+ * by shortCode; no auth required.
7990
+ */
7991
+ getPublicActivity(shortCode: string): Promise<SBInvoiceActivityEvent[]>;
7992
+ /**
7993
+ * Multi-format export for the public invoice download menu. Returns a Blob
7994
+ * so the renderer can save it with a sensible filename — the server sets
7995
+ * the `Content-Type` (`application/json` or `text/csv`).
7996
+ */
7997
+ exportPublic(shortCode: string, format: PublicInvoiceExportFormat): Promise<Blob>;
7998
+ /**
7999
+ * Receipt PDF for a specific payment on a public invoice. Returns the
8000
+ * signed S3 download URL the renderer hands to `window.open()` (or
8001
+ * `<a download>`). The artifact is generated by the post-payment webhook
8002
+ * via `GeneratePaymentReceiptPdfAsync` on the API side.
8003
+ */
8004
+ getPublicReceiptUrl(shortCode: string, paymentId: number): Promise<{
8005
+ url: string;
8006
+ }>;
8007
+ /**
8008
+ * Attach a public invoice to the authenticated user's Smartbills wallet.
8009
+ * The caller is expected to have set an access token on the SDK client
8010
+ * before invoking (the public-page renderer runs the OAuth2 flow first,
8011
+ * persists the bearer, then calls this).
8012
+ */
8013
+ attachToWallet(shortCode: string, options?: RequestOptions): Promise<AttachInvoiceToWalletResponse>;
8014
+ /**
8015
+ * Update only the reminders[] array of an invoice without touching the rest
8016
+ * of the payload. Used by the notification settings UI and Step 3 of the
8017
+ * creator wizard.
8018
+ */
8019
+ updateReminders(id: number, reminders: InvoiceReminder[], options?: RequestOptions): Promise<SBInvoice>;
8020
+ /**
8021
+ * Fetch the merchant-wide reminder defaults applied to every new invoice.
8022
+ */
8023
+ getReminderDefaults(options?: RequestOptions): Promise<BusinessReminderDefaults>;
8024
+ /** Update the merchant-wide reminder defaults. */
8025
+ updateReminderDefaults(data: BusinessReminderDefaults, options?: RequestOptions): Promise<BusinessReminderDefaults>;
7304
8026
  }
7305
8027
 
7306
8028
  declare enum ConnectedAccountStatus {
@@ -7562,18 +8284,19 @@ declare class InvoicePaymentService extends BaseService {
7562
8284
  /**
7563
8285
  * Credit-note types — provider-agnostic. Mirrors `Smartbills.Core.DTO.CreditNotes` server-side.
7564
8286
  *
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`.
8287
+ * Stripe-aligned settlement model: a credit note is a single document whose total splits across
8288
+ * three buckets {@link CreditNoteCreateRequest.refundAmount} (Stripe refund),
8289
+ * {@link CreditNoteCreateRequest.outOfBandAmount} (cash/check/wire recorded only),
8290
+ * {@link CreditNoteCreateRequest.creditAmount} (customer balance for future invoices). The three
8291
+ * amounts MUST sum to the credit note's total. Any combination is valid, including a single bucket
8292
+ * (refund-only, balance-only) or mixed ($60 refund + $40 balance).
7569
8293
  *
7570
- * Stripe's native CreditNote API is not used (would require creating Stripe Invoices,
7571
- * which incur a per-invoice fee).
8294
+ * Stripe's native CreditNote API is not used (would require creating Stripe Invoices, which incur
8295
+ * a per-invoice fee).
7572
8296
  */
7573
- type CreditNoteType = "Refund" | "CustomerBalance";
7574
8297
  type CreditNoteStatus = "Draft" | "Issued" | "Voided";
7575
8298
  type CreditNoteReason = "Duplicate" | "Fraudulent" | "OrderChange" | "ProductUnsatisfactory" | "Other";
7576
- type CustomerCreditLedgerSource = "CreditNote" | "Application" | "Reversal";
8299
+ type CustomerCreditLedgerSource = "CreditNote" | "Application" | "Reversal" | "ManualAdjustment";
7577
8300
  interface CreditNoteLineItemRequest {
7578
8301
  invoiceLineItemId?: number | null;
7579
8302
  description?: string;
@@ -7582,13 +8305,20 @@ interface CreditNoteLineItemRequest {
7582
8305
  taxAmount?: number;
7583
8306
  }
7584
8307
  interface CreditNoteCreateRequest {
7585
- type: CreditNoteType;
7586
8308
  reason: CreditNoteReason;
7587
8309
  /** Either supply lineItems or a flat amount in cents. lineItems take precedence. */
7588
8310
  lineItems?: CreditNoteLineItemRequest[];
7589
8311
  /** Smallest currency unit (cents). Used when lineItems are not provided. */
7590
8312
  amount?: number;
7591
8313
  currency?: string;
8314
+ /** Portion refunded via the original Stripe charge. Triggers a real Stripe refund. */
8315
+ refundAmount?: SBMoney;
8316
+ /** Portion refunded out-of-band (cash, check, wire). Recorded only — no money movement. */
8317
+ outOfBandAmount?: SBMoney;
8318
+ /** Portion added to the customer's credit balance for future invoices. */
8319
+ creditAmount?: SBMoney;
8320
+ /** Optional reference for the out-of-band refund (check number, wire ref, …). */
8321
+ outOfBandReference?: string;
7592
8322
  memo?: string;
7593
8323
  }
7594
8324
  interface ApplyCustomerCreditRequest {
@@ -7597,6 +8327,18 @@ interface ApplyCustomerCreditRequest {
7597
8327
  currency?: string;
7598
8328
  notes?: string;
7599
8329
  }
8330
+ /**
8331
+ * Manual adjustment to a customer's credit balance. Signed amount (positive = top-up,
8332
+ * negative = deduction). Writes a {@link CustomerCreditLedgerEntry} with
8333
+ * source="ManualAdjustment".
8334
+ */
8335
+ interface CustomerCreditAdjustmentRequest {
8336
+ /** Signed dollar amount. Positive = top-up, negative = deduction/write-off. */
8337
+ amount: number;
8338
+ currency?: string;
8339
+ reason?: string;
8340
+ notes?: string;
8341
+ }
7600
8342
  interface SBCreditNoteLineItem {
7601
8343
  id: number;
7602
8344
  sbCreditNoteId: number;
@@ -7617,16 +8359,20 @@ interface SBCreditNote {
7617
8359
  invoiceId: number;
7618
8360
  number: string;
7619
8361
  reason: CreditNoteReason;
7620
- type: CreditNoteType;
7621
8362
  status: CreditNoteStatus;
7622
8363
  /** Total in dollars (matches server-side decimal storage). */
7623
8364
  totalAmount: number;
7624
8365
  totalCurrency: string;
8366
+ /** Settlement breakdown — sums to totalAmount. */
8367
+ refundAmount: number;
8368
+ outOfBandAmount: number;
8369
+ creditAmount: number;
7625
8370
  memo?: string;
7626
8371
  issuedAt?: string | null;
7627
8372
  voidedAt?: string | null;
7628
8373
  /** Set asynchronously once the agnostic payment.refunded webhook lands. */
7629
8374
  relatedRefundId?: number | null;
8375
+ outOfBandRefundId?: number | null;
7630
8376
  customerCreditEntryId?: number | null;
7631
8377
  createdAt: string;
7632
8378
  lineItems: SBCreditNoteLineItem[];
@@ -7638,6 +8384,12 @@ interface CustomerCreditLedgerEntry {
7638
8384
  source: CustomerCreditLedgerSource;
7639
8385
  sourceCreditNoteId?: number | null;
7640
8386
  appliedToInvoiceId?: number | null;
8387
+ /**
8388
+ * Human-readable invoice number for Application entries (e.g. "INV-2026-0042").
8389
+ * Resolved server-side via a join so the dashboard can render the number
8390
+ * without fetching each invoice individually.
8391
+ */
8392
+ appliedToInvoiceNumber?: string | null;
7641
8393
  notes?: string;
7642
8394
  createdAt: string;
7643
8395
  }
@@ -7648,6 +8400,16 @@ interface CustomerCreditBalance {
7648
8400
  currency: string;
7649
8401
  entries: CustomerCreditLedgerEntry[];
7650
8402
  }
8403
+ /**
8404
+ * Slim per-currency balance row from the multi-currency list endpoint
8405
+ * (`GET /customers/{id}/credit-balances`). One row per currency the customer
8406
+ * holds; rows with a zero balance are filtered out on the server side.
8407
+ */
8408
+ interface CustomerCreditBalanceSummary {
8409
+ customerId: number;
8410
+ currency: string;
8411
+ balance: number;
8412
+ }
7651
8413
 
7652
8414
  /**
7653
8415
  * Smartbills-owned credit notes. See `entities/credit-notes/models.ts` for the type-vs-status
@@ -7663,8 +8425,21 @@ declare class CreditNoteService extends BaseService {
7663
8425
  * when a customer-balance credit hasn't been applied to another invoice yet. */
7664
8426
  void(id: number, options?: RequestOptions): Promise<SBCreditNote>;
7665
8427
  getCustomerCreditBalance(customerId: number, currency?: string, options?: RequestOptions): Promise<CustomerCreditBalance>;
8428
+ /**
8429
+ * Multi-currency overview: one row per currency the customer holds. Empty
8430
+ * array when there's no non-zero balance in any currency. Backed by
8431
+ * `GET /customers/{id}/credit-balances` on the customer-credit-balance
8432
+ * controller (separate from the credit-note document concern).
8433
+ */
8434
+ listCustomerCreditBalances(customerId: number, options?: RequestOptions): Promise<CustomerCreditBalanceSummary[]>;
7666
8435
  /** Apply a positive customer credit balance to an outstanding invoice. */
7667
8436
  applyCreditToInvoice(invoiceId: number, data: ApplyCustomerCreditRequest, options?: RequestOptions): Promise<void>;
8437
+ /**
8438
+ * Manually adjust a customer's credit balance. Signed `amount` — positive tops up,
8439
+ * negative deducts. Deductions are server-side capped to the current balance to avoid
8440
+ * negative-balance accidents. Returns the persisted ledger entry.
8441
+ */
8442
+ adjustCustomerCredit(customerId: number, data: CustomerCreditAdjustmentRequest, options?: RequestOptions): Promise<CustomerCreditLedgerEntry>;
7668
8443
  }
7669
8444
 
7670
8445
  /**
@@ -8193,6 +8968,8 @@ declare class SmartbillsClient {
8193
8968
  readonly customers: CustomerService;
8194
8969
  readonly departments: DepartmentService;
8195
8970
  readonly products: ProductService;
8971
+ readonly productVariants: ProductVariantService;
8972
+ readonly productImages: ProductImageService;
8196
8973
  readonly taxes: TaxService;
8197
8974
  readonly promoCodes: PromoCodeService;
8198
8975
  readonly categories: CategoryService;
@@ -8399,8 +9176,114 @@ declare function isConflictError(error: unknown): error is SmartbillsConflictErr
8399
9176
  declare function isQuotaError(error: unknown): error is SmartbillsQuotaError;
8400
9177
  declare function isRetryableError(error: unknown): boolean;
8401
9178
 
9179
+ /**
9180
+ * Discount definition with the full Shopify/Stripe/Square rule surface.
9181
+ * Customer-facing redemption codes (`SBPromoCode`) attach to a coupon via
9182
+ * `couponId` — one coupon can back many codes. The discount math + rule
9183
+ * evaluation lives on the coupon; the code is just the customer-typed
9184
+ * artifact that triggers it.
9185
+ *
9186
+ * Rule evaluation runs server-side during invoice
9187
+ * recompute (see `CouponResolverService`). The client renders the rules
9188
+ * for editing but doesn't evaluate them.
9189
+ */
9190
+ type SBCouponType = "PERCENTAGE_OFF" | "FIXED_AMOUNT_OFF" | "FREE_SHIPPING" | "FIXED_PRICE";
9191
+ type SBCouponTargetType = "LINE_ITEM" | "SHIPPING";
9192
+ type SBCouponTargetSelection = "ALL" | "ENTITLED";
9193
+ type SBCouponAllocationMethod = "EACH" | "ACROSS";
9194
+ type SBCouponCustomerSelection = "ALL" | "PREREQUISITE";
9195
+ interface SBCoupon extends SBEntity, SBTimestamps {
9196
+ name?: string;
9197
+ description?: string;
9198
+ type: SBCouponType;
9199
+ amountOff?: SBMoney;
9200
+ percentOff?: number;
9201
+ fixedPrice?: number;
9202
+ isActive: boolean;
9203
+ startsAt?: string;
9204
+ endsAt?: string;
9205
+ maxRedemptions?: number;
9206
+ /** Read-only counter — bumped on invoice finalize. */
9207
+ redemptionCount: number;
9208
+ maxRedemptionsPerCustomer?: number;
9209
+ targetType: SBCouponTargetType;
9210
+ targetSelection: SBCouponTargetSelection;
9211
+ allocationMethod: SBCouponAllocationMethod;
9212
+ allocationLimit?: number;
9213
+ prerequisiteSubtotalMin?: SBMoney;
9214
+ prerequisiteSubtotalMax?: SBMoney;
9215
+ prerequisiteQuantityMin?: number;
9216
+ prerequisiteQuantityMax?: number;
9217
+ prerequisiteShippingPriceMin?: SBMoney;
9218
+ prerequisiteShippingPriceMax?: SBMoney;
9219
+ prerequisiteToEntitlementRatioPrereq?: number;
9220
+ prerequisiteToEntitlementRatioEntitle?: number;
9221
+ firstTimeCustomersOnly: boolean;
9222
+ customerSelection: SBCouponCustomerSelection;
9223
+ /** Bitmask: bit 0 = Monday, bit 6 = Sunday. 0 or 127 means "every day". */
9224
+ daysOfWeekBitmask: number;
9225
+ activeStartHour?: number;
9226
+ activeEndHour?: number;
9227
+ allowStacking: boolean;
9228
+ priority: number;
9229
+ entitledProductIds: number[];
9230
+ entitledVariantIds: number[];
9231
+ prerequisiteProductIds: number[];
9232
+ prerequisiteVariantIds: number[];
9233
+ entitledCustomerIds: number[];
9234
+ entitledSegmentIds: number[];
9235
+ entitledLocationIds: number[];
9236
+ /** Redemption codes (SBPromoCode) attached to this coupon. */
9237
+ promoCodeIds: number[];
9238
+ }
9239
+ interface CouponCreateRequest {
9240
+ name?: string;
9241
+ description?: string;
9242
+ type?: SBCouponType;
9243
+ amountOff?: SBMoney;
9244
+ percentOff?: number;
9245
+ fixedPrice?: number;
9246
+ isActive?: boolean;
9247
+ startsAt?: string;
9248
+ endsAt?: string;
9249
+ maxRedemptions?: number;
9250
+ maxRedemptionsPerCustomer?: number;
9251
+ targetType?: SBCouponTargetType;
9252
+ targetSelection?: SBCouponTargetSelection;
9253
+ allocationMethod?: SBCouponAllocationMethod;
9254
+ allocationLimit?: number;
9255
+ prerequisiteSubtotalMin?: SBMoney;
9256
+ prerequisiteSubtotalMax?: SBMoney;
9257
+ prerequisiteQuantityMin?: number;
9258
+ prerequisiteQuantityMax?: number;
9259
+ prerequisiteShippingPriceMin?: SBMoney;
9260
+ prerequisiteShippingPriceMax?: SBMoney;
9261
+ prerequisiteToEntitlementRatioPrereq?: number;
9262
+ prerequisiteToEntitlementRatioEntitle?: number;
9263
+ firstTimeCustomersOnly?: boolean;
9264
+ customerSelection?: SBCouponCustomerSelection;
9265
+ daysOfWeekBitmask?: number;
9266
+ activeStartHour?: number;
9267
+ activeEndHour?: number;
9268
+ allowStacking?: boolean;
9269
+ priority?: number;
9270
+ entitledProductIds?: number[];
9271
+ entitledVariantIds?: number[];
9272
+ prerequisiteProductIds?: number[];
9273
+ prerequisiteVariantIds?: number[];
9274
+ entitledCustomerIds?: number[];
9275
+ entitledSegmentIds?: number[];
9276
+ entitledLocationIds?: number[];
9277
+ }
9278
+ /**
9279
+ * PATCH-style update — every field is optional. Omitted fields leave the
9280
+ * persisted value alone. M2M id lists when non-null are applied as
9281
+ * replace-all (matches create semantics).
9282
+ */
9283
+ type CouponUpdateRequest = Partial<CouponCreateRequest>;
9284
+
8402
9285
  declare function uploadFileToS3(uploadUrl: string, file: Blob | ArrayBuffer, contentType: string): Promise<void>;
8403
9286
  declare function uploadFileUriToS3(uploadUrl: string, fileUri: string, contentType: string): Promise<void>;
8404
9287
 
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 };
9288
+ 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, ProductImageService, ProductService, ProductVariantService, PromoCodeService, ReceiptPaymentStatus, ReceiptPaymentType, ReceiptService, ReceiptSource, ReceiptType, ReportingService, SBBillStatus, SBInvoiceActivityKind, SBInvoiceStatus, SBPaymentMethodType, SBPaymentStatus, SmartbillsApiError, SmartbillsAuthenticationError, SmartbillsClient, SmartbillsConflictError, SmartbillsError, SmartbillsNetworkError, SmartbillsNotFoundError, SmartbillsPermissionError, SmartbillsQuotaError, SmartbillsRateLimitError, SmartbillsValidationError, StatementService, StatementStatus, SyncTriggerType, TableService, TaxService, TransactionService, TransactionSource, TransactionType, UserService, VendorConnectionService, VendorConnectionStatus, VendorService, WorkflowService, WorkflowTriggerType, isApiError, isAuthenticationError, isConflictError, isNetworkError, isNotFoundError, isPermissionError, isQuotaError, isRateLimitError, isRetryableError, isSmartbillsError, isValidationError, uploadFileToS3, uploadFileUriToS3 };
9289
+ export type { AddExpenseToReportRequest, AddExpensesToReportBatchRequest, ApplyCustomerCreditRequest, ApprobationListRequest, AssociateExpenseReportUpdateRequest, AttachInvoiceToWalletResponse, 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, BulkInvoiceActionRequest, BulkInvoiceActionResponse, BulkInvoiceActionResult, BulkMarkReimbursedApprobationsRequest, BulkPlanReimbursementApprobationsRequest, BulkRecallExpenseReportsRequest, BulkRejectApprobationsRequest, BulkRemoveReportExpensesRequest, BulkRequestChangesApprobationsRequest, BulkRevertToReviewApprobationsRequest, BulkSetNoteRequest, BulkSubmitExpenseReportsRequest, BusinessBatchUpdateRequest, BusinessBrandCreateRequest, BusinessBrandUpdateRequest, BusinessCreateRequest, BusinessReminderDefaults, BusinessUpdateRequest, CategoryCreateRequest, CategoryListRequest, CategoryUpdateRequest, CheckoutLineItem, ConfirmUploadFileRequest, ConfirmUploadRequest, ConnectOnboardingRequest, ConnectedAccountBankAccount, ConnectedAccountFees, ConnectedAccountLateFeeSettings, ConnectedAccountLateFeeSettingsRequest, ConnectedAccountOnboardingRequest, ConnectedAccountOnboardingResult, ConnectedAccountProcessing, ConnectedAccountRequirements, ConnectedAccountSettings, ConnectedAccountSettingsRequest, CouponCreateRequest, CouponUpdateRequest, CreateAuthorizedSenderRequest, CreateCheckoutPaymentIntentRequest, CreatePaymentMethodRequest, CreatePayoutRequest, CreatePortalSessionRequest, CredentialProvider, CreditNoteCreateRequest, CreditNoteLineItemRequest, CreditNoteReason, CreditNoteStatus, CustomerCreateRequest, CustomerCreditAdjustmentRequest, CustomerCreditBalance, CustomerCreditBalanceSummary, 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, InvoiceMarkPaidRequest, InvoiceNotificationPrefs, 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, ProductImageConfirmUploadFileRequest, ProductImageConfirmUploadRequest, ProductImagePresignedUploadFileRequest, ProductImagePresignedUploadFileResponse, ProductImagePresignedUploadRequest, ProductImagePresignedUploadResponse, ProductListRequest, ProductUpdateRequest, ProductVariantCreateRequest, ProductVariantUpdateRequest, PromoCodeCreateRequest, PromoCodeListRequest, PromoCodeUpdateRequest, PublicInvoiceCustomer, PublicInvoiceDiscount, PublicInvoiceEarlyPaymentDiscount, PublicInvoiceExportFormat, PublicInvoiceFee, PublicInvoiceLineItem, PublicInvoiceLineItemTax, PublicInvoiceMerchant, PublicInvoiceMerchantRating, PublicInvoiceMerchantSocial, PublicInvoiceOnlinePaymentInstructions, PublicInvoicePayment, PublicInvoicePaymentCardSnippet, PublicInvoicePaymentInstructions, PublicInvoiceResponse, PublicInvoiceTax, PublicInvoiceWireInstructions, 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, SBCoupon, SBCouponAllocationMethod, SBCouponCustomerSelection, SBCouponTargetSelection, SBCouponTargetType, SBCouponType, 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, SBInvoiceActivityEvent, 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, SBProductImageDetail, SBProductType, SBProductVariant, SBPromoCode, SBPromoCodeType, 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, TransactionFeeCreateRequest, TransactionFeeRequest, TransactionLineItemCreateRequest, TransactionLineItemRequest, TransactionMerchantAddressRequest, TransactionMerchantRequest, TransactionTaxCreateRequest, TransactionTaxRequest, TransactionUpdateRequest, UpdateInstallationStatusRequest, UpdatePayoutScheduleRequest, UpgradeSubscriptionRequest, UsageHistoryRequest, UserUpdateRequest, VendorBatchUpdateRequest, VendorConnectRequest, VendorCreateRequest, VendorListRequest, VendorMergeRequest, VendorUpdateRequest, WorkflowCreateRequest, WorkflowListRequest, WorkflowTestRequest, WorkflowUpdateRequest };