@wix/auto_sdk_payments_payouts 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,66 +1,82 @@
1
1
  import { NonNullablePaths } from '@wix/sdk-types';
2
2
 
3
3
  /**
4
- * A payout is one outgoing transfer of funds from a Wix Payments merchant account
5
- * to the merchant's bank account. The entity carries the amount, lifecycle status,
6
- * estimated arrival date, and (when applicable) failure information.
4
+ * A payout is an outgoing transfer of funds from a Wix Payments account to the
5
+ * merchant's bank account. Each payout has an amount, a lifecycle status, an
6
+ * estimated arrival date, and (when applicable) a failure reason.
7
7
  */
8
8
  interface Payout {
9
9
  /**
10
- * Unique identifier of the payout. Immutable.
10
+ * Payout ID.
11
11
  * @format GUID
12
12
  */
13
13
  _id?: string;
14
14
  /**
15
- * ID of the Wix Payments account that owns this payout.
15
+ * ID of the Wix Payments account that owns the payout. Retrieve account IDs
16
+ * from the Accounts API.
16
17
  * @format GUID
17
18
  */
18
19
  accountId?: string;
19
20
  /**
20
- * ID of the Wix Payments account profile this payout belongs to.
21
- * A Wix Payments account has one or more profiles; each profile has its own
22
- * balance and its own payouts. Most merchants have a single profile.
21
+ * ID of the Wix Payments account profile that owns the payout.
22
+ *
23
+ * A Wix Payments account has 1 or more profiles. Each profile has its own
24
+ * balance and its own payouts. Most merchants have 1 profile. Retrieve
25
+ * profile IDs from the Accounts API.
23
26
  * @format GUID
24
27
  */
25
28
  accountProfileId?: string;
26
29
  /**
27
- * Date the payout was created, in advance of the underlying transfer being
28
- * initiated at the bank rail. Once initiated, the funds typically reach the
29
- * merchant's bank account within 3-5 business days, depending on the receiving bank.
30
+ * Date and time the payout was created.
31
+ *
32
+ * The payout is created before the underlying transfer is initiated at the
33
+ * bank. Once initiated, the funds typically reach the merchant's bank account
34
+ * within 3 to 5 business days, depending on the receiving bank.
30
35
  */
31
36
  _createdDate?: Date | null;
32
- /** Amount of funds transferred to the merchant's bank account. */
37
+ /** Amount of the transfer to the merchant's bank account. */
33
38
  amount?: Money;
34
39
  /**
35
- * Lifecycle status of the payout. `SENT` means the bank rail accepted the transfer
36
- * for delivery; `FAILED` means the receiving bank rejected the transfer. The rail
37
- * does not provide a delivery acknowledgement, so `SENT` is not the same as
38
- * "delivered to the merchant" see the per-value documentation on `PayoutStatus`.
40
+ * Lifecycle status of the payout.
41
+ *
42
+ * `SENT` means the bank rail accepted the transfer for delivery. `FAILED` means
43
+ * the receiving bank rejected the transfer.
44
+ *
45
+ * A `SENT` status doesn't guarantee that the funds were delivered to the
46
+ * merchant. The bank rail doesn't provide a delivery acknowledgement, and a
47
+ * payout in `SENT` can later transition to `FAILED` if the receiving bank
48
+ * rejects the transfer. See the per-value documentation on `PayoutStatus` for
49
+ * details.
39
50
  */
40
51
  status?: PayoutStatusWithLiterals;
41
52
  /**
42
- * Estimated date for when the funds should arrive at the merchant's bank, returned
43
- * by the underlying bank rail when available. This is a prediction, not a guarantee —
44
- * actual arrival depends on the receiving bank's processing and may be later.
53
+ * Estimated date for when the funds should arrive at the merchant's bank
54
+ * account, in `YYYY-MM-DD` format.
55
+ *
56
+ * The estimated arrival date is a prediction, not a guarantee. Actual arrival
57
+ * depends on the receiving bank's processing and may be later.
45
58
  * @format LOCAL_DATE
46
59
  */
47
60
  estimatedArrivalDateV2?: string | null;
48
61
  /**
49
- * Set only when `status` is `FAILED`. Indicates why the bank rail rejected the transfer.
50
- * The codes are a Wix Payments unified set; the original provider-specific reason is not exposed.
62
+ * Reason the bank rail rejected the transfer.
63
+ *
64
+ * Returned only when `status` is `FAILED`.
51
65
  */
52
66
  failureReason?: PayoutFailureReason;
53
67
  /**
54
- * Reference returned by the bank rail (e.g. ACH trace number, SEPA reference) once
55
- * the transfer is initiated. Use it for reconciliation against the merchant's bank
56
- * statement. Empty when the rail has not yet returned a reference.
68
+ * Reference returned by the bank rail once the transfer is initiated. For
69
+ * example, an ACH trace number or a SEPA reference. Use this value to
70
+ * reconcile against the merchant's bank statement.
71
+ *
72
+ * Empty until the bank rail returns a reference.
57
73
  * @maxLength 500
58
74
  */
59
75
  bankTransferReference?: string | null;
60
76
  /**
61
- * `true` if the payout's `amount` includes funds that originate from a Wix Capital
62
- * advance the merchant has taken out. `false` if the amount is composed only of
63
- * regular sales proceeds.
77
+ * Whether the payout `amount` includes funds from a Wix Capital cash advance
78
+ * taken out by the merchant. If `false`, the amount comes only from the
79
+ * merchant's sales proceeds.
64
80
  */
65
81
  cashAdvanceIncluded?: boolean;
66
82
  }
@@ -84,56 +100,56 @@ interface Money {
84
100
  }
85
101
  /** Lifecycle status of a payout. */
86
102
  declare enum PayoutStatus {
87
- /** Default value. Not returned by the API. */
103
+ /** Unknown payout status. Not returned by the API. */
88
104
  UNKNOWN = "UNKNOWN",
89
105
  /**
90
- * The bank rail accepted the transfer. Funds are en route to the merchant's bank,
91
- * but acceptance is not the same as delivery — a `SENT` payout can still flip to
92
- * `FAILED` if the receiving bank rejects the transfer (the rail's return window
93
- * is up to 60 days for ACH and up to 13 months for SEPA).
106
+ * The bank rail accepted the transfer. Funds are en route to the merchant's
107
+ * bank account.
108
+ *
109
+ * Acceptance isn't the same as delivery. A `SENT` payout can still
110
+ * transition to `FAILED` if the receiving bank rejects the transfer. The
111
+ * bank rail's return window is up to 60 days for ACH and up to 13 months
112
+ * for SEPA.
94
113
  */
95
114
  SENT = "SENT",
96
115
  /**
97
- * The transfer was rejected by the receiving bank. See `failure_reason` for the cause;
98
- * the funds remain in the merchant's Wix Payments balance.
116
+ * The bank rail rejected the transfer. See `failureReason` for the cause.
117
+ * The funds remain in the merchant's Wix Payments balance.
99
118
  */
100
119
  FAILED = "FAILED"
101
120
  }
102
121
  /** @enumType */
103
122
  type PayoutStatusWithLiterals = PayoutStatus | 'UNKNOWN' | 'SENT' | 'FAILED';
104
- /**
105
- * Carries the reason a payout failed. Wraps the `PayoutFailureCode` enum to leave room
106
- * for future fields (e.g. a human-readable message); new clients should still read
107
- * `failure_reason.code` for the enum value.
108
- */
123
+ /** Reason a payout failed. */
109
124
  interface PayoutFailureReason {
110
125
  /** Why the bank rail rejected the transfer. */
111
126
  code?: PayoutFailureCodeWithLiterals;
112
127
  }
113
128
  /**
114
- * Reasons a payout can fail. Values describe real-world bank-rail conditions and
115
- * are mapped from the underlying provider into a Wix Payments unified vocabulary.
129
+ * Possible reasons for a payout failure. Each value describes a real-world
130
+ * bank-rail condition.
116
131
  */
117
132
  declare enum PayoutFailureCode {
118
133
  /**
119
- * Generic failure with no more specific reason available from the bank rail.
120
- * Note: this value is also returned when no failure reason is known — clients
121
- * cannot distinguish "unknown" from "generic" using this code alone.
134
+ * Generic failure with no more specific reason available from the bank
135
+ * rail. This value is also returned when no failure reason is known.
136
+ * Clients can't distinguish "unknown" from "generic" using this code alone.
122
137
  */
123
138
  GENERIC_PAYOUT_FAILURE = "GENERIC_PAYOUT_FAILURE",
124
139
  /**
125
- * The merchant's bank account is closed. The merchant must provide new bank
126
- * account details before further payouts can succeed.
140
+ * The merchant's bank account is closed. The merchant must provide new
141
+ * bank account details before further payouts can succeed.
127
142
  */
128
143
  ACCOUNT_CLOSED = "ACCOUNT_CLOSED",
129
144
  /**
130
- * The merchant's bank account is frozen (e.g. due to a hold placed by the bank).
131
- * The merchant must resolve the hold with their bank before further payouts can succeed.
145
+ * The merchant's bank account is frozen, for example due to a hold placed
146
+ * by the bank. The merchant must resolve the hold with their bank before
147
+ * further payouts can succeed.
132
148
  */
133
149
  ACCOUNT_FROZEN = "ACCOUNT_FROZEN",
134
150
  /**
135
- * The merchant's bank account is restricted from receiving the transfer
136
- * (e.g. account type or status does not permit incoming credits).
151
+ * The merchant's bank account is restricted from receiving the transfer.
152
+ * For example, the account type or status doesn't permit incoming credits.
137
153
  */
138
154
  BANK_ACCOUNT_RESTRICTED = "BANK_ACCOUNT_RESTRICTED",
139
155
  /**
@@ -142,38 +158,42 @@ declare enum PayoutFailureCode {
142
158
  */
143
159
  BANK_OWNERSHIP_CHANGED = "BANK_OWNERSHIP_CHANGED",
144
160
  /**
145
- * The receiving bank could not process the transfer for an unspecified reason.
146
- * A subsequent payout attempt may succeed.
161
+ * The receiving bank couldn't process the transfer for an unspecified
162
+ * reason. A subsequent payout attempt may succeed.
147
163
  */
148
164
  COULD_NOT_PROCESS = "COULD_NOT_PROCESS",
149
165
  /**
150
- * The merchant's bank declined the debit authorisation associated with the transfer.
151
- * The merchant must contact their bank to authorise Wix Payments payouts.
166
+ * The merchant's bank declined the debit authorisation associated with the
167
+ * transfer. The merchant must contact their bank to authorise Wix Payments
168
+ * payouts.
152
169
  */
153
170
  DEBIT_NOT_AUTHORIZED = "DEBIT_NOT_AUTHORIZED",
154
171
  /**
155
- * The account holder name on file does not match what the receiving bank has on record.
156
- * The merchant must correct the account holder name.
172
+ * The account holder name on file doesn't match the name the receiving
173
+ * bank has on record. The merchant must correct the account holder name.
157
174
  */
158
175
  INCORRECT_ACCOUNT_HOLDER_NAME = "INCORRECT_ACCOUNT_HOLDER_NAME",
159
176
  /** The city in the bank account details is invalid for the receiving bank. */
160
177
  INVALID_ACCOUNT_DETAILS_CITY = "INVALID_ACCOUNT_DETAILS_CITY",
161
- /** The bank account number is invalid (wrong format or does not exist). */
178
+ /**
179
+ * The bank account number is invalid. The format is wrong or the account
180
+ * doesn't exist.
181
+ */
162
182
  INVALID_ACCOUNT_NUMBER = "INVALID_ACCOUNT_NUMBER",
163
- /** The payout currency is not supported by the receiving bank account. */
183
+ /** The payout currency isn't supported by the receiving bank account. */
164
184
  INVALID_CURRENCY = "INVALID_CURRENCY",
165
- /** The routing number (US) is invalid or does not match the receiving bank. */
185
+ /** The routing number (US) is invalid or doesn't match the receiving bank. */
166
186
  INVALID_ROUTING_NUMBER = "INVALID_ROUTING_NUMBER",
167
- /** The sort code (UK) is invalid or does not match the receiving bank. */
187
+ /** The sort code (UK) is invalid or doesn't match the receiving bank. */
168
188
  INVALID_SORT_CODE = "INVALID_SORT_CODE",
169
189
  /**
170
- * No bank account is on file for the merchant.
171
- * The merchant must add bank details before payouts can succeed.
190
+ * No bank account is on file for the merchant. The merchant must add bank
191
+ * details before payouts can succeed.
172
192
  */
173
193
  NO_ACCOUNT = "NO_ACCOUNT",
174
194
  /**
175
- * A technical error at the bank rail prevented the transfer.
176
- * A subsequent payout attempt may succeed.
195
+ * A technical error at the bank rail prevented the transfer. A subsequent
196
+ * payout attempt may succeed.
177
197
  */
178
198
  TECHNICAL_ERROR = "TECHNICAL_ERROR"
179
199
  }
@@ -181,23 +201,30 @@ declare enum PayoutFailureCode {
181
201
  type PayoutFailureCodeWithLiterals = PayoutFailureCode | 'GENERIC_PAYOUT_FAILURE' | 'ACCOUNT_CLOSED' | 'ACCOUNT_FROZEN' | 'BANK_ACCOUNT_RESTRICTED' | 'BANK_OWNERSHIP_CHANGED' | 'COULD_NOT_PROCESS' | 'DEBIT_NOT_AUTHORIZED' | 'INCORRECT_ACCOUNT_HOLDER_NAME' | 'INVALID_ACCOUNT_DETAILS_CITY' | 'INVALID_ACCOUNT_NUMBER' | 'INVALID_CURRENCY' | 'INVALID_ROUTING_NUMBER' | 'INVALID_SORT_CODE' | 'NO_ACCOUNT' | 'TECHNICAL_ERROR';
182
202
  interface ListPayoutsRequest {
183
203
  /**
184
- * ID of the Wix Payments account whose payouts to list.
204
+ * ID of the Wix Payments account whose payouts to list. Retrieve account
205
+ * IDs from the Accounts API.
185
206
  * @format GUID
186
207
  */
187
208
  accountId: string;
188
209
  /**
189
- * Optional. When omitted, payouts across all profiles of the account are returned.
190
- * When set, only payouts belonging to the specified account profile are returned.
210
+ * ID of the Wix Payments account profile to filter by.
211
+ *
212
+ * When omitted, payouts across all profiles of the account are returned.
213
+ * Retrieve profile IDs from the Accounts API.
191
214
  * @format GUID
192
215
  */
193
216
  accountProfileId?: string | null;
194
- /** Optional. Returns only payouts created before this timestamp. */
217
+ /** Returns only payouts created before this date and time. */
195
218
  createdBefore?: Date | null;
196
- /** Optional. Returns only payouts created after this timestamp. */
219
+ /** Returns only payouts created after this date and time. */
197
220
  createdAfter?: Date | null;
198
- /** Optional. Sorting. Only `created_date` is supported; requests sorting by any other field are rejected with INVALID_ARGUMENT. */
221
+ /**
222
+ * Sort order for the result list.
223
+ *
224
+ * Supported `fieldName` values: `created_date` (snake_case, not auto-converted). At most 1 sort field is allowed.
225
+ */
199
226
  sort?: Sorting;
200
- /** Optional paging. Offset-based. */
227
+ /** Offset-based paging. */
201
228
  paging?: Paging;
202
229
  }
203
230
  interface Sorting {
@@ -222,7 +249,7 @@ interface Paging {
222
249
  offset?: number | null;
223
250
  }
224
251
  interface ListPayoutsResponse {
225
- /** List of payouts. */
252
+ /** List of retrieved payouts. */
226
253
  payouts?: Payout[];
227
254
  /** Paging metadata. */
228
255
  metadata?: PagingMetadata;
@@ -238,16 +265,17 @@ interface PagingMetadata {
238
265
  tooManyToCount?: boolean | null;
239
266
  }
240
267
  interface CreatePayoutRequest {
241
- /** Payout. */
268
+ /** Payout to create. */
242
269
  payout?: Payout;
243
270
  }
244
271
  interface CreatePayoutResponse {
245
- /** Payout. */
272
+ /** Created payout. */
246
273
  payout?: Payout;
247
274
  }
248
275
  interface GetPayoutRequest {
249
276
  /**
250
- * ID of the Wix Payments account the payout belongs to.
277
+ * ID of the Wix Payments account that owns the payout. The payout must
278
+ * belong to this account. Retrieve account IDs from the Accounts API.
251
279
  * @format GUID
252
280
  */
253
281
  accountId: string;
@@ -258,12 +286,13 @@ interface GetPayoutRequest {
258
286
  payoutId: string;
259
287
  }
260
288
  interface GetPayoutResponse {
261
- /** Payout. */
289
+ /** Retrieved payout. */
262
290
  payout?: Payout;
263
291
  }
264
292
  interface ListPayoutGroupsRequest {
265
293
  /**
266
- * Wix Payments account identifier.
294
+ * ID of the Wix Payments account whose payout groups to list. Retrieve
295
+ * account IDs from the Accounts API.
267
296
  * @format GUID
268
297
  */
269
298
  accountId?: string;
@@ -311,7 +340,8 @@ interface PayoutGroup {
311
340
  }
312
341
  interface GetPayoutGroupRequest {
313
342
  /**
314
- * Wix Payments account identifier.
343
+ * ID of the Wix Payments account that owns the payout group. Retrieve
344
+ * account IDs from the Accounts API.
315
345
  * @format GUID
316
346
  */
317
347
  accountId?: string;
@@ -333,12 +363,13 @@ interface GetPayoutGroupResponse {
333
363
  }
334
364
  interface GetPayoutGroupByPayoutIdRequest {
335
365
  /**
336
- * Wix Payments account identifier.
366
+ * ID of the Wix Payments account that owns the payout. Retrieve account IDs
367
+ * from the Accounts API.
337
368
  * @format GUID
338
369
  */
339
370
  accountId?: string;
340
371
  /**
341
- * Payout identifier.
372
+ * ID of the payout whose group to retrieve.
342
373
  * @format GUID
343
374
  */
344
375
  payoutId?: string;
@@ -560,9 +591,11 @@ interface PayoutCreatedEnvelope {
560
591
  metadata: EventMetadata;
561
592
  }
562
593
  /**
563
- * Emitted once when the payout is first persisted, before the underlying transfer
564
- * is initiated at the bank. At this point `status` is SENT and `estimated_arrival_date`
565
- * is set if the bank rail returned one; `failure_reason` and `bank_transfer_reference`
594
+ * Triggered when a payout is created.
595
+ *
596
+ * The payout is created before the underlying transfer is initiated at the
597
+ * bank. At this point `status` is `SENT` and `estimatedArrivalDateV2` is set
598
+ * if the bank rail returned one. `failureReason` and `bankTransferReference`
566
599
  * are not yet populated.
567
600
  * @permissionScope View settlement reports and payouts
568
601
  * @permissionScopeId SCOPE.PAYMENTS.PAYOUTS-VIEW-FOR-SITE
@@ -579,10 +612,12 @@ interface PayoutUpdatedEnvelope {
579
612
  metadata: EventMetadata;
580
613
  }
581
614
  /**
582
- * Emitted on every change to a persisted payout. Typical transitions include:
583
- * status moving from SENT to FAILED (and the corresponding `failure_reason` being set),
584
- * `estimated_arrival_date` being updated by the bank rail, and `bank_transfer_reference`
585
- * being populated once the rail returns it.
615
+ * Triggered when a payout is updated.
616
+ *
617
+ * Typical updates include `status` transitioning from `SENT` to `FAILED`
618
+ * (with `failureReason` being set), `estimatedArrivalDateV2` being refined by
619
+ * the bank rail, and `bankTransferReference` being populated once the rail
620
+ * returns it.
586
621
  * @permissionScope View settlement reports and payouts
587
622
  * @permissionScopeId SCOPE.PAYMENTS.PAYOUTS-VIEW-FOR-SITE
588
623
  * @permissionId PAYMENTS.PAYOUT_READ
@@ -594,9 +629,11 @@ interface PayoutUpdatedEnvelope {
594
629
  */
595
630
  declare function onPayoutUpdated(handler: (event: PayoutUpdatedEnvelope) => void | Promise<void>): void;
596
631
  /**
597
- * Retrieves a paginated list of payouts for the specified Wix Payments account,
598
- * with optional filters by profile and creation date.
599
- * @param accountId - ID of the Wix Payments account whose payouts to list.
632
+ * Retrieves a paginated list of payouts for the specified Wix Payments account.
633
+ *
634
+ * Supports optional filters by account profile and by creation date range.
635
+ * @param accountId - ID of the Wix Payments account whose payouts to list. Retrieve account
636
+ * IDs from the Accounts API.
600
637
  * @public
601
638
  * @documentationMaturity preview
602
639
  * @requiredField accountId
@@ -607,31 +644,38 @@ declare function onPayoutUpdated(handler: (event: PayoutUpdatedEnvelope) => void
607
644
  declare function listPayouts(accountId: string, options?: ListPayoutsOptions): Promise<NonNullablePaths<ListPayoutsResponse, `payouts` | `payouts.${number}._id` | `payouts.${number}.accountId` | `payouts.${number}.accountProfileId` | `payouts.${number}.amount.value` | `payouts.${number}.amount.currency` | `payouts.${number}.status` | `payouts.${number}.failureReason.code` | `payouts.${number}.cashAdvanceIncluded`, 5>>;
608
645
  interface ListPayoutsOptions {
609
646
  /**
610
- * Optional. When omitted, payouts across all profiles of the account are returned.
611
- * When set, only payouts belonging to the specified account profile are returned.
647
+ * ID of the Wix Payments account profile to filter by.
648
+ *
649
+ * When omitted, payouts across all profiles of the account are returned.
650
+ * Retrieve profile IDs from the Accounts API.
612
651
  * @format GUID
613
652
  */
614
653
  accountProfileId?: string | null;
615
- /** Optional. Returns only payouts created before this timestamp. */
654
+ /** Returns only payouts created before this date and time. */
616
655
  createdBefore?: Date | null;
617
- /** Optional. Returns only payouts created after this timestamp. */
656
+ /** Returns only payouts created after this date and time. */
618
657
  createdAfter?: Date | null;
619
- /** Optional. Sorting. Only `created_date` is supported; requests sorting by any other field are rejected with INVALID_ARGUMENT. */
658
+ /**
659
+ * Sort order for the result list.
660
+ *
661
+ * Supported `fieldName` values: `created_date` (snake_case, not auto-converted). At most 1 sort field is allowed.
662
+ */
620
663
  sort?: Sorting;
621
- /** Optional paging. Offset-based. */
664
+ /** Offset-based paging. */
622
665
  paging?: Paging;
623
666
  }
624
667
  /**
625
- * Retrieves a single payout by id.
668
+ * Retrieves a single payout by ID.
626
669
  * @param payoutId - ID of the payout to retrieve.
627
- * @param accountId - ID of the Wix Payments account the payout belongs to.
670
+ * @param accountId - ID of the Wix Payments account that owns the payout. The payout must
671
+ * belong to this account. Retrieve account IDs from the Accounts API.
628
672
  * @public
629
673
  * @documentationMaturity preview
630
674
  * @requiredField accountId
631
675
  * @requiredField payoutId
632
676
  * @permissionId PAYMENTS.PAYOUT_READ
633
677
  * @applicableIdentity APP
634
- * @returns Payout.
678
+ * @returns Retrieved payout.
635
679
  * @fqn wix.payments.v4.payouts.PayoutsService.GetPayout
636
680
  */
637
681
  declare function getPayout(payoutId: string, accountId: string): Promise<NonNullablePaths<Payout, `_id` | `accountId` | `accountProfileId` | `amount.value` | `amount.currency` | `status` | `failureReason.code` | `cashAdvanceIncluded`, 3>>;