@smartbills/sdk 1.1.0-alpha.2 → 1.1.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +823 -116
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -136,36 +136,36 @@ declare enum ReceiptSource {
|
|
|
136
136
|
*/
|
|
137
137
|
declare enum BillApprovalStatus {
|
|
138
138
|
/** Approval is pending review */
|
|
139
|
-
PENDING =
|
|
139
|
+
PENDING = "PENDING",
|
|
140
140
|
/** Bill has been approved */
|
|
141
|
-
APPROVED =
|
|
141
|
+
APPROVED = "APPROVED",
|
|
142
142
|
/** Bill has been rejected */
|
|
143
|
-
REJECTED =
|
|
143
|
+
REJECTED = "REJECTED",
|
|
144
144
|
/** Approval step was skipped */
|
|
145
|
-
SKIPPED =
|
|
145
|
+
SKIPPED = "SKIPPED",
|
|
146
146
|
/** Approval is not required for this bill */
|
|
147
147
|
NOT_REQUIRED = 4,
|
|
148
148
|
/** Approval has been delegated to another user */
|
|
149
|
-
DELEGATED =
|
|
149
|
+
DELEGATED = "DELEGATED",
|
|
150
150
|
/** Bill is currently under review */
|
|
151
|
-
IN_REVIEW =
|
|
151
|
+
IN_REVIEW = "IN_REVIEW",
|
|
152
152
|
/** Changes have been requested before approval */
|
|
153
|
-
REQUESTED_CHANGES =
|
|
153
|
+
REQUESTED_CHANGES = "REQUESTED_CHANGES"
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* The type of approval required for a bill.
|
|
157
157
|
*/
|
|
158
158
|
declare enum BillApprovalType {
|
|
159
159
|
/** Approval is mandatory */
|
|
160
|
-
REQUIRED =
|
|
160
|
+
REQUIRED = "REQUIRED",
|
|
161
161
|
/** Approval is optional */
|
|
162
|
-
OPTIONAL =
|
|
162
|
+
OPTIONAL = "OPTIONAL",
|
|
163
163
|
/** Approver is notified for information only */
|
|
164
|
-
INFORMATIONAL =
|
|
164
|
+
INFORMATIONAL = "INFORMATIONAL",
|
|
165
165
|
/** Approval is required only when certain conditions are met */
|
|
166
|
-
CONDITIONAL =
|
|
166
|
+
CONDITIONAL = "CONDITIONAL",
|
|
167
167
|
/** Direct manager approval is required */
|
|
168
|
-
MANAGER =
|
|
168
|
+
MANAGER = "MANAGER"
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
171
|
* The current status of a bill in its lifecycle.
|
|
@@ -174,21 +174,21 @@ declare enum BillApprovalType {
|
|
|
174
174
|
*/
|
|
175
175
|
declare enum BillStatus {
|
|
176
176
|
/** Bill is being drafted and has not been submitted */
|
|
177
|
-
DRAFT =
|
|
177
|
+
DRAFT = "DRAFT",
|
|
178
178
|
/** Bill is awaiting approval from designated approvers */
|
|
179
|
-
PENDING_APPROVAL =
|
|
179
|
+
PENDING_APPROVAL = "PENDING_APPROVAL",
|
|
180
180
|
/** Bill has been approved and is ready for payment */
|
|
181
|
-
APPROVED =
|
|
181
|
+
APPROVED = "APPROVED",
|
|
182
182
|
/** Bill payment has been scheduled for a future date */
|
|
183
|
-
SCHEDULED =
|
|
183
|
+
SCHEDULED = "SCHEDULED",
|
|
184
184
|
/** Bill has been fully paid */
|
|
185
|
-
PAID =
|
|
185
|
+
PAID = "PAID",
|
|
186
186
|
/** Bill has been cancelled */
|
|
187
|
-
CANCELLED =
|
|
187
|
+
CANCELLED = "CANCELLED",
|
|
188
188
|
/** Bill is past the due date and unpaid */
|
|
189
|
-
OVERDUE =
|
|
189
|
+
OVERDUE = "OVERDUE",
|
|
190
190
|
/** Automated payment attempt failed */
|
|
191
|
-
PAYMENT_FAILED =
|
|
191
|
+
PAYMENT_FAILED = "PAYMENT_FAILED"
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
194
|
* The role of a user within a business organization.
|
|
@@ -197,23 +197,23 @@ declare enum BillStatus {
|
|
|
197
197
|
*/
|
|
198
198
|
declare enum MembershipRole {
|
|
199
199
|
/** Full administrative access to all business features */
|
|
200
|
-
ADMINISTRATOR =
|
|
200
|
+
ADMINISTRATOR = "ADMINISTRATOR",
|
|
201
201
|
/** Manages financial operations including billing and payments */
|
|
202
|
-
FINANCE_MANAGER =
|
|
202
|
+
FINANCE_MANAGER = "FINANCE_MANAGER",
|
|
203
203
|
/** Handles accounting operations and reconciliation */
|
|
204
|
-
ACCOUNTANT =
|
|
204
|
+
ACCOUNTANT = "ACCOUNTANT",
|
|
205
205
|
/** Manages teams and approves expense reports */
|
|
206
|
-
MANAGER =
|
|
206
|
+
MANAGER = "MANAGER",
|
|
207
207
|
/** Standard employee with expense submission capabilities */
|
|
208
|
-
EMPLOYEE =
|
|
208
|
+
EMPLOYEE = "EMPLOYEE",
|
|
209
209
|
/** Read-only access for auditing and compliance */
|
|
210
|
-
AUDITOR =
|
|
210
|
+
AUDITOR = "AUDITOR",
|
|
211
211
|
/** Designated approver for bills and expense reports */
|
|
212
|
-
APPROVER =
|
|
212
|
+
APPROVER = "APPROVER",
|
|
213
213
|
/** Basic member with limited access */
|
|
214
|
-
MEMBER =
|
|
214
|
+
MEMBER = "MEMBER",
|
|
215
215
|
/** Member of the finance team with elevated financial access */
|
|
216
|
-
FINANCE_TEAM =
|
|
216
|
+
FINANCE_TEAM = "FINANCE_TEAM"
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
219
|
* The status of an expense report in its lifecycle.
|
|
@@ -529,10 +529,10 @@ declare enum WorkflowTriggerType {
|
|
|
529
529
|
* The payer type indicating who is responsible for payment.
|
|
530
530
|
*/
|
|
531
531
|
declare enum PayerType {
|
|
532
|
-
/** Payment is personal */
|
|
533
|
-
|
|
532
|
+
/** Payment is personal (employee expense) */
|
|
533
|
+
EMPLOYEE = "EMPLOYEE",
|
|
534
534
|
/** Payment is a business expense */
|
|
535
|
-
|
|
535
|
+
COMPANY = "COMPANY"
|
|
536
536
|
}
|
|
537
537
|
|
|
538
538
|
/**
|
|
@@ -575,7 +575,7 @@ interface SBPagination {
|
|
|
575
575
|
*/
|
|
576
576
|
interface PaginationRequest {
|
|
577
577
|
page?: number;
|
|
578
|
-
|
|
578
|
+
pageSize?: number;
|
|
579
579
|
sortBy?: string;
|
|
580
580
|
sortDirection?: "asc" | "desc";
|
|
581
581
|
}
|
|
@@ -968,8 +968,11 @@ interface ExpenseReportListRequest extends PaginationRequest {
|
|
|
968
968
|
* Request payload for creating a new expense report.
|
|
969
969
|
*/
|
|
970
970
|
interface ExpenseReportCreateRequest {
|
|
971
|
-
|
|
971
|
+
title: string;
|
|
972
972
|
description?: string;
|
|
973
|
+
businessPurpose?: string;
|
|
974
|
+
startDate?: string;
|
|
975
|
+
endDate?: string;
|
|
973
976
|
}
|
|
974
977
|
/**
|
|
975
978
|
* Request payload for updating an existing expense report.
|
|
@@ -1096,6 +1099,39 @@ interface ExpenseReportPartialReimburseRequest {
|
|
|
1096
1099
|
* Response for bulk expense report operations.
|
|
1097
1100
|
*/
|
|
1098
1101
|
type SBExpenseReportBulkActionResponse = SBBulkActionResponse;
|
|
1102
|
+
interface BulkSubmitExpenseReportsRequest {
|
|
1103
|
+
reportIds: number[];
|
|
1104
|
+
}
|
|
1105
|
+
interface BulkRecallExpenseReportsRequest {
|
|
1106
|
+
reportIds: number[];
|
|
1107
|
+
reason?: string;
|
|
1108
|
+
}
|
|
1109
|
+
interface BulkApproveApprobationsRequest {
|
|
1110
|
+
reportIds: number[];
|
|
1111
|
+
notes?: string;
|
|
1112
|
+
}
|
|
1113
|
+
interface BulkRejectApprobationsRequest {
|
|
1114
|
+
reportIds: number[];
|
|
1115
|
+
reason?: string;
|
|
1116
|
+
}
|
|
1117
|
+
interface BulkRequestChangesApprobationsRequest {
|
|
1118
|
+
reportIds: number[];
|
|
1119
|
+
changes?: string;
|
|
1120
|
+
}
|
|
1121
|
+
interface BulkMarkReimbursedApprobationsRequest {
|
|
1122
|
+
reportIds: number[];
|
|
1123
|
+
notes?: string;
|
|
1124
|
+
reimbursedDate?: string;
|
|
1125
|
+
}
|
|
1126
|
+
interface BulkPlanReimbursementApprobationsRequest {
|
|
1127
|
+
reportIds: number[];
|
|
1128
|
+
plannedDate: string;
|
|
1129
|
+
notes?: string;
|
|
1130
|
+
}
|
|
1131
|
+
interface BulkRevertToReviewApprobationsRequest {
|
|
1132
|
+
reportIds: number[];
|
|
1133
|
+
reason?: string;
|
|
1134
|
+
}
|
|
1099
1135
|
|
|
1100
1136
|
/**
|
|
1101
1137
|
* Request parameters for listing approbations (items pending the current user's approval).
|
|
@@ -1181,7 +1217,10 @@ declare class ApprobationService extends BaseService {
|
|
|
1181
1217
|
* @returns The expense report
|
|
1182
1218
|
* @throws {SmartbillsNotFoundError} If the report is not found
|
|
1183
1219
|
*/
|
|
1184
|
-
getById(reportId: number,
|
|
1220
|
+
getById(reportId: number, params?: {
|
|
1221
|
+
sortBy?: string;
|
|
1222
|
+
sortOrder?: string;
|
|
1223
|
+
}, options?: RequestOptions): Promise<SBExpenseReport>;
|
|
1185
1224
|
/**
|
|
1186
1225
|
* Approves an expense report.
|
|
1187
1226
|
*
|
|
@@ -1328,9 +1367,16 @@ declare class ApprobationService extends BaseService {
|
|
|
1328
1367
|
*/
|
|
1329
1368
|
downloadAttachmentsZip(reportId: number, options?: RequestOptions): Promise<Blob>;
|
|
1330
1369
|
updateExpense(reportId: number, expenseId: number, data: unknown, options?: RequestOptions): Promise<unknown>;
|
|
1370
|
+
resetExpenseReview(reportId: number, expenseId: number, options?: RequestOptions): Promise<SBExpenseReport>;
|
|
1331
1371
|
saveExpenseReview(reportId: number, data: ExpenseReportApproveRequest & {
|
|
1332
1372
|
saveExpenseReviewOnly?: boolean;
|
|
1333
1373
|
}, options?: RequestOptions): Promise<SBExpenseReport>;
|
|
1374
|
+
bulkApprove(data: BulkApproveApprobationsRequest, options?: RequestOptions): Promise<SBExpenseReportBulkActionResponse>;
|
|
1375
|
+
bulkReject(data: BulkRejectApprobationsRequest, options?: RequestOptions): Promise<SBExpenseReportBulkActionResponse>;
|
|
1376
|
+
bulkRequestChanges(data: BulkRequestChangesApprobationsRequest, options?: RequestOptions): Promise<SBExpenseReportBulkActionResponse>;
|
|
1377
|
+
bulkMarkReimbursed(data: BulkMarkReimbursedApprobationsRequest, options?: RequestOptions): Promise<SBExpenseReportBulkActionResponse>;
|
|
1378
|
+
bulkPlanReimbursement(data: BulkPlanReimbursementApprobationsRequest, options?: RequestOptions): Promise<SBExpenseReportBulkActionResponse>;
|
|
1379
|
+
bulkRevertToReview(data: BulkRevertToReviewApprobationsRequest, options?: RequestOptions): Promise<SBExpenseReportBulkActionResponse>;
|
|
1334
1380
|
}
|
|
1335
1381
|
|
|
1336
1382
|
/** Represents the current subscription state for a business. */
|
|
@@ -1347,7 +1393,7 @@ interface SBSubscription {
|
|
|
1347
1393
|
canceledAt?: string;
|
|
1348
1394
|
}
|
|
1349
1395
|
/** Represents a billing invoice issued to the business. */
|
|
1350
|
-
interface
|
|
1396
|
+
interface SBBillingInvoice {
|
|
1351
1397
|
id: string;
|
|
1352
1398
|
number?: string;
|
|
1353
1399
|
status: string;
|
|
@@ -1370,10 +1416,10 @@ interface SBUpcomingInvoice {
|
|
|
1370
1416
|
currency: string;
|
|
1371
1417
|
periodStart?: string;
|
|
1372
1418
|
periodEnd?: string;
|
|
1373
|
-
lines?:
|
|
1419
|
+
lines?: SBBillingInvoiceLine[];
|
|
1374
1420
|
}
|
|
1375
|
-
/** A single line item on
|
|
1376
|
-
interface
|
|
1421
|
+
/** A single line item on a billing invoice. */
|
|
1422
|
+
interface SBBillingInvoiceLine {
|
|
1377
1423
|
description?: string;
|
|
1378
1424
|
amount: number;
|
|
1379
1425
|
currency: string;
|
|
@@ -1409,7 +1455,7 @@ interface SBPortalSession {
|
|
|
1409
1455
|
url: string;
|
|
1410
1456
|
}
|
|
1411
1457
|
/** Query parameters for listing billing invoices. */
|
|
1412
|
-
interface
|
|
1458
|
+
interface BillingInvoiceListRequest {
|
|
1413
1459
|
page?: number;
|
|
1414
1460
|
pageSize?: number;
|
|
1415
1461
|
}
|
|
@@ -1462,9 +1508,9 @@ declare class BillingService extends BaseService {
|
|
|
1462
1508
|
/** Validates whether the business can downgrade to a lower plan without losing features. */
|
|
1463
1509
|
validateDowngrade(data: UpgradeSubscriptionRequest, options?: RequestOptions): Promise<SBDowngradeValidation>;
|
|
1464
1510
|
/** Lists billing invoices for the business with pagination support. */
|
|
1465
|
-
listInvoices(params?:
|
|
1511
|
+
listInvoices(params?: BillingInvoiceListRequest, options?: RequestOptions): Promise<SBListResponse<SBBillingInvoice>>;
|
|
1466
1512
|
/** Retrieves a specific billing invoice by its Stripe ID. */
|
|
1467
|
-
getInvoice(invoiceId: string, options?: RequestOptions): Promise<
|
|
1513
|
+
getInvoice(invoiceId: string, options?: RequestOptions): Promise<SBBillingInvoice>;
|
|
1468
1514
|
/** Retrieves the upcoming invoice preview based on the current subscription. */
|
|
1469
1515
|
getUpcomingInvoice(options?: RequestOptions): Promise<SBUpcomingInvoice>;
|
|
1470
1516
|
/** Retrieves current usage across all quota keys for the business. */
|
|
@@ -1830,6 +1876,7 @@ interface PaginateTransactionRequest extends PaginationRequest {
|
|
|
1830
1876
|
maxAmount?: number;
|
|
1831
1877
|
hasAttachment?: boolean;
|
|
1832
1878
|
employeeId?: number;
|
|
1879
|
+
payerType?: PayerType;
|
|
1833
1880
|
}
|
|
1834
1881
|
/**
|
|
1835
1882
|
* Request payload for updating an existing transaction.
|
|
@@ -1842,6 +1889,7 @@ interface TransactionUpdateRequest {
|
|
|
1842
1889
|
categoryId?: number;
|
|
1843
1890
|
note?: string;
|
|
1844
1891
|
vendorId?: number;
|
|
1892
|
+
payerType?: PayerType;
|
|
1845
1893
|
}
|
|
1846
1894
|
/**
|
|
1847
1895
|
* Request payload for batch-updating multiple transactions.
|
|
@@ -1853,6 +1901,18 @@ interface TransactionBatchUpdateRequest {
|
|
|
1853
1901
|
total?: number;
|
|
1854
1902
|
categoryId?: number;
|
|
1855
1903
|
vendorId?: number;
|
|
1904
|
+
payerType?: PayerType;
|
|
1905
|
+
}
|
|
1906
|
+
interface TransactionCreateRequest {
|
|
1907
|
+
title?: string;
|
|
1908
|
+
date?: string;
|
|
1909
|
+
total?: number;
|
|
1910
|
+
currency?: string;
|
|
1911
|
+
categoryId?: number;
|
|
1912
|
+
note?: string;
|
|
1913
|
+
vendorId?: number;
|
|
1914
|
+
payerType?: PayerType;
|
|
1915
|
+
expenseReportId?: number;
|
|
1856
1916
|
}
|
|
1857
1917
|
|
|
1858
1918
|
/**
|
|
@@ -2154,6 +2214,7 @@ interface SBBusiness extends SBEntity, SBTimestamps {
|
|
|
2154
2214
|
name: string;
|
|
2155
2215
|
legalName?: string;
|
|
2156
2216
|
description?: string;
|
|
2217
|
+
slug?: string;
|
|
2157
2218
|
logo?: string;
|
|
2158
2219
|
website?: string;
|
|
2159
2220
|
email?: string;
|
|
@@ -2174,10 +2235,20 @@ interface SBBusiness extends SBEntity, SBTimestamps {
|
|
|
2174
2235
|
* Controls the visual identity used on customer-facing documents and portals.
|
|
2175
2236
|
*/
|
|
2176
2237
|
interface SBBusinessBrand {
|
|
2238
|
+
id?: number;
|
|
2177
2239
|
logo?: string;
|
|
2240
|
+
icon?: string;
|
|
2241
|
+
coverImage?: string;
|
|
2178
2242
|
primaryColor?: string;
|
|
2179
2243
|
secondaryColor?: string;
|
|
2180
|
-
|
|
2244
|
+
facebook?: string;
|
|
2245
|
+
instagram?: string;
|
|
2246
|
+
linkedIn?: string;
|
|
2247
|
+
twitter?: string;
|
|
2248
|
+
youTube?: string;
|
|
2249
|
+
tikTok?: string;
|
|
2250
|
+
googleAnalyticsId?: string;
|
|
2251
|
+
gtmId?: string;
|
|
2181
2252
|
}
|
|
2182
2253
|
/**
|
|
2183
2254
|
* The subscription plan associated with a business.
|
|
@@ -2203,6 +2274,8 @@ interface BusinessCreateRequest {
|
|
|
2203
2274
|
timezone?: string;
|
|
2204
2275
|
taxNumber?: string;
|
|
2205
2276
|
registrationNumber?: string;
|
|
2277
|
+
plan?: string;
|
|
2278
|
+
billingInterval?: "month" | "year";
|
|
2206
2279
|
}
|
|
2207
2280
|
/**
|
|
2208
2281
|
* Request payload for updating an existing business.
|
|
@@ -2232,6 +2305,18 @@ interface BusinessBrandCreateRequest {
|
|
|
2232
2305
|
secondaryColor?: string;
|
|
2233
2306
|
coverImage?: File | Blob;
|
|
2234
2307
|
}
|
|
2308
|
+
interface BusinessBrandUpdateRequest {
|
|
2309
|
+
primaryColor?: string;
|
|
2310
|
+
secondaryColor?: string;
|
|
2311
|
+
facebook?: string;
|
|
2312
|
+
instagram?: string;
|
|
2313
|
+
linkedIn?: string;
|
|
2314
|
+
twitter?: string;
|
|
2315
|
+
youTube?: string;
|
|
2316
|
+
tikTok?: string;
|
|
2317
|
+
googleAnalyticsId?: string;
|
|
2318
|
+
gtmId?: string;
|
|
2319
|
+
}
|
|
2235
2320
|
/**
|
|
2236
2321
|
* Request payload for batch-updating multiple businesses.
|
|
2237
2322
|
*/
|
|
@@ -2352,6 +2437,12 @@ declare class BusinessService extends BaseService {
|
|
|
2352
2437
|
* ```
|
|
2353
2438
|
*/
|
|
2354
2439
|
createBrand(businessId: number, data: BusinessBrandCreateRequest, options?: RequestOptions): Promise<unknown>;
|
|
2440
|
+
uploadLogo(businessId: number, file: File | Blob, options?: RequestOptions): Promise<SBBusiness>;
|
|
2441
|
+
getBrand(businessId: number, options?: RequestOptions): Promise<SBBusinessBrand>;
|
|
2442
|
+
updateBrand(businessId: number, data: BusinessBrandUpdateRequest, options?: RequestOptions): Promise<SBBusinessBrand>;
|
|
2443
|
+
uploadBrandLogo(businessId: number, file: File | Blob, options?: RequestOptions): Promise<SBBusinessBrand>;
|
|
2444
|
+
uploadBrandIcon(businessId: number, file: File | Blob, options?: RequestOptions): Promise<SBBusinessBrand>;
|
|
2445
|
+
uploadBrandCover(businessId: number, file: File | Blob, options?: RequestOptions): Promise<SBBusinessBrand>;
|
|
2355
2446
|
/**
|
|
2356
2447
|
* Creates multiple businesses in a single batch operation.
|
|
2357
2448
|
*
|
|
@@ -2414,18 +2505,39 @@ interface InvitationListRequest extends PaginationRequest {
|
|
|
2414
2505
|
* Memberships define the relationship between a user and a business,
|
|
2415
2506
|
* including their role and permissions within the organization.
|
|
2416
2507
|
*/
|
|
2508
|
+
interface SBMembershipUserSummary {
|
|
2509
|
+
id: number;
|
|
2510
|
+
firstName?: string;
|
|
2511
|
+
lastName?: string;
|
|
2512
|
+
email?: string;
|
|
2513
|
+
fullName?: string;
|
|
2514
|
+
avatar?: string;
|
|
2515
|
+
}
|
|
2516
|
+
interface SBMembershipBusinessSummary {
|
|
2517
|
+
id: number;
|
|
2518
|
+
name?: string;
|
|
2519
|
+
slug?: string;
|
|
2520
|
+
currency?: string;
|
|
2521
|
+
logo?: string;
|
|
2522
|
+
timezone?: string;
|
|
2523
|
+
apEmail?: string;
|
|
2524
|
+
receiptEmail?: string;
|
|
2525
|
+
reimbursementEmail?: string;
|
|
2526
|
+
}
|
|
2417
2527
|
interface SBMembership extends SBEntity, SBTimestamps {
|
|
2418
|
-
userId
|
|
2419
|
-
userName?: string;
|
|
2420
|
-
userEmail?: string;
|
|
2421
|
-
userAvatar?: string;
|
|
2528
|
+
userId?: number;
|
|
2422
2529
|
businessId: number;
|
|
2423
|
-
businessName?: string;
|
|
2424
|
-
businessLogo?: string;
|
|
2425
|
-
role: MembershipRole;
|
|
2426
|
-
isActive: boolean;
|
|
2427
|
-
joinedAt?: string;
|
|
2428
2530
|
employeeId?: number;
|
|
2531
|
+
firstName?: string;
|
|
2532
|
+
lastName?: string;
|
|
2533
|
+
email?: string;
|
|
2534
|
+
phoneNumber?: string;
|
|
2535
|
+
avatar?: string;
|
|
2536
|
+
birthdate?: string;
|
|
2537
|
+
role: MembershipRole;
|
|
2538
|
+
status: number;
|
|
2539
|
+
user?: SBMembershipUserSummary;
|
|
2540
|
+
business?: SBMembershipBusinessSummary;
|
|
2429
2541
|
}
|
|
2430
2542
|
/**
|
|
2431
2543
|
* Request payload for updating a membership's role.
|
|
@@ -3107,6 +3219,7 @@ declare class EmailAccountService extends BaseService {
|
|
|
3107
3219
|
interface SBExpenseJob extends SBEntity, SBTimestamps {
|
|
3108
3220
|
fileName?: string;
|
|
3109
3221
|
status: string;
|
|
3222
|
+
jobStatus?: number | string;
|
|
3110
3223
|
progress?: number;
|
|
3111
3224
|
totalItems?: number;
|
|
3112
3225
|
processedItems?: number;
|
|
@@ -3115,12 +3228,22 @@ interface SBExpenseJob extends SBEntity, SBTimestamps {
|
|
|
3115
3228
|
employeeId?: number;
|
|
3116
3229
|
error?: string;
|
|
3117
3230
|
completedAt?: string;
|
|
3231
|
+
expenseReportId?: number;
|
|
3232
|
+
categoryId?: number;
|
|
3233
|
+
transactionId?: number;
|
|
3234
|
+
note?: string;
|
|
3235
|
+
attachment?: {
|
|
3236
|
+
id?: number;
|
|
3237
|
+
fileName?: string;
|
|
3238
|
+
url?: string;
|
|
3239
|
+
cdnUrl?: string;
|
|
3240
|
+
};
|
|
3118
3241
|
}
|
|
3119
3242
|
/**
|
|
3120
3243
|
* Request parameters for listing expense jobs with optional status filter.
|
|
3121
3244
|
*/
|
|
3122
3245
|
interface ExpenseJobListRequest extends PaginationRequest {
|
|
3123
|
-
status?: string;
|
|
3246
|
+
status?: string | string[];
|
|
3124
3247
|
}
|
|
3125
3248
|
|
|
3126
3249
|
/**
|
|
@@ -3189,6 +3312,7 @@ declare class ExpenseJobService extends BaseService {
|
|
|
3189
3312
|
* @throws {SmartbillsNotFoundError} If the employee or job is not found
|
|
3190
3313
|
*/
|
|
3191
3314
|
retryEmployeeJob(employeeId: number, jobId: number, options?: RequestOptions): Promise<void>;
|
|
3315
|
+
listByExpenseReport(reportId: number, params?: ExpenseJobListRequest, options?: RequestOptions): Promise<SBListResponse<SBExpenseJob>>;
|
|
3192
3316
|
}
|
|
3193
3317
|
|
|
3194
3318
|
/**
|
|
@@ -3374,7 +3498,10 @@ declare class ExpenseReportService extends BaseService {
|
|
|
3374
3498
|
*/
|
|
3375
3499
|
list(params?: ExpenseReportListRequest, options?: RequestOptions): Promise<SBListResponse<SBExpenseReport>>;
|
|
3376
3500
|
listForEmployee(employeeId: number, params?: ExpenseReportListRequest, options?: RequestOptions): Promise<SBListResponse<SBExpenseReport>>;
|
|
3377
|
-
getByIdForEmployee(employeeId: number, reportId: number,
|
|
3501
|
+
getByIdForEmployee(employeeId: number, reportId: number, params?: {
|
|
3502
|
+
sortBy?: string;
|
|
3503
|
+
sortOrder?: string;
|
|
3504
|
+
}, options?: RequestOptions): Promise<SBExpenseReport>;
|
|
3378
3505
|
/**
|
|
3379
3506
|
* Retrieves a single expense report by ID.
|
|
3380
3507
|
*
|
|
@@ -3388,7 +3515,10 @@ declare class ExpenseReportService extends BaseService {
|
|
|
3388
3515
|
* const report = await client.expenseReports.getById(123);
|
|
3389
3516
|
* ```
|
|
3390
3517
|
*/
|
|
3391
|
-
getById(reportId: number,
|
|
3518
|
+
getById(reportId: number, params?: {
|
|
3519
|
+
sortBy?: string;
|
|
3520
|
+
sortOrder?: string;
|
|
3521
|
+
}, options?: RequestOptions): Promise<SBExpenseReport>;
|
|
3392
3522
|
/**
|
|
3393
3523
|
* Lists expense reports belonging to the current user.
|
|
3394
3524
|
*
|
|
@@ -3584,6 +3714,8 @@ declare class ExpenseReportService extends BaseService {
|
|
|
3584
3714
|
* @param options - Request options including businessId, locale, and abort signal
|
|
3585
3715
|
* @returns Blob containing the exported file
|
|
3586
3716
|
*/
|
|
3717
|
+
bulkSubmit(data: BulkSubmitExpenseReportsRequest, options?: RequestOptions): Promise<SBExpenseReportBulkActionResponse>;
|
|
3718
|
+
bulkRecall(data: BulkRecallExpenseReportsRequest, options?: RequestOptions): Promise<SBExpenseReportBulkActionResponse>;
|
|
3587
3719
|
export(data: ExpenseReportExportRequest, options?: RequestOptions): Promise<Blob>;
|
|
3588
3720
|
}
|
|
3589
3721
|
|
|
@@ -3632,6 +3764,10 @@ interface BulkAssignVendorRequest {
|
|
|
3632
3764
|
interface BulkDeleteExpensesRequest {
|
|
3633
3765
|
expenseIds: number[];
|
|
3634
3766
|
}
|
|
3767
|
+
interface BulkAssignPayerTypeRequest {
|
|
3768
|
+
expenseIds: number[];
|
|
3769
|
+
payerType: PayerType;
|
|
3770
|
+
}
|
|
3635
3771
|
interface BulkSetNoteRequest {
|
|
3636
3772
|
expenseIds: number[];
|
|
3637
3773
|
note: string | null;
|
|
@@ -3649,7 +3785,7 @@ interface ExpenseExportRequest {
|
|
|
3649
3785
|
categoryId?: number;
|
|
3650
3786
|
vendorId?: number;
|
|
3651
3787
|
expenseReportId?: number;
|
|
3652
|
-
format?: "
|
|
3788
|
+
format?: "CSV" | "EXCEL";
|
|
3653
3789
|
locale?: string;
|
|
3654
3790
|
}
|
|
3655
3791
|
/**
|
|
@@ -3663,11 +3799,15 @@ interface ExpenseAttachmentDownloadRequest {
|
|
|
3663
3799
|
* Request parameters for listing expenses with filters and pagination.
|
|
3664
3800
|
*/
|
|
3665
3801
|
interface ExpenseListRequest extends PaginationRequest {
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3802
|
+
searchTerm?: string;
|
|
3803
|
+
fromDate?: string;
|
|
3804
|
+
toDate?: string;
|
|
3669
3805
|
categoryId?: number;
|
|
3806
|
+
categoryIds?: number[];
|
|
3670
3807
|
vendorId?: number;
|
|
3808
|
+
vendorIds?: string;
|
|
3809
|
+
currencies?: string;
|
|
3810
|
+
submittedByEmployeeId?: number;
|
|
3671
3811
|
expenseReportId?: number;
|
|
3672
3812
|
minAmount?: number;
|
|
3673
3813
|
maxAmount?: number;
|
|
@@ -3710,6 +3850,51 @@ interface SBExpenseValidateResponse {
|
|
|
3710
3850
|
* Response for bulk expense operations.
|
|
3711
3851
|
*/
|
|
3712
3852
|
type SBExpenseBulkActionResponse = SBBulkActionResponse;
|
|
3853
|
+
interface PresignedUploadFileRequest {
|
|
3854
|
+
fileName: string;
|
|
3855
|
+
contentType: string;
|
|
3856
|
+
fileSize: number;
|
|
3857
|
+
note?: string;
|
|
3858
|
+
categoryId?: number;
|
|
3859
|
+
expenseReportId?: number;
|
|
3860
|
+
}
|
|
3861
|
+
interface PresignedUploadRequest {
|
|
3862
|
+
files: PresignedUploadFileRequest[];
|
|
3863
|
+
vendorId?: number;
|
|
3864
|
+
expenseReportId?: number;
|
|
3865
|
+
categoryId?: number;
|
|
3866
|
+
note?: string;
|
|
3867
|
+
type?: string;
|
|
3868
|
+
payerType?: string;
|
|
3869
|
+
}
|
|
3870
|
+
interface PresignedUploadFileResponse {
|
|
3871
|
+
fileName: string;
|
|
3872
|
+
s3Key: string;
|
|
3873
|
+
uploadUrl: string;
|
|
3874
|
+
contentType: string;
|
|
3875
|
+
}
|
|
3876
|
+
interface PresignedUploadResponse {
|
|
3877
|
+
uploadSessionId: string;
|
|
3878
|
+
files: PresignedUploadFileResponse[];
|
|
3879
|
+
}
|
|
3880
|
+
interface ConfirmUploadFileRequest {
|
|
3881
|
+
s3Key: string;
|
|
3882
|
+
fileName: string;
|
|
3883
|
+
contentType: string;
|
|
3884
|
+
note?: string;
|
|
3885
|
+
categoryId?: number;
|
|
3886
|
+
expenseReportId?: number;
|
|
3887
|
+
}
|
|
3888
|
+
interface ConfirmUploadRequest {
|
|
3889
|
+
uploadSessionId: string;
|
|
3890
|
+
files: ConfirmUploadFileRequest[];
|
|
3891
|
+
vendorId?: number;
|
|
3892
|
+
expenseReportId?: number;
|
|
3893
|
+
categoryId?: number;
|
|
3894
|
+
note?: string;
|
|
3895
|
+
type?: string;
|
|
3896
|
+
payerType?: string;
|
|
3897
|
+
}
|
|
3713
3898
|
|
|
3714
3899
|
/**
|
|
3715
3900
|
* Service for managing expenses (receipts and transactions) within a business.
|
|
@@ -3770,6 +3955,7 @@ declare class ExpenseService extends BaseService {
|
|
|
3770
3955
|
* @throws {SmartbillsNotFoundError} If the expense is not found
|
|
3771
3956
|
* @throws {SmartbillsValidationError} If the provided data fails validation
|
|
3772
3957
|
*/
|
|
3958
|
+
createForEmployee(employeeId: number, data: TransactionCreateRequest, options?: RequestOptions): Promise<SBTransaction>;
|
|
3773
3959
|
update(expenseId: number, data: TransactionUpdateRequest, options?: RequestOptions): Promise<SBTransaction>;
|
|
3774
3960
|
/**
|
|
3775
3961
|
* Deletes an expense.
|
|
@@ -3887,6 +4073,7 @@ declare class ExpenseService extends BaseService {
|
|
|
3887
4073
|
* @returns Bulk action response with success and failure counts
|
|
3888
4074
|
*/
|
|
3889
4075
|
bulkAssignCategory(data: BulkAssignCategoryRequest, options?: RequestOptions): Promise<SBExpenseBulkActionResponse>;
|
|
4076
|
+
bulkAssignPayerType(data: BulkAssignPayerTypeRequest, options?: RequestOptions): Promise<SBExpenseBulkActionResponse>;
|
|
3890
4077
|
/**
|
|
3891
4078
|
* Bulk assigns multiple expenses to an expense report.
|
|
3892
4079
|
*
|
|
@@ -3961,6 +4148,10 @@ declare class ExpenseService extends BaseService {
|
|
|
3961
4148
|
* @returns Array of updated expense transactions
|
|
3962
4149
|
*/
|
|
3963
4150
|
batchUpdate(data: unknown[], options?: RequestOptions): Promise<SBTransaction[]>;
|
|
4151
|
+
presignUpload(request: PresignedUploadRequest, options?: RequestOptions): Promise<PresignedUploadResponse>;
|
|
4152
|
+
confirmUpload(request: ConfirmUploadRequest, options?: RequestOptions): Promise<unknown>;
|
|
4153
|
+
presignEmployeeUpload(employeeId: number, request: PresignedUploadRequest, options?: RequestOptions): Promise<PresignedUploadResponse>;
|
|
4154
|
+
confirmEmployeeUpload(employeeId: number, request: ConfirmUploadRequest, options?: RequestOptions): Promise<unknown>;
|
|
3964
4155
|
}
|
|
3965
4156
|
|
|
3966
4157
|
/**
|
|
@@ -5697,6 +5888,8 @@ declare class VendorService extends BaseService {
|
|
|
5697
5888
|
* @returns Blob containing the CSV template
|
|
5698
5889
|
*/
|
|
5699
5890
|
downloadImportTemplate(options?: RequestOptions): Promise<Blob>;
|
|
5891
|
+
uploadLogo(vendorId: number, file: File | Blob, options?: RequestOptions): Promise<SBVendor>;
|
|
5892
|
+
uploadBusinessLogo(vendorId: number, file: File | Blob, options?: RequestOptions): Promise<SBVendor>;
|
|
5700
5893
|
}
|
|
5701
5894
|
|
|
5702
5895
|
/**
|
|
@@ -6032,80 +6225,108 @@ declare class DepartmentService extends BaseService {
|
|
|
6032
6225
|
delete(id: number, options?: RequestOptions): Promise<void>;
|
|
6033
6226
|
}
|
|
6034
6227
|
|
|
6035
|
-
/** Represents a product or service offered by the business. */
|
|
6036
6228
|
interface SBProduct extends SBEntity, SBTimestamps {
|
|
6037
6229
|
name: string;
|
|
6038
6230
|
description?: string;
|
|
6039
6231
|
price?: number;
|
|
6232
|
+
compareAtPrice?: number;
|
|
6233
|
+
cost?: number;
|
|
6040
6234
|
sku?: string;
|
|
6235
|
+
barcode?: string;
|
|
6236
|
+
image?: string;
|
|
6237
|
+
images?: SBProductImage[];
|
|
6238
|
+
category?: string;
|
|
6239
|
+
isActive?: boolean;
|
|
6240
|
+
taxable?: boolean;
|
|
6241
|
+
taxCode?: string;
|
|
6242
|
+
trackInventory?: boolean;
|
|
6243
|
+
stockQuantity?: number;
|
|
6244
|
+
lowStockThreshold?: number;
|
|
6245
|
+
weight?: number;
|
|
6246
|
+
weightUnit?: string;
|
|
6247
|
+
currency?: string;
|
|
6248
|
+
status?: string;
|
|
6249
|
+
active?: boolean;
|
|
6250
|
+
}
|
|
6251
|
+
interface SBProductImage {
|
|
6252
|
+
id?: number;
|
|
6253
|
+
src: string;
|
|
6254
|
+
position?: number;
|
|
6041
6255
|
}
|
|
6042
|
-
/** Query parameters for listing products with optional search. */
|
|
6043
6256
|
interface ProductListRequest extends PaginationRequest {
|
|
6044
6257
|
search?: string;
|
|
6045
6258
|
}
|
|
6259
|
+
interface ProductCreateRequest {
|
|
6260
|
+
name: string;
|
|
6261
|
+
description?: string;
|
|
6262
|
+
price?: number;
|
|
6263
|
+
compareAtPrice?: number;
|
|
6264
|
+
cost?: number;
|
|
6265
|
+
sku?: string;
|
|
6266
|
+
barcode?: string;
|
|
6267
|
+
category?: string;
|
|
6268
|
+
taxable?: boolean;
|
|
6269
|
+
taxCode?: string;
|
|
6270
|
+
trackInventory?: boolean;
|
|
6271
|
+
stockQuantity?: number;
|
|
6272
|
+
}
|
|
6273
|
+
interface ProductUpdateRequest {
|
|
6274
|
+
name?: string;
|
|
6275
|
+
description?: string;
|
|
6276
|
+
price?: number;
|
|
6277
|
+
compareAtPrice?: number;
|
|
6278
|
+
cost?: number;
|
|
6279
|
+
sku?: string;
|
|
6280
|
+
barcode?: string;
|
|
6281
|
+
category?: string;
|
|
6282
|
+
taxable?: boolean;
|
|
6283
|
+
taxCode?: string;
|
|
6284
|
+
trackInventory?: boolean;
|
|
6285
|
+
stockQuantity?: number;
|
|
6286
|
+
}
|
|
6046
6287
|
|
|
6047
|
-
/**
|
|
6048
|
-
* Service for managing products within a business.
|
|
6049
|
-
*
|
|
6050
|
-
* Products represent the goods or services sold by the business
|
|
6051
|
-
* and appear on receipts and invoices.
|
|
6052
|
-
*/
|
|
6053
6288
|
declare class ProductService extends BaseService {
|
|
6054
|
-
/**
|
|
6055
|
-
* Retrieves a paginated list of products.
|
|
6056
|
-
*
|
|
6057
|
-
* @param params - Optional filters, search, and pagination parameters
|
|
6058
|
-
* @param options - Request options including business context and abort signal
|
|
6059
|
-
* @returns A paginated list of products
|
|
6060
|
-
*/
|
|
6061
6289
|
list(params?: ProductListRequest, options?: RequestOptions): Promise<SBListResponse<SBProduct>>;
|
|
6062
|
-
/**
|
|
6063
|
-
* Retrieves a single product by ID.
|
|
6064
|
-
*
|
|
6065
|
-
* @param id - The product ID
|
|
6066
|
-
* @param options - Request options including business context and abort signal
|
|
6067
|
-
* @returns The product
|
|
6068
|
-
* @throws {SmartbillsNotFoundError} If the product is not found
|
|
6069
|
-
*/
|
|
6070
6290
|
getById(id: number, options?: RequestOptions): Promise<SBProduct>;
|
|
6291
|
+
create(data: ProductCreateRequest, options?: RequestOptions): Promise<SBProduct>;
|
|
6292
|
+
update(id: number, data: ProductUpdateRequest, options?: RequestOptions): Promise<SBProduct>;
|
|
6293
|
+
delete(id: number, options?: RequestOptions): Promise<void>;
|
|
6071
6294
|
}
|
|
6072
6295
|
|
|
6073
|
-
/** Represents a tax rate configured for a business. */
|
|
6074
6296
|
interface SBTax extends SBEntity, SBTimestamps {
|
|
6075
6297
|
name: string;
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6298
|
+
percentage: number;
|
|
6299
|
+
description?: string;
|
|
6300
|
+
country?: string;
|
|
6301
|
+
state?: string;
|
|
6302
|
+
jurisdiction?: string;
|
|
6303
|
+
type?: string;
|
|
6304
|
+
inclusive?: boolean;
|
|
6305
|
+
isActive?: boolean;
|
|
6306
|
+
taxIdentificationNumber?: string;
|
|
6079
6307
|
}
|
|
6080
|
-
/** Query parameters for listing tax rates with optional search. */
|
|
6081
6308
|
interface TaxListRequest extends PaginationRequest {
|
|
6082
6309
|
search?: string;
|
|
6083
6310
|
}
|
|
6311
|
+
interface TaxCreateRequest {
|
|
6312
|
+
name: string;
|
|
6313
|
+
percentage: number;
|
|
6314
|
+
description?: string;
|
|
6315
|
+
country?: string;
|
|
6316
|
+
state?: string;
|
|
6317
|
+
jurisdiction?: string;
|
|
6318
|
+
type?: string;
|
|
6319
|
+
inclusive?: boolean;
|
|
6320
|
+
taxIdentificationNumber?: string;
|
|
6321
|
+
}
|
|
6322
|
+
type TaxUpdateRequest = Partial<TaxCreateRequest>;
|
|
6084
6323
|
|
|
6085
|
-
/**
|
|
6086
|
-
* Service for managing tax configurations within a business.
|
|
6087
|
-
*
|
|
6088
|
-
* Taxes define the tax rates applied to receipts, invoices, and
|
|
6089
|
-
* expense items (e.g., GST, HST, PST, VAT).
|
|
6090
|
-
*/
|
|
6091
6324
|
declare class TaxService extends BaseService {
|
|
6092
|
-
/**
|
|
6093
|
-
* Retrieves a paginated list of tax configurations.
|
|
6094
|
-
*
|
|
6095
|
-
* @param params - Optional filters and pagination parameters
|
|
6096
|
-
* @param options - Request options including business context and abort signal
|
|
6097
|
-
* @returns A paginated list of tax configurations
|
|
6098
|
-
*/
|
|
6099
6325
|
list(params?: TaxListRequest, options?: RequestOptions): Promise<SBListResponse<SBTax>>;
|
|
6100
|
-
/**
|
|
6101
|
-
* Retrieves a single tax configuration by ID.
|
|
6102
|
-
*
|
|
6103
|
-
* @param id - The tax ID
|
|
6104
|
-
* @param options - Request options including business context and abort signal
|
|
6105
|
-
* @returns The tax configuration
|
|
6106
|
-
* @throws {SmartbillsNotFoundError} If the tax is not found
|
|
6107
|
-
*/
|
|
6108
6326
|
getById(id: number, options?: RequestOptions): Promise<SBTax>;
|
|
6327
|
+
create(data: TaxCreateRequest, options?: RequestOptions): Promise<SBTax>;
|
|
6328
|
+
update(id: number, data: TaxUpdateRequest, options?: RequestOptions): Promise<SBTax>;
|
|
6329
|
+
delete(id: number, options?: RequestOptions): Promise<void>;
|
|
6109
6330
|
}
|
|
6110
6331
|
|
|
6111
6332
|
/** Represents a promotional code that can be applied to receipts or transactions. */
|
|
@@ -6134,7 +6355,10 @@ declare class PromoCodeService extends BaseService {
|
|
|
6134
6355
|
getById(id: number, options?: RequestOptions): Promise<SBPromoCode>;
|
|
6135
6356
|
}
|
|
6136
6357
|
|
|
6137
|
-
|
|
6358
|
+
interface CategoryListRequest extends PaginationRequest {
|
|
6359
|
+
search?: string;
|
|
6360
|
+
isVisible?: boolean;
|
|
6361
|
+
}
|
|
6138
6362
|
interface SBCategory extends SBEntity, SBTimestamps {
|
|
6139
6363
|
name: string;
|
|
6140
6364
|
code?: string;
|
|
@@ -6142,13 +6366,11 @@ interface SBCategory extends SBEntity, SBTimestamps {
|
|
|
6142
6366
|
businessId?: number;
|
|
6143
6367
|
userId?: number;
|
|
6144
6368
|
}
|
|
6145
|
-
/** Payload for creating a new expense category. */
|
|
6146
6369
|
interface CategoryCreateRequest {
|
|
6147
6370
|
name: string;
|
|
6148
6371
|
code?: string;
|
|
6149
6372
|
isVisible?: boolean;
|
|
6150
6373
|
}
|
|
6151
|
-
/** Payload for updating an existing expense category. */
|
|
6152
6374
|
interface CategoryUpdateRequest {
|
|
6153
6375
|
name?: string;
|
|
6154
6376
|
code?: string;
|
|
@@ -6163,12 +6385,13 @@ interface CategoryUpdateRequest {
|
|
|
6163
6385
|
*/
|
|
6164
6386
|
declare class CategoryService extends BaseService {
|
|
6165
6387
|
/**
|
|
6166
|
-
* Retrieves
|
|
6388
|
+
* Retrieves a paginated list of expense categories for the business.
|
|
6167
6389
|
*
|
|
6390
|
+
* @param params - Optional filters and pagination parameters
|
|
6168
6391
|
* @param options - Request options including business context and abort signal
|
|
6169
|
-
* @returns
|
|
6392
|
+
* @returns A paginated list of expense categories
|
|
6170
6393
|
*/
|
|
6171
|
-
list(options?: RequestOptions): Promise<SBCategory
|
|
6394
|
+
list(params?: CategoryListRequest, options?: RequestOptions): Promise<SBListResponse<SBCategory>>;
|
|
6172
6395
|
/**
|
|
6173
6396
|
* Retrieves a single expense category by ID.
|
|
6174
6397
|
*
|
|
@@ -6509,6 +6732,23 @@ declare class EmailForwardingService extends BaseService {
|
|
|
6509
6732
|
disableUser(userId: number, options?: RequestOptions): Promise<SBEmailForwardingConfig>;
|
|
6510
6733
|
}
|
|
6511
6734
|
|
|
6735
|
+
interface SBAuthorizedSender {
|
|
6736
|
+
id: number;
|
|
6737
|
+
userId: number;
|
|
6738
|
+
businessId: number | null;
|
|
6739
|
+
emailAddress: string;
|
|
6740
|
+
createdAt: string;
|
|
6741
|
+
}
|
|
6742
|
+
interface CreateAuthorizedSenderRequest {
|
|
6743
|
+
emailAddress: string;
|
|
6744
|
+
}
|
|
6745
|
+
|
|
6746
|
+
declare class AuthorizedSenderService extends BaseService {
|
|
6747
|
+
list(businessId: number, options?: RequestOptions): Promise<SBAuthorizedSender[]>;
|
|
6748
|
+
create(businessId: number, data: CreateAuthorizedSenderRequest, options?: RequestOptions): Promise<SBAuthorizedSender>;
|
|
6749
|
+
delete(businessId: number, id: number, options?: RequestOptions): Promise<void>;
|
|
6750
|
+
}
|
|
6751
|
+
|
|
6512
6752
|
/** The type of rule that determines how loyalty points are accrued. */
|
|
6513
6753
|
type LoyaltyRuleType = "visit" | "spend" | "item_variation" | "category";
|
|
6514
6754
|
/** Base shape shared by all loyalty accrual rules. */
|
|
@@ -6636,6 +6876,466 @@ declare class LoyaltyService extends BaseService {
|
|
|
6636
6876
|
delete(id: string, options?: RequestOptions): Promise<void>;
|
|
6637
6877
|
}
|
|
6638
6878
|
|
|
6879
|
+
declare enum InvoiceStatus {
|
|
6880
|
+
DRAFT = "Draft",
|
|
6881
|
+
SENT = "Sent",
|
|
6882
|
+
VIEWED = "Viewed",
|
|
6883
|
+
PARTIALLY_PAID = "PartiallyPaid",
|
|
6884
|
+
PAID = "Paid",
|
|
6885
|
+
MARKED_PAID = "MarkedPaid",
|
|
6886
|
+
OVERDUE = "Overdue",
|
|
6887
|
+
CANCELLED = "Cancelled",
|
|
6888
|
+
VOID = "Void"
|
|
6889
|
+
}
|
|
6890
|
+
interface SBInvoiceCustomer {
|
|
6891
|
+
id?: number;
|
|
6892
|
+
firstName?: string;
|
|
6893
|
+
lastName?: string;
|
|
6894
|
+
email?: string;
|
|
6895
|
+
phoneNumber?: string;
|
|
6896
|
+
company?: string;
|
|
6897
|
+
}
|
|
6898
|
+
interface SBInvoiceLineItemTax {
|
|
6899
|
+
id?: number;
|
|
6900
|
+
name?: string;
|
|
6901
|
+
rate?: number;
|
|
6902
|
+
amount?: SBMoney;
|
|
6903
|
+
taxId?: number;
|
|
6904
|
+
}
|
|
6905
|
+
interface SBInvoiceLineItem {
|
|
6906
|
+
id?: number;
|
|
6907
|
+
description?: string;
|
|
6908
|
+
quantity?: number;
|
|
6909
|
+
unitPrice?: number;
|
|
6910
|
+
price?: SBMoney;
|
|
6911
|
+
subTotal?: SBMoney;
|
|
6912
|
+
total?: SBMoney;
|
|
6913
|
+
amount?: number;
|
|
6914
|
+
productId?: number;
|
|
6915
|
+
product?: {
|
|
6916
|
+
id?: number;
|
|
6917
|
+
name?: string;
|
|
6918
|
+
sku?: string;
|
|
6919
|
+
};
|
|
6920
|
+
taxable?: boolean;
|
|
6921
|
+
taxIds?: number[];
|
|
6922
|
+
taxes?: SBInvoiceLineItemTax[];
|
|
6923
|
+
}
|
|
6924
|
+
interface SBInvoice extends SBEntity, SBTimestamps {
|
|
6925
|
+
invoiceNumber?: string;
|
|
6926
|
+
billStatus?: string;
|
|
6927
|
+
dueDate?: string;
|
|
6928
|
+
date?: string;
|
|
6929
|
+
billingPeriodStartDate?: string;
|
|
6930
|
+
billingPeriodEndDate?: string;
|
|
6931
|
+
autoPaymentDate?: string;
|
|
6932
|
+
amountDue?: SBMoney;
|
|
6933
|
+
balanceForward?: SBMoney;
|
|
6934
|
+
isOverdue?: boolean;
|
|
6935
|
+
isPaid?: boolean;
|
|
6936
|
+
paymentLinkToken?: string;
|
|
6937
|
+
paymentLinkUrl?: string;
|
|
6938
|
+
stripePaymentIntentId?: string;
|
|
6939
|
+
sentAt?: string;
|
|
6940
|
+
viewedAt?: string;
|
|
6941
|
+
voidedAt?: string;
|
|
6942
|
+
paidOn?: string;
|
|
6943
|
+
customerId?: number;
|
|
6944
|
+
vendorId?: number;
|
|
6945
|
+
total?: SBMoney;
|
|
6946
|
+
subTotal?: SBMoney;
|
|
6947
|
+
totalTaxes?: SBMoney;
|
|
6948
|
+
totalDiscounts?: SBMoney;
|
|
6949
|
+
totalFees?: SBMoney;
|
|
6950
|
+
totalBeforeTax?: SBMoney;
|
|
6951
|
+
currency?: string;
|
|
6952
|
+
hostedUrl?: string;
|
|
6953
|
+
shortUrl?: string;
|
|
6954
|
+
note?: string;
|
|
6955
|
+
lineItems?: SBInvoiceLineItem[];
|
|
6956
|
+
billingAddress?: SBAddress;
|
|
6957
|
+
shippingAddress?: SBAddress;
|
|
6958
|
+
reminders?: InvoiceReminder[];
|
|
6959
|
+
customer?: SBInvoiceCustomer;
|
|
6960
|
+
}
|
|
6961
|
+
interface InvoiceListRequest extends PaginationRequest {
|
|
6962
|
+
status?: string;
|
|
6963
|
+
customerId?: number;
|
|
6964
|
+
dateFrom?: string;
|
|
6965
|
+
dateTo?: string;
|
|
6966
|
+
minAmount?: number;
|
|
6967
|
+
maxAmount?: number;
|
|
6968
|
+
search?: string;
|
|
6969
|
+
}
|
|
6970
|
+
declare enum InvoiceReminderFrequency {
|
|
6971
|
+
ONCE = "ONCE",
|
|
6972
|
+
WEEKLY = "WEEKLY",
|
|
6973
|
+
BIWEEKLY = "BIWEEKLY",
|
|
6974
|
+
MONTHLY = "MONTHLY"
|
|
6975
|
+
}
|
|
6976
|
+
declare enum InvoiceReminderTiming {
|
|
6977
|
+
BEFORE_DUE = "BEFORE_DUE",
|
|
6978
|
+
ON_DUE = "ON_DUE",
|
|
6979
|
+
AFTER_DUE = "AFTER_DUE"
|
|
6980
|
+
}
|
|
6981
|
+
interface InvoiceReminder {
|
|
6982
|
+
id?: number;
|
|
6983
|
+
enabled: boolean;
|
|
6984
|
+
timing: InvoiceReminderTiming;
|
|
6985
|
+
daysOffset: number;
|
|
6986
|
+
frequency: InvoiceReminderFrequency;
|
|
6987
|
+
maxReminders: number;
|
|
6988
|
+
message?: string;
|
|
6989
|
+
}
|
|
6990
|
+
interface InvoiceCreateRequest {
|
|
6991
|
+
invoiceNumber?: string;
|
|
6992
|
+
date?: string;
|
|
6993
|
+
dueDate?: string;
|
|
6994
|
+
billingPeriodStartDate?: string;
|
|
6995
|
+
billingPeriodEndDate?: string;
|
|
6996
|
+
autoPaymentDate?: string;
|
|
6997
|
+
amountDue?: SBMoney;
|
|
6998
|
+
balanceForward?: SBMoney;
|
|
6999
|
+
paymentLinkUrl?: string;
|
|
7000
|
+
customerId?: number;
|
|
7001
|
+
vendorId?: number;
|
|
7002
|
+
currency?: string;
|
|
7003
|
+
note?: string;
|
|
7004
|
+
lineItems?: Omit<SBInvoiceLineItem, "id" | "product" | "taxes" | "price" | "subTotal" | "total">[];
|
|
7005
|
+
billingAddress?: SBAddress;
|
|
7006
|
+
shippingAddress?: SBAddress;
|
|
7007
|
+
reminders?: InvoiceReminder[];
|
|
7008
|
+
}
|
|
7009
|
+
type InvoiceUpdateRequest = Partial<InvoiceCreateRequest>;
|
|
7010
|
+
interface InvoiceSummary {
|
|
7011
|
+
totalRevenue: number;
|
|
7012
|
+
outstanding: number;
|
|
7013
|
+
overdueCount: number;
|
|
7014
|
+
paidThisMonth: number;
|
|
7015
|
+
totalCount: number;
|
|
7016
|
+
draftCount: number;
|
|
7017
|
+
sentCount: number;
|
|
7018
|
+
paidCount: number;
|
|
7019
|
+
}
|
|
7020
|
+
|
|
7021
|
+
declare class InvoiceService extends BaseService {
|
|
7022
|
+
list(params?: InvoiceListRequest, options?: RequestOptions): Promise<SBListResponse<SBInvoice>>;
|
|
7023
|
+
getById(id: number, options?: RequestOptions): Promise<SBInvoice>;
|
|
7024
|
+
create(data: InvoiceCreateRequest, options?: RequestOptions): Promise<SBInvoice>;
|
|
7025
|
+
update(id: number, data: InvoiceUpdateRequest, options?: RequestOptions): Promise<SBInvoice>;
|
|
7026
|
+
delete(id: number, options?: RequestOptions): Promise<void>;
|
|
7027
|
+
send(id: number, options?: RequestOptions): Promise<SBInvoice>;
|
|
7028
|
+
void(id: number, options?: RequestOptions): Promise<SBInvoice>;
|
|
7029
|
+
markPaid(id: number, options?: RequestOptions): Promise<SBInvoice>;
|
|
7030
|
+
duplicate(id: number, options?: RequestOptions): Promise<SBInvoice>;
|
|
7031
|
+
getSummary(options?: RequestOptions): Promise<InvoiceSummary>;
|
|
7032
|
+
downloadPdf(id: number, options?: RequestOptions): Promise<Blob>;
|
|
7033
|
+
getByPaymentToken(token: string): Promise<SBInvoice>;
|
|
7034
|
+
}
|
|
7035
|
+
|
|
7036
|
+
declare enum ConnectedAccountStatus {
|
|
7037
|
+
PENDING = "PENDING",
|
|
7038
|
+
RESTRICTED = "RESTRICTED",
|
|
7039
|
+
ENABLED = "ENABLED",
|
|
7040
|
+
DISABLED = "DISABLED",
|
|
7041
|
+
REJECTED = "REJECTED"
|
|
7042
|
+
}
|
|
7043
|
+
declare enum ConnectedAccountType {
|
|
7044
|
+
EXPRESS = "EXPRESS",
|
|
7045
|
+
STANDARD = "STANDARD",
|
|
7046
|
+
CUSTOM = "CUSTOM"
|
|
7047
|
+
}
|
|
7048
|
+
interface SBConnectedAccount extends SBEntity, SBTimestamps {
|
|
7049
|
+
businessId: number;
|
|
7050
|
+
stripeAccountId?: string;
|
|
7051
|
+
accountType: ConnectedAccountType;
|
|
7052
|
+
status: ConnectedAccountStatus;
|
|
7053
|
+
chargesEnabled: boolean;
|
|
7054
|
+
payoutsEnabled: boolean;
|
|
7055
|
+
detailsSubmitted: boolean;
|
|
7056
|
+
businessName?: string;
|
|
7057
|
+
businessUrl?: string;
|
|
7058
|
+
country?: string;
|
|
7059
|
+
defaultCurrency?: string;
|
|
7060
|
+
email?: string;
|
|
7061
|
+
applicationFeePercent: number;
|
|
7062
|
+
applicationFeeFixedAmount: number;
|
|
7063
|
+
applicationFeeCurrency: string;
|
|
7064
|
+
disabledReason?: string;
|
|
7065
|
+
currentlyDue?: string;
|
|
7066
|
+
pastDue?: string;
|
|
7067
|
+
bankAccountLast4?: string;
|
|
7068
|
+
bankAccountBankName?: string;
|
|
7069
|
+
bankAccountCurrency?: string;
|
|
7070
|
+
bankAccountCountry?: string;
|
|
7071
|
+
bankAccountRoutingLast4?: string;
|
|
7072
|
+
stripeDashboardUrl?: string;
|
|
7073
|
+
acceptedPaymentMethods: string;
|
|
7074
|
+
defaultPaymentTermsDays: number;
|
|
7075
|
+
smsNotificationsEnabled: boolean;
|
|
7076
|
+
automaticTaxEnabled: boolean;
|
|
7077
|
+
}
|
|
7078
|
+
interface ConnectedAccountOnboardingRequest {
|
|
7079
|
+
returnUrl: string;
|
|
7080
|
+
refreshUrl: string;
|
|
7081
|
+
businessName?: string;
|
|
7082
|
+
email?: string;
|
|
7083
|
+
country?: string;
|
|
7084
|
+
businessUrl?: string;
|
|
7085
|
+
}
|
|
7086
|
+
interface ConnectedAccountOnboardingResult {
|
|
7087
|
+
onboardingUrl: string;
|
|
7088
|
+
expiresAt: string;
|
|
7089
|
+
account: SBConnectedAccount;
|
|
7090
|
+
}
|
|
7091
|
+
interface FeeConfigurationRequest {
|
|
7092
|
+
applicationFeePercent: number;
|
|
7093
|
+
applicationFeeFixedAmount: number;
|
|
7094
|
+
applicationFeeCurrency: string;
|
|
7095
|
+
}
|
|
7096
|
+
interface ConnectedAccountSettingsRequest {
|
|
7097
|
+
acceptedPaymentMethods?: string;
|
|
7098
|
+
defaultPaymentTermsDays?: number;
|
|
7099
|
+
smsNotificationsEnabled?: boolean;
|
|
7100
|
+
automaticTaxEnabled?: boolean;
|
|
7101
|
+
}
|
|
7102
|
+
|
|
7103
|
+
declare class ConnectedAccountService extends BaseService {
|
|
7104
|
+
get(options?: RequestOptions): Promise<SBConnectedAccount>;
|
|
7105
|
+
getStatus(options?: RequestOptions): Promise<SBConnectedAccount>;
|
|
7106
|
+
createOnboardingLink(data: ConnectedAccountOnboardingRequest, options?: RequestOptions): Promise<ConnectedAccountOnboardingResult>;
|
|
7107
|
+
refreshOnboardingLink(data: Pick<ConnectedAccountOnboardingRequest, "returnUrl" | "refreshUrl">, options?: RequestOptions): Promise<{
|
|
7108
|
+
url: string;
|
|
7109
|
+
}>;
|
|
7110
|
+
createLoginLink(options?: RequestOptions): Promise<{
|
|
7111
|
+
url: string;
|
|
7112
|
+
}>;
|
|
7113
|
+
updateFees(data: FeeConfigurationRequest, options?: RequestOptions): Promise<SBConnectedAccount>;
|
|
7114
|
+
updateSettings(data: ConnectedAccountSettingsRequest, options?: RequestOptions): Promise<SBConnectedAccount>;
|
|
7115
|
+
disable(options?: RequestOptions): Promise<void>;
|
|
7116
|
+
}
|
|
7117
|
+
|
|
7118
|
+
declare enum InvoicePaymentStatus {
|
|
7119
|
+
PENDING = "Pending",
|
|
7120
|
+
PROCESSING = "Processing",
|
|
7121
|
+
SUCCEEDED = "Succeeded",
|
|
7122
|
+
FAILED = "Failed",
|
|
7123
|
+
CANCELED = "Canceled",
|
|
7124
|
+
REFUNDED = "Refunded",
|
|
7125
|
+
PARTIALLY_REFUNDED = "PartiallyRefunded",
|
|
7126
|
+
DISPUTED = "Disputed",
|
|
7127
|
+
EXPIRED = "Expired"
|
|
7128
|
+
}
|
|
7129
|
+
interface SBInvoicePayment extends SBEntity, SBTimestamps {
|
|
7130
|
+
connectedAccountId: number;
|
|
7131
|
+
businessId: number;
|
|
7132
|
+
invoiceId: number;
|
|
7133
|
+
externalInvoiceId?: string;
|
|
7134
|
+
status: InvoicePaymentStatus;
|
|
7135
|
+
amount: number;
|
|
7136
|
+
tipAmount: number;
|
|
7137
|
+
applicationFeeAmount: number;
|
|
7138
|
+
netAmount: number;
|
|
7139
|
+
currency: string;
|
|
7140
|
+
stripePaymentIntentId?: string;
|
|
7141
|
+
stripeCheckoutSessionId?: string;
|
|
7142
|
+
checkoutUrl?: string;
|
|
7143
|
+
paymentMethodType?: string;
|
|
7144
|
+
paymentMethodLast4?: string;
|
|
7145
|
+
paymentMethodBrand?: string;
|
|
7146
|
+
customerEmail?: string;
|
|
7147
|
+
customerName?: string;
|
|
7148
|
+
failureCode?: string;
|
|
7149
|
+
failureMessage?: string;
|
|
7150
|
+
clientSecret?: string;
|
|
7151
|
+
paidAt?: string;
|
|
7152
|
+
}
|
|
7153
|
+
interface CheckoutLineItem {
|
|
7154
|
+
description: string;
|
|
7155
|
+
quantity: number;
|
|
7156
|
+
unitAmount: number;
|
|
7157
|
+
taxRateIds?: string[];
|
|
7158
|
+
}
|
|
7159
|
+
interface InvoicePaymentCreateRequest {
|
|
7160
|
+
invoiceId: number;
|
|
7161
|
+
amount: number;
|
|
7162
|
+
tipAmount?: number;
|
|
7163
|
+
currency?: string;
|
|
7164
|
+
customerEmail?: string;
|
|
7165
|
+
customerName?: string;
|
|
7166
|
+
successUrl?: string;
|
|
7167
|
+
cancelUrl?: string;
|
|
7168
|
+
invoiceNumber?: string;
|
|
7169
|
+
lineItems?: CheckoutLineItem[];
|
|
7170
|
+
}
|
|
7171
|
+
interface InvoicePaymentFilterRequest {
|
|
7172
|
+
status?: InvoicePaymentStatus;
|
|
7173
|
+
dateFrom?: string;
|
|
7174
|
+
dateTo?: string;
|
|
7175
|
+
page?: number;
|
|
7176
|
+
pageSize?: number;
|
|
7177
|
+
}
|
|
7178
|
+
interface SBRefund extends SBEntity, SBTimestamps {
|
|
7179
|
+
invoicePaymentId: number;
|
|
7180
|
+
stripeRefundId?: string;
|
|
7181
|
+
amount: number;
|
|
7182
|
+
currency: string;
|
|
7183
|
+
reason?: string;
|
|
7184
|
+
status: string;
|
|
7185
|
+
failureReason?: string;
|
|
7186
|
+
notes?: string;
|
|
7187
|
+
applicationFeeReversed: boolean;
|
|
7188
|
+
}
|
|
7189
|
+
interface RefundCreateRequest {
|
|
7190
|
+
amount?: number;
|
|
7191
|
+
reason?: string;
|
|
7192
|
+
notes?: string;
|
|
7193
|
+
}
|
|
7194
|
+
interface SBDispute extends SBEntity, SBTimestamps {
|
|
7195
|
+
invoicePaymentId: number;
|
|
7196
|
+
stripeDisputeId?: string;
|
|
7197
|
+
amount: number;
|
|
7198
|
+
currency: string;
|
|
7199
|
+
reason?: string;
|
|
7200
|
+
status: string;
|
|
7201
|
+
evidenceDueBy?: string;
|
|
7202
|
+
isEvidenceSubmitted: boolean;
|
|
7203
|
+
}
|
|
7204
|
+
interface DisputeEvidenceRequest {
|
|
7205
|
+
uncategorizedText?: string;
|
|
7206
|
+
customerCommunication?: string;
|
|
7207
|
+
serviceDocumentation?: string;
|
|
7208
|
+
}
|
|
7209
|
+
interface LedgerSummary {
|
|
7210
|
+
grossRevenue: number;
|
|
7211
|
+
smartbillsFees: number;
|
|
7212
|
+
stripeProcessingFees: number;
|
|
7213
|
+
refundsIssued: number;
|
|
7214
|
+
disputedAmount: number;
|
|
7215
|
+
netRevenue: number;
|
|
7216
|
+
currency: string;
|
|
7217
|
+
periodStart: string;
|
|
7218
|
+
periodEnd: string;
|
|
7219
|
+
}
|
|
7220
|
+
interface LedgerEntry {
|
|
7221
|
+
id: number;
|
|
7222
|
+
type: string;
|
|
7223
|
+
description: string;
|
|
7224
|
+
invoicePaymentId?: number;
|
|
7225
|
+
grossAmount: number;
|
|
7226
|
+
feeAmount: number;
|
|
7227
|
+
netAmount: number;
|
|
7228
|
+
currency: string;
|
|
7229
|
+
status: string;
|
|
7230
|
+
stripeId?: string;
|
|
7231
|
+
createdAt: string;
|
|
7232
|
+
}
|
|
7233
|
+
interface Payout {
|
|
7234
|
+
stripePayoutId: string;
|
|
7235
|
+
amount: number;
|
|
7236
|
+
currency: string;
|
|
7237
|
+
status: string;
|
|
7238
|
+
arrivalDate?: string;
|
|
7239
|
+
bankAccountLast4?: string;
|
|
7240
|
+
description?: string;
|
|
7241
|
+
createdAt: string;
|
|
7242
|
+
}
|
|
7243
|
+
interface PagedResult<T> {
|
|
7244
|
+
items: T[];
|
|
7245
|
+
totalCount: number;
|
|
7246
|
+
page: number;
|
|
7247
|
+
pageSize: number;
|
|
7248
|
+
totalPages: number;
|
|
7249
|
+
}
|
|
7250
|
+
|
|
7251
|
+
declare class InvoicePaymentService extends BaseService {
|
|
7252
|
+
create(data: InvoicePaymentCreateRequest, options?: RequestOptions): Promise<SBInvoicePayment>;
|
|
7253
|
+
list(params?: InvoicePaymentFilterRequest, options?: RequestOptions): Promise<PagedResult<SBInvoicePayment>>;
|
|
7254
|
+
getById(id: number, options?: RequestOptions): Promise<SBInvoicePayment>;
|
|
7255
|
+
cancel(id: number, options?: RequestOptions): Promise<SBInvoicePayment>;
|
|
7256
|
+
createRefund(paymentId: number, data: RefundCreateRequest, options?: RequestOptions): Promise<SBRefund>;
|
|
7257
|
+
listRefunds(paymentId: number, options?: RequestOptions): Promise<SBRefund[]>;
|
|
7258
|
+
listDisputes(params?: {
|
|
7259
|
+
page?: number;
|
|
7260
|
+
pageSize?: number;
|
|
7261
|
+
}, options?: RequestOptions): Promise<SBDispute[]>;
|
|
7262
|
+
submitEvidence(disputeId: number, data: DisputeEvidenceRequest, options?: RequestOptions): Promise<SBDispute>;
|
|
7263
|
+
acceptDispute(disputeId: number, options?: RequestOptions): Promise<SBDispute>;
|
|
7264
|
+
getLedgerSummary(from: string, to: string, options?: RequestOptions): Promise<LedgerSummary>;
|
|
7265
|
+
getLedgerEntries(params?: Record<string, unknown>, options?: RequestOptions): Promise<LedgerEntry[]>;
|
|
7266
|
+
getPayouts(params?: Record<string, unknown>, options?: RequestOptions): Promise<Payout[]>;
|
|
7267
|
+
exportLedgerCsv(from: string, to: string, options?: RequestOptions): Promise<Blob>;
|
|
7268
|
+
}
|
|
7269
|
+
|
|
7270
|
+
declare enum PayoutStatus {
|
|
7271
|
+
PAID = "paid",
|
|
7272
|
+
PENDING = "pending",
|
|
7273
|
+
IN_TRANSIT = "in_transit",
|
|
7274
|
+
CANCELED = "canceled",
|
|
7275
|
+
FAILED = "failed"
|
|
7276
|
+
}
|
|
7277
|
+
declare enum PayoutInterval {
|
|
7278
|
+
DAILY = "daily",
|
|
7279
|
+
WEEKLY = "weekly",
|
|
7280
|
+
MONTHLY = "monthly",
|
|
7281
|
+
MANUAL = "manual"
|
|
7282
|
+
}
|
|
7283
|
+
interface SBPayout {
|
|
7284
|
+
id: string;
|
|
7285
|
+
amount: number;
|
|
7286
|
+
currency: string;
|
|
7287
|
+
status: string;
|
|
7288
|
+
arrivalDate: string;
|
|
7289
|
+
method?: string;
|
|
7290
|
+
description?: string;
|
|
7291
|
+
failureCode?: string;
|
|
7292
|
+
failureMessage?: string;
|
|
7293
|
+
createdAt: string;
|
|
7294
|
+
}
|
|
7295
|
+
interface PayoutListRequest {
|
|
7296
|
+
page?: number;
|
|
7297
|
+
pageSize?: number;
|
|
7298
|
+
startingAfter?: string;
|
|
7299
|
+
endingBefore?: string;
|
|
7300
|
+
}
|
|
7301
|
+
interface PayoutListResponse {
|
|
7302
|
+
data: SBPayout[];
|
|
7303
|
+
hasMore: boolean;
|
|
7304
|
+
}
|
|
7305
|
+
interface CreatePayoutRequest {
|
|
7306
|
+
amount: number;
|
|
7307
|
+
currency?: string;
|
|
7308
|
+
description?: string;
|
|
7309
|
+
}
|
|
7310
|
+
interface PayoutSchedule {
|
|
7311
|
+
interval: string;
|
|
7312
|
+
delayDays?: number;
|
|
7313
|
+
weeklyAnchor?: string;
|
|
7314
|
+
monthlyAnchor?: number;
|
|
7315
|
+
}
|
|
7316
|
+
interface UpdatePayoutScheduleRequest {
|
|
7317
|
+
interval: string;
|
|
7318
|
+
weeklyAnchor?: string;
|
|
7319
|
+
monthlyAnchor?: number;
|
|
7320
|
+
delayDays?: number;
|
|
7321
|
+
}
|
|
7322
|
+
interface BalanceAmount {
|
|
7323
|
+
amount: number;
|
|
7324
|
+
currency: string;
|
|
7325
|
+
}
|
|
7326
|
+
interface SBBalance {
|
|
7327
|
+
available: BalanceAmount[];
|
|
7328
|
+
pending: BalanceAmount[];
|
|
7329
|
+
}
|
|
7330
|
+
|
|
7331
|
+
declare class PayoutService extends BaseService {
|
|
7332
|
+
list(params?: PayoutListRequest, options?: RequestOptions): Promise<PayoutListResponse>;
|
|
7333
|
+
create(data: CreatePayoutRequest, options?: RequestOptions): Promise<SBPayout>;
|
|
7334
|
+
getSchedule(options?: RequestOptions): Promise<PayoutSchedule>;
|
|
7335
|
+
updateSchedule(data: UpdatePayoutScheduleRequest, options?: RequestOptions): Promise<PayoutSchedule>;
|
|
7336
|
+
getBalance(options?: RequestOptions): Promise<SBBalance>;
|
|
7337
|
+
}
|
|
7338
|
+
|
|
6639
7339
|
/**
|
|
6640
7340
|
* Configuration options for initializing a {@link SmartbillsClient}.
|
|
6641
7341
|
*/
|
|
@@ -6714,7 +7414,12 @@ declare class SmartbillsClient {
|
|
|
6714
7414
|
readonly employees: EmployeeService;
|
|
6715
7415
|
readonly attachments: AttachmentService;
|
|
6716
7416
|
readonly emailForwarding: EmailForwardingService;
|
|
7417
|
+
readonly authorizedSenders: AuthorizedSenderService;
|
|
6717
7418
|
readonly loyalty: LoyaltyService;
|
|
7419
|
+
readonly invoices: InvoiceService;
|
|
7420
|
+
readonly connectedAccounts: ConnectedAccountService;
|
|
7421
|
+
readonly invoicePayments: InvoicePaymentService;
|
|
7422
|
+
readonly payouts: PayoutService;
|
|
6718
7423
|
/**
|
|
6719
7424
|
* Creates a new Smartbills client instance.
|
|
6720
7425
|
*
|
|
@@ -6904,5 +7609,7 @@ declare function isConflictError(error: unknown): error is SmartbillsConflictErr
|
|
|
6904
7609
|
declare function isQuotaError(error: unknown): error is SmartbillsQuotaError;
|
|
6905
7610
|
declare function isRetryableError(error: unknown): boolean;
|
|
6906
7611
|
|
|
6907
|
-
|
|
6908
|
-
|
|
7612
|
+
declare function uploadFileToS3(uploadUrl: string, file: Blob | ArrayBuffer, contentType: string): Promise<void>;
|
|
7613
|
+
|
|
7614
|
+
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, 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 };
|
|
7615
|
+
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, 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, 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, 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, TransactionUpdateRequest, UpdateInstallationStatusRequest, UpdatePayoutScheduleRequest, UpgradeSubscriptionRequest, UsageHistoryRequest, UserUpdateRequest, VendorBatchUpdateRequest, VendorConnectRequest, VendorCreateRequest, VendorListRequest, VendorMergeRequest, VendorUpdateRequest, WorkflowCreateRequest, WorkflowListRequest, WorkflowTestRequest, WorkflowUpdateRequest };
|