@wix/auto_sdk_payments_tax-documents 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/build/cjs/index.d.ts +45 -0
  2. package/build/cjs/index.js +338 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +493 -0
  5. package/build/cjs/index.typings.js +308 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +485 -0
  8. package/build/cjs/meta.js +270 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/schemas.d.ts +85 -0
  11. package/build/cjs/schemas.js +183 -0
  12. package/build/cjs/schemas.js.map +1 -0
  13. package/build/es/index.d.mts +45 -0
  14. package/build/es/index.mjs +309 -0
  15. package/build/es/index.mjs.map +1 -0
  16. package/build/es/index.typings.d.mts +493 -0
  17. package/build/es/index.typings.mjs +279 -0
  18. package/build/es/index.typings.mjs.map +1 -0
  19. package/build/es/meta.d.mts +485 -0
  20. package/build/es/meta.mjs +238 -0
  21. package/build/es/meta.mjs.map +1 -0
  22. package/build/es/package.json +3 -0
  23. package/build/es/schemas.d.mts +85 -0
  24. package/build/es/schemas.mjs +141 -0
  25. package/build/es/schemas.mjs.map +1 -0
  26. package/build/internal/cjs/index.d.ts +45 -0
  27. package/build/internal/cjs/index.js +338 -0
  28. package/build/internal/cjs/index.js.map +1 -0
  29. package/build/internal/cjs/index.typings.d.ts +493 -0
  30. package/build/internal/cjs/index.typings.js +308 -0
  31. package/build/internal/cjs/index.typings.js.map +1 -0
  32. package/build/internal/cjs/meta.d.ts +485 -0
  33. package/build/internal/cjs/meta.js +270 -0
  34. package/build/internal/cjs/meta.js.map +1 -0
  35. package/build/internal/cjs/schemas.d.ts +85 -0
  36. package/build/internal/cjs/schemas.js +183 -0
  37. package/build/internal/cjs/schemas.js.map +1 -0
  38. package/build/internal/es/index.d.mts +45 -0
  39. package/build/internal/es/index.mjs +309 -0
  40. package/build/internal/es/index.mjs.map +1 -0
  41. package/build/internal/es/index.typings.d.mts +493 -0
  42. package/build/internal/es/index.typings.mjs +279 -0
  43. package/build/internal/es/index.typings.mjs.map +1 -0
  44. package/build/internal/es/meta.d.mts +485 -0
  45. package/build/internal/es/meta.mjs +238 -0
  46. package/build/internal/es/meta.mjs.map +1 -0
  47. package/build/internal/es/schemas.d.mts +85 -0
  48. package/build/internal/es/schemas.mjs +141 -0
  49. package/build/internal/es/schemas.mjs.map +1 -0
  50. package/meta/package.json +3 -0
  51. package/package.json +61 -0
  52. package/schemas/package.json +3 -0
@@ -0,0 +1,493 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ /**
4
+ * A tax document is a tax-related form that Wix Payments issues to a merchant, such as a US IRS Form 1099-K.
5
+ * Each tax document belongs to a Wix Payments account and covers a specific period.
6
+ * When a document's file is available, you can generate a temporary URL to download it as a PDF.
7
+ */
8
+ interface TaxDocument {
9
+ /**
10
+ * Tax document ID.
11
+ * @format GUID
12
+ * @readonly
13
+ */
14
+ _id?: string | null;
15
+ /**
16
+ * Date and time the tax document was created.
17
+ * @readonly
18
+ */
19
+ _createdDate?: Date | null;
20
+ /**
21
+ * Date and time the tax document was last updated.
22
+ * @readonly
23
+ */
24
+ _updatedDate?: Date | null;
25
+ /**
26
+ * Revision number, which increments by 1 each time the tax document is updated.
27
+ * @readonly
28
+ */
29
+ revision?: string;
30
+ /**
31
+ * ID of the Wix Payments account the tax document belongs to.
32
+ * @format GUID
33
+ * @immutable
34
+ */
35
+ accountId?: string;
36
+ /**
37
+ * Type of tax document.
38
+ * @immutable
39
+ */
40
+ type?: TaxDocumentTypeWithLiterals;
41
+ /**
42
+ * Period the tax document covers.
43
+ * @immutable
44
+ */
45
+ period?: TaxPeriod;
46
+ /**
47
+ * Whether a file is available to download for the tax document. When `false`, calling Generate File Download Info returns an error.
48
+ *
49
+ * At least one of `downloadable` and `problematic` is always `true`.
50
+ */
51
+ downloadable?: boolean;
52
+ /**
53
+ * Whether a problem was found with the tax document's file, for example incorrect data that's being corrected.
54
+ *
55
+ * At least one of `downloadable` and `problematic` is always `true`, and both can be `true` at the same time.
56
+ */
57
+ problematic?: boolean;
58
+ /**
59
+ * How the tax document's amounts are aggregated.
60
+ * @readonly
61
+ */
62
+ sourceType?: SourceTypeWithLiterals;
63
+ /**
64
+ * Human-readable name for the tax document's file.
65
+ * @readonly
66
+ * @minLength 1
67
+ * @maxLength 1000
68
+ */
69
+ displayName?: string | null;
70
+ }
71
+ /** Type of tax document. */
72
+ declare enum TaxDocumentType {
73
+ /** US IRS Form 1099-K. */
74
+ FORM_1099_K = "FORM_1099_K"
75
+ }
76
+ /** @enumType */
77
+ type TaxDocumentTypeWithLiterals = TaxDocumentType | 'FORM_1099_K';
78
+ interface TaxPeriod extends TaxPeriodOptionsOneOf {
79
+ /** The tax document covers a full calendar year. */
80
+ yearPeriod?: YearPeriod;
81
+ }
82
+ /** @oneof */
83
+ interface TaxPeriodOptionsOneOf {
84
+ /** The tax document covers a full calendar year. */
85
+ yearPeriod?: YearPeriod;
86
+ }
87
+ interface YearPeriod {
88
+ /** Calendar year the tax document covers. For example, `2024`. */
89
+ year?: number;
90
+ }
91
+ /** Source of data for tax document. */
92
+ declare enum SourceType {
93
+ /** Amounts are aggregated by payment date. */
94
+ PAYMENT = "PAYMENT",
95
+ /** Amounts are aggregated by payout date. */
96
+ PAYOUT = "PAYOUT"
97
+ }
98
+ /** @enumType */
99
+ type SourceTypeWithLiterals = SourceType | 'PAYMENT' | 'PAYOUT';
100
+ interface GetTaxDocumentFileHistoryRequest {
101
+ /**
102
+ * Id of a tax document.
103
+ * @format GUID
104
+ */
105
+ taxDocumentId?: string;
106
+ }
107
+ interface GetTaxDocumentFileHistoryResponse {
108
+ /** Tax document history. */
109
+ taxDocumentFileHistory?: TaxDocumentFileHistory;
110
+ }
111
+ interface TaxDocumentFileHistory {
112
+ /**
113
+ * Tax document identifier.
114
+ * @format GUID
115
+ */
116
+ taxDocumentId?: string;
117
+ /**
118
+ * File history records which correspond to file versions for this tax document.
119
+ * Includes current file version, if it exists.
120
+ * Sorted in descending order by `created_date`.
121
+ * @maxSize 100
122
+ */
123
+ records?: TaxDocumentFileHistoryRecord[];
124
+ }
125
+ interface TaxDocumentFileHistoryRecord {
126
+ /**
127
+ * History record identifier.
128
+ * @format GUID
129
+ */
130
+ _id?: string;
131
+ /**
132
+ * Date when tax document file was uploaded.
133
+ * History record is created at the same moment.
134
+ * @readonly
135
+ */
136
+ _createdDate?: Date | null;
137
+ }
138
+ interface GenerateHistoryFileDownloadInfoRequest {
139
+ /**
140
+ * Tax document to download a file for.
141
+ * @format GUID
142
+ */
143
+ taxDocumentId?: string;
144
+ /**
145
+ * Tax document history record to download a file for.
146
+ * @format GUID
147
+ */
148
+ taxDocumentFileHistoryRecordId?: string;
149
+ }
150
+ interface GenerateHistoryFileDownloadInfoResponse {
151
+ /** Information used to download a file. */
152
+ downloadInfo?: string;
153
+ }
154
+ interface UpdateTaxDocumentRequest {
155
+ /** Tax document to update. */
156
+ taxDocument?: TaxDocument;
157
+ }
158
+ interface UpdateTaxDocumentResponse {
159
+ /** Updated tax document. */
160
+ taxDocument?: TaxDocument;
161
+ }
162
+ interface RefreshTaxDocumentFileRequest {
163
+ /**
164
+ * Tax document to be updated.
165
+ * @format GUID
166
+ */
167
+ taxDocumentId?: string;
168
+ /** Flag represents whether ping notification to user should be sent if the tax document is successfully updated. */
169
+ notifyOnSuccess?: boolean;
170
+ }
171
+ interface RefreshTaxDocumentFileResponse {
172
+ /** Latest version of the tax document. */
173
+ taxDocument?: TaxDocument;
174
+ /** Represents whether the document was updated. */
175
+ updated?: boolean;
176
+ }
177
+ interface GenerateFileUploadTargetRequest {
178
+ /**
179
+ * Tax document for file upload.
180
+ * @format GUID
181
+ */
182
+ taxDocumentId?: string;
183
+ }
184
+ interface GenerateFileUploadTargetResponse {
185
+ /** Upload target. */
186
+ uploadTarget?: FileUploadTarget;
187
+ }
188
+ interface FileUploadTarget {
189
+ /**
190
+ * File upload URL.
191
+ * @format WEB_URL
192
+ */
193
+ uploadUrl?: string;
194
+ /**
195
+ * File upload token.
196
+ * @minLength 1
197
+ * @maxLength 1000
198
+ */
199
+ uploadToken?: string;
200
+ }
201
+ interface ConfirmFileUploadedRequest {
202
+ /**
203
+ * Tax document for which there was a successful upload.
204
+ * @format GUID
205
+ */
206
+ taxDocumentId?: string;
207
+ }
208
+ interface ConfirmFileUploadedResponse {
209
+ }
210
+ interface DomainEvent extends DomainEventBodyOneOf {
211
+ createdEvent?: EntityCreatedEvent;
212
+ updatedEvent?: EntityUpdatedEvent;
213
+ deletedEvent?: EntityDeletedEvent;
214
+ actionEvent?: ActionEvent;
215
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
216
+ _id?: string;
217
+ /**
218
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
219
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
220
+ */
221
+ entityFqdn?: string;
222
+ /**
223
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
224
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
225
+ */
226
+ slug?: string;
227
+ /** ID of the entity associated with the event. */
228
+ entityId?: string;
229
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
230
+ eventTime?: Date | null;
231
+ /**
232
+ * Whether the event was triggered as a result of a privacy regulation application
233
+ * (for example, GDPR).
234
+ */
235
+ triggeredByAnonymizeRequest?: boolean | null;
236
+ /** If present, indicates the action that triggered the event. */
237
+ originatedFrom?: string | null;
238
+ /**
239
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
240
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
241
+ */
242
+ entityEventSequence?: string | null;
243
+ }
244
+ /** @oneof */
245
+ interface DomainEventBodyOneOf {
246
+ createdEvent?: EntityCreatedEvent;
247
+ updatedEvent?: EntityUpdatedEvent;
248
+ deletedEvent?: EntityDeletedEvent;
249
+ actionEvent?: ActionEvent;
250
+ }
251
+ interface EntityCreatedEvent {
252
+ entity?: string;
253
+ }
254
+ interface RestoreInfo {
255
+ deletedDate?: Date | null;
256
+ }
257
+ interface EntityUpdatedEvent {
258
+ /**
259
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
260
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
261
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
262
+ */
263
+ currentEntity?: string;
264
+ }
265
+ interface EntityDeletedEvent {
266
+ /** Entity that was deleted. */
267
+ deletedEntity?: string | null;
268
+ }
269
+ interface ActionEvent {
270
+ body?: string;
271
+ }
272
+ interface MessageEnvelope {
273
+ /**
274
+ * App instance ID.
275
+ * @format GUID
276
+ */
277
+ instanceId?: string | null;
278
+ /**
279
+ * Event type.
280
+ * @maxLength 150
281
+ */
282
+ eventType?: string;
283
+ /** The identification type and identity data. */
284
+ identity?: IdentificationData;
285
+ /** Stringify payload. */
286
+ data?: string;
287
+ /** Details related to the account */
288
+ accountInfo?: AccountInfo;
289
+ }
290
+ interface IdentificationData extends IdentificationDataIdOneOf {
291
+ /**
292
+ * ID of a site visitor that has not logged in to the site.
293
+ * @format GUID
294
+ */
295
+ anonymousVisitorId?: string;
296
+ /**
297
+ * ID of a site visitor that has logged in to the site.
298
+ * @format GUID
299
+ */
300
+ memberId?: string;
301
+ /**
302
+ * ID of a Wix user (site owner, contributor, etc.).
303
+ * @format GUID
304
+ */
305
+ wixUserId?: string;
306
+ /**
307
+ * ID of an app.
308
+ * @format GUID
309
+ */
310
+ appId?: string;
311
+ /** @readonly */
312
+ identityType?: WebhookIdentityTypeWithLiterals;
313
+ }
314
+ /** @oneof */
315
+ interface IdentificationDataIdOneOf {
316
+ /**
317
+ * ID of a site visitor that has not logged in to the site.
318
+ * @format GUID
319
+ */
320
+ anonymousVisitorId?: string;
321
+ /**
322
+ * ID of a site visitor that has logged in to the site.
323
+ * @format GUID
324
+ */
325
+ memberId?: string;
326
+ /**
327
+ * ID of a Wix user (site owner, contributor, etc.).
328
+ * @format GUID
329
+ */
330
+ wixUserId?: string;
331
+ /**
332
+ * ID of an app.
333
+ * @format GUID
334
+ */
335
+ appId?: string;
336
+ }
337
+ declare enum WebhookIdentityType {
338
+ UNKNOWN = "UNKNOWN",
339
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
340
+ MEMBER = "MEMBER",
341
+ WIX_USER = "WIX_USER",
342
+ APP = "APP"
343
+ }
344
+ /** @enumType */
345
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
346
+ interface AccountInfo {
347
+ /**
348
+ * ID of the Wix account associated with the event.
349
+ * @format GUID
350
+ */
351
+ accountId?: string | null;
352
+ /**
353
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
354
+ * @format GUID
355
+ */
356
+ parentAccountId?: string | null;
357
+ /**
358
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
359
+ * @format GUID
360
+ */
361
+ siteId?: string | null;
362
+ }
363
+ interface GetTaxDocumentRequest {
364
+ /**
365
+ * ID of the tax document to retrieve.
366
+ * @format GUID
367
+ */
368
+ taxDocumentId: string;
369
+ }
370
+ interface GetTaxDocumentResponse {
371
+ /** Retrieved tax document. */
372
+ taxDocument?: TaxDocument;
373
+ }
374
+ interface ListTaxDocumentsRequest {
375
+ /**
376
+ * ID of the Wix Payments account whose tax documents are retrieved.
377
+ * @format GUID
378
+ */
379
+ accountId: string | null;
380
+ /** Cursor paging options. */
381
+ paging?: CursorPaging;
382
+ /** Filters the retrieved tax documents by type. When omitted, tax documents of all types are returned. */
383
+ type?: TaxDocumentTypeWithLiterals;
384
+ }
385
+ interface CursorPaging {
386
+ /**
387
+ * Number of items to load.
388
+ * @max 100
389
+ */
390
+ limit?: number | null;
391
+ /**
392
+ * Pointer to the next or previous page in the list of results.
393
+ *
394
+ * You can get the relevant cursor token
395
+ * from the `pagingMetadata` object in the previous call's response.
396
+ * Not relevant for the first request.
397
+ * @maxLength 16000
398
+ */
399
+ cursor?: string | null;
400
+ }
401
+ interface ListTaxDocumentsResponse {
402
+ /** Retrieved tax documents. */
403
+ taxDocuments?: TaxDocument[];
404
+ /** Paging metadata. */
405
+ pagingMetadata?: PagingMetadataV2;
406
+ }
407
+ interface PagingMetadataV2 {
408
+ /** Number of items returned in the response. */
409
+ count?: number | null;
410
+ /** Offset that was requested. */
411
+ offset?: number | null;
412
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
413
+ total?: number | null;
414
+ /** Flag that indicates the server failed to calculate the `total` field. */
415
+ tooManyToCount?: boolean | null;
416
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
417
+ cursors?: Cursors;
418
+ }
419
+ interface Cursors {
420
+ /**
421
+ * Cursor pointing to next page in the list of results.
422
+ * @maxLength 16000
423
+ */
424
+ next?: string | null;
425
+ /**
426
+ * Cursor pointing to previous page in the list of results.
427
+ * @maxLength 16000
428
+ */
429
+ prev?: string | null;
430
+ }
431
+ interface GenerateFileDownloadInfoRequest {
432
+ /**
433
+ * ID of the tax document to download a file for.
434
+ * @format GUID
435
+ */
436
+ taxDocumentId: string;
437
+ }
438
+ interface GenerateFileDownloadInfoResponse {
439
+ /** Information for downloading the tax document's file. */
440
+ downloadInfo?: string;
441
+ }
442
+ /**
443
+ * Retrieves a tax document by ID.
444
+ * @param taxDocumentId - ID of the tax document to retrieve.
445
+ * @public
446
+ * @documentationMaturity preview
447
+ * @requiredField taxDocumentId
448
+ * @permissionId PAYMENTS.TAX_DOCUMENT_READ
449
+ * @applicableIdentity APP
450
+ * @returns Retrieved tax document.
451
+ * @fqn wix.payments.tax_documents.v1.TaxDocumentsService.GetTaxDocument
452
+ */
453
+ declare function getTaxDocument(taxDocumentId: string): Promise<NonNullablePaths<TaxDocument, `revision` | `accountId` | `type` | `period.yearPeriod.year` | `downloadable` | `problematic` | `sourceType`, 4>>;
454
+ /**
455
+ * Retrieves a list of tax documents that belong to a Wix Payments account.
456
+ *
457
+ * You must specify the `accountId` of the account whose tax documents you want to retrieve.
458
+ *
459
+ * Tax documents are sorted in descending order by `period`, then by `createdDate`.
460
+ *
461
+ * When `type` is omitted, tax documents of all types are returned.
462
+ * @param accountId - ID of the Wix Payments account whose tax documents are retrieved.
463
+ * @public
464
+ * @documentationMaturity preview
465
+ * @requiredField accountId
466
+ * @permissionId PAYMENTS.TAX_DOCUMENT_READ
467
+ * @applicableIdentity APP
468
+ * @fqn wix.payments.tax_documents.v1.TaxDocumentsService.ListTaxDocuments
469
+ */
470
+ declare function listTaxDocuments(accountId: string, options?: ListTaxDocumentsOptions): Promise<NonNullablePaths<ListTaxDocumentsResponse, `taxDocuments` | `taxDocuments.${number}.revision` | `taxDocuments.${number}.accountId` | `taxDocuments.${number}.type` | `taxDocuments.${number}.period.yearPeriod.year` | `taxDocuments.${number}.downloadable` | `taxDocuments.${number}.problematic` | `taxDocuments.${number}.sourceType`, 6>>;
471
+ interface ListTaxDocumentsOptions {
472
+ /** Cursor paging options. */
473
+ paging?: CursorPaging;
474
+ /** Filters the retrieved tax documents by type. When omitted, tax documents of all types are returned. */
475
+ type?: TaxDocumentTypeWithLiterals;
476
+ }
477
+ /**
478
+ * Generates temporary information for downloading a tax document's file.
479
+ *
480
+ * The returned `downloadInfo.url` is a temporary link to a PDF. It expires 10 seconds after it's generated, so follow it immediately, and don't store it as a static link. Call this method again to get a fresh URL.
481
+ *
482
+ * The tax document must have a file available, meaning its `downloadable` field is `true`.
483
+ * @param taxDocumentId - ID of the tax document to download a file for.
484
+ * @public
485
+ * @documentationMaturity preview
486
+ * @requiredField taxDocumentId
487
+ * @permissionId PAYMENTS.TAX_DOCUMENT_DOWNLOAD
488
+ * @applicableIdentity APP
489
+ * @fqn wix.payments.tax_documents.v1.TaxDocumentsService.GenerateFileDownloadInfo
490
+ */
491
+ declare function generateFileDownloadInfo(taxDocumentId: string): Promise<GenerateFileDownloadInfoResponse>;
492
+
493
+ export { type AccountInfo, type ActionEvent, type ConfirmFileUploadedRequest, type ConfirmFileUploadedResponse, type CursorPaging, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type FileUploadTarget, type GenerateFileDownloadInfoRequest, type GenerateFileDownloadInfoResponse, type GenerateFileUploadTargetRequest, type GenerateFileUploadTargetResponse, type GenerateHistoryFileDownloadInfoRequest, type GenerateHistoryFileDownloadInfoResponse, type GetTaxDocumentFileHistoryRequest, type GetTaxDocumentFileHistoryResponse, type GetTaxDocumentRequest, type GetTaxDocumentResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListTaxDocumentsOptions, type ListTaxDocumentsRequest, type ListTaxDocumentsResponse, type MessageEnvelope, type PagingMetadataV2, type RefreshTaxDocumentFileRequest, type RefreshTaxDocumentFileResponse, type RestoreInfo, SourceType, type SourceTypeWithLiterals, type TaxDocument, type TaxDocumentFileHistory, type TaxDocumentFileHistoryRecord, TaxDocumentType, type TaxDocumentTypeWithLiterals, type TaxPeriod, type TaxPeriodOptionsOneOf, type UpdateTaxDocumentRequest, type UpdateTaxDocumentResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type YearPeriod, generateFileDownloadInfo, getTaxDocument, listTaxDocuments };