@whop/sdk 0.0.6 → 0.0.8

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 (119) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/client.d.mts +19 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +19 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/access-tokens.d.mts +48 -26
  12. package/resources/access-tokens.d.mts.map +1 -1
  13. package/resources/access-tokens.d.ts +48 -26
  14. package/resources/access-tokens.d.ts.map +1 -1
  15. package/resources/access-tokens.js +5 -5
  16. package/resources/access-tokens.mjs +5 -5
  17. package/resources/apps.d.mts +17 -1
  18. package/resources/apps.d.mts.map +1 -1
  19. package/resources/apps.d.ts +17 -1
  20. package/resources/apps.d.ts.map +1 -1
  21. package/resources/checkout-configurations.d.mts +169 -12
  22. package/resources/checkout-configurations.d.mts.map +1 -1
  23. package/resources/checkout-configurations.d.ts +169 -12
  24. package/resources/checkout-configurations.d.ts.map +1 -1
  25. package/resources/checkout-configurations.js +1 -0
  26. package/resources/checkout-configurations.js.map +1 -1
  27. package/resources/checkout-configurations.mjs +1 -0
  28. package/resources/checkout-configurations.mjs.map +1 -1
  29. package/resources/course-lessons.d.mts +199 -1
  30. package/resources/course-lessons.d.mts.map +1 -1
  31. package/resources/course-lessons.d.ts +199 -1
  32. package/resources/course-lessons.d.ts.map +1 -1
  33. package/resources/course-lessons.js +40 -0
  34. package/resources/course-lessons.js.map +1 -1
  35. package/resources/course-lessons.mjs +40 -0
  36. package/resources/course-lessons.mjs.map +1 -1
  37. package/resources/courses.d.mts +8 -0
  38. package/resources/courses.d.mts.map +1 -1
  39. package/resources/courses.d.ts +8 -0
  40. package/resources/courses.d.ts.map +1 -1
  41. package/resources/disputes.d.mts +704 -0
  42. package/resources/disputes.d.mts.map +1 -0
  43. package/resources/disputes.d.ts +704 -0
  44. package/resources/disputes.d.ts.map +1 -0
  45. package/resources/disputes.js +77 -0
  46. package/resources/disputes.js.map +1 -0
  47. package/resources/disputes.mjs +73 -0
  48. package/resources/disputes.mjs.map +1 -0
  49. package/resources/forum-posts.d.mts +13 -1
  50. package/resources/forum-posts.d.mts.map +1 -1
  51. package/resources/forum-posts.d.ts +13 -1
  52. package/resources/forum-posts.d.ts.map +1 -1
  53. package/resources/index.d.mts +8 -5
  54. package/resources/index.d.mts.map +1 -1
  55. package/resources/index.d.ts +8 -5
  56. package/resources/index.d.ts.map +1 -1
  57. package/resources/index.js +7 -1
  58. package/resources/index.js.map +1 -1
  59. package/resources/index.mjs +3 -0
  60. package/resources/index.mjs.map +1 -1
  61. package/resources/ledger-accounts.d.mts +1 -1
  62. package/resources/ledger-accounts.d.mts.map +1 -1
  63. package/resources/ledger-accounts.d.ts +1 -1
  64. package/resources/ledger-accounts.d.ts.map +1 -1
  65. package/resources/payments.d.mts +1 -1
  66. package/resources/payments.d.mts.map +1 -1
  67. package/resources/payments.d.ts +1 -1
  68. package/resources/payments.d.ts.map +1 -1
  69. package/resources/refunds.d.mts +295 -0
  70. package/resources/refunds.d.mts.map +1 -0
  71. package/resources/refunds.d.ts +295 -0
  72. package/resources/refunds.d.ts.map +1 -0
  73. package/resources/refunds.js +34 -0
  74. package/resources/refunds.js.map +1 -0
  75. package/resources/refunds.mjs +30 -0
  76. package/resources/refunds.mjs.map +1 -0
  77. package/resources/shared.d.mts +46 -5
  78. package/resources/shared.d.mts.map +1 -1
  79. package/resources/shared.d.ts +46 -5
  80. package/resources/shared.d.ts.map +1 -1
  81. package/resources/shipments.d.mts +1 -1
  82. package/resources/shipments.d.mts.map +1 -1
  83. package/resources/shipments.d.ts +1 -1
  84. package/resources/shipments.d.ts.map +1 -1
  85. package/resources/webhooks.d.mts +427 -2
  86. package/resources/webhooks.d.mts.map +1 -1
  87. package/resources/webhooks.d.ts +427 -2
  88. package/resources/webhooks.d.ts.map +1 -1
  89. package/resources/webhooks.js.map +1 -1
  90. package/resources/webhooks.mjs.map +1 -1
  91. package/resources/withdrawals.d.mts +233 -0
  92. package/resources/withdrawals.d.mts.map +1 -0
  93. package/resources/withdrawals.d.ts +233 -0
  94. package/resources/withdrawals.d.ts.map +1 -0
  95. package/resources/withdrawals.js +31 -0
  96. package/resources/withdrawals.js.map +1 -0
  97. package/resources/withdrawals.mjs +27 -0
  98. package/resources/withdrawals.mjs.map +1 -0
  99. package/src/client.ts +93 -0
  100. package/src/resources/access-tokens.ts +53 -26
  101. package/src/resources/apps.ts +21 -0
  102. package/src/resources/checkout-configurations.ts +193 -12
  103. package/src/resources/course-lessons.ts +250 -0
  104. package/src/resources/courses.ts +10 -0
  105. package/src/resources/disputes.ts +873 -0
  106. package/src/resources/forum-posts.ts +16 -0
  107. package/src/resources/index.ts +42 -0
  108. package/src/resources/ledger-accounts.ts +1 -0
  109. package/src/resources/payments.ts +1 -0
  110. package/src/resources/refunds.ts +383 -0
  111. package/src/resources/shared.ts +62 -5
  112. package/src/resources/shipments.ts +1 -1
  113. package/src/resources/webhooks.ts +522 -1
  114. package/src/resources/withdrawals.ts +361 -0
  115. package/src/version.ts +1 -1
  116. package/version.d.mts +1 -1
  117. package/version.d.ts +1 -1
  118. package/version.js +1 -1
  119. package/version.mjs +1 -1
@@ -0,0 +1,233 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import * as Shared from "./shared.mjs";
3
+ import { APIPromise } from "../core/api-promise.mjs";
4
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.mjs";
5
+ import { RequestOptions } from "../internal/request-options.mjs";
6
+ export declare class Withdrawals extends APIResource {
7
+ /**
8
+ * Retrieves a withdrawal by ID
9
+ *
10
+ * Required permissions:
11
+ *
12
+ * - `payout:withdrawal:read`
13
+ */
14
+ retrieve(id: string, options?: RequestOptions): APIPromise<WithdrawalRetrieveResponse>;
15
+ /**
16
+ * Lists withdrawals
17
+ *
18
+ * Required permissions:
19
+ *
20
+ * - `payout:withdrawal:read`
21
+ */
22
+ list(query: WithdrawalListParams, options?: RequestOptions): PagePromise<WithdrawalListResponsesCursorPage, WithdrawalListResponse>;
23
+ }
24
+ export type WithdrawalListResponsesCursorPage = CursorPage<WithdrawalListResponse>;
25
+ /**
26
+ * The different fee types for a withdrawal.
27
+ */
28
+ export type WithdrawalFeeTypes = 'exclusive' | 'inclusive';
29
+ /**
30
+ * The different speeds of withdrawals
31
+ */
32
+ export type WithdrawalSpeeds = 'standard' | 'instant';
33
+ /**
34
+ * The status of a withdrawal request
35
+ */
36
+ export type WithdrawalStatus = 'requested' | 'awaiting_payment' | 'in_transit' | 'completed' | 'failed' | 'canceled' | 'denied';
37
+ /**
38
+ * The types of withdrawals
39
+ */
40
+ export type WithdrawalTypes = 'regular' | 'clawback';
41
+ /**
42
+ * A withdrawal request.
43
+ */
44
+ export interface WithdrawalRetrieveResponse {
45
+ /**
46
+ * Internal ID of the withdrawal request.
47
+ */
48
+ id: string;
49
+ /**
50
+ * How much money was attempted to be withdrawn, in a float type.
51
+ */
52
+ amount: number;
53
+ /**
54
+ * When the withdrawal request was created.
55
+ */
56
+ created_at: string;
57
+ /**
58
+ * The currency of the withdrawal request.
59
+ */
60
+ currency: Shared.Currency;
61
+ /**
62
+ * The fee amount that was charged for the withdrawal. This is in the same currency
63
+ * as the withdrawal amount.
64
+ */
65
+ fee_amount: number;
66
+ /**
67
+ * The different fee types for a withdrawal.
68
+ */
69
+ fee_type: WithdrawalFeeTypes | null;
70
+ /**
71
+ * The latest payout associated with this withdrawal, if any.
72
+ */
73
+ latest_payout: WithdrawalRetrieveResponse.LatestPayout | null;
74
+ /**
75
+ * The payout token used for the withdrawal, if applicable.
76
+ */
77
+ payout_token: WithdrawalRetrieveResponse.PayoutToken | null;
78
+ /**
79
+ * The speed of the withdrawal.
80
+ */
81
+ speed: WithdrawalSpeeds;
82
+ /**
83
+ * Status of the withdrawal.
84
+ */
85
+ status: WithdrawalStatus;
86
+ /**
87
+ * The type of withdrawal.
88
+ */
89
+ withdrawal_type: WithdrawalTypes;
90
+ }
91
+ export declare namespace WithdrawalRetrieveResponse {
92
+ /**
93
+ * The latest payout associated with this withdrawal, if any.
94
+ */
95
+ interface LatestPayout {
96
+ /**
97
+ * The internal ID of the payout.
98
+ */
99
+ id: string;
100
+ /**
101
+ * The date and time the payout was created.
102
+ */
103
+ created_at: string;
104
+ /**
105
+ * The different error codes a payout can be in.
106
+ */
107
+ error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | null;
108
+ /**
109
+ * The error message for the payout.
110
+ */
111
+ error_message: string | null;
112
+ /**
113
+ * The estimated availability date of the payout.
114
+ */
115
+ estimated_availability: string | null;
116
+ /**
117
+ * The name of the payer for the payout.
118
+ */
119
+ payer_name: string | null;
120
+ /**
121
+ * The status of the payout.
122
+ */
123
+ status: 'scheduled' | 'pending' | 'processing' | 'completed' | 'canceled' | 'ready_for_pickup' | 'hold' | 'error' | 'expired';
124
+ /**
125
+ * The trace code for the payout, if applicable. Provided on ACH transactions when
126
+ * available.
127
+ */
128
+ trace_code: string | null;
129
+ }
130
+ /**
131
+ * The payout token used for the withdrawal, if applicable.
132
+ */
133
+ interface PayoutToken {
134
+ /**
135
+ * The ID of the payout token
136
+ */
137
+ id: string;
138
+ /**
139
+ * The date and time the payout token was created
140
+ */
141
+ created_at: string;
142
+ /**
143
+ * The currency code of the payout destination. This is the currency that payouts
144
+ * will be made in for this token.
145
+ */
146
+ destination_currency_code: string;
147
+ /**
148
+ * An optional nickname for the payout token to help the user identify it. This is
149
+ * not used by the provider and is only for the user's reference.
150
+ */
151
+ nickname: string | null;
152
+ /**
153
+ * The status of the payout token.
154
+ */
155
+ status: 'created' | 'active' | 'broken';
156
+ }
157
+ }
158
+ /**
159
+ * A withdrawal request.
160
+ */
161
+ export interface WithdrawalListResponse {
162
+ /**
163
+ * Internal ID of the withdrawal request.
164
+ */
165
+ id: string;
166
+ /**
167
+ * How much money was attempted to be withdrawn, in a float type.
168
+ */
169
+ amount: number;
170
+ /**
171
+ * When the withdrawal request was created.
172
+ */
173
+ created_at: string;
174
+ /**
175
+ * The currency of the withdrawal request.
176
+ */
177
+ currency: Shared.Currency;
178
+ /**
179
+ * The fee amount that was charged for the withdrawal. This is in the same currency
180
+ * as the withdrawal amount.
181
+ */
182
+ fee_amount: number;
183
+ /**
184
+ * The different fee types for a withdrawal.
185
+ */
186
+ fee_type: WithdrawalFeeTypes | null;
187
+ /**
188
+ * The speed of the withdrawal.
189
+ */
190
+ speed: WithdrawalSpeeds;
191
+ /**
192
+ * Status of the withdrawal.
193
+ */
194
+ status: WithdrawalStatus;
195
+ /**
196
+ * The type of withdrawal.
197
+ */
198
+ withdrawal_type: WithdrawalTypes;
199
+ }
200
+ export interface WithdrawalListParams extends CursorPageParams {
201
+ /**
202
+ * The ID of the company to list withdrawals for
203
+ */
204
+ company_id: string;
205
+ /**
206
+ * Returns the elements in the list that come before the specified cursor.
207
+ */
208
+ before?: string | null;
209
+ /**
210
+ * The minimum creation date to filter by
211
+ */
212
+ created_after?: string | null;
213
+ /**
214
+ * The maximum creation date to filter by
215
+ */
216
+ created_before?: string | null;
217
+ /**
218
+ * The direction of the sort.
219
+ */
220
+ direction?: Shared.Direction | null;
221
+ /**
222
+ * Returns the first _n_ elements from the list.
223
+ */
224
+ first?: number | null;
225
+ /**
226
+ * Returns the last _n_ elements from the list.
227
+ */
228
+ last?: number | null;
229
+ }
230
+ export declare namespace Withdrawals {
231
+ export { type WithdrawalFeeTypes as WithdrawalFeeTypes, type WithdrawalSpeeds as WithdrawalSpeeds, type WithdrawalStatus as WithdrawalStatus, type WithdrawalTypes as WithdrawalTypes, type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse, type WithdrawalListResponse as WithdrawalListResponse, type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage, type WithdrawalListParams as WithdrawalListParams, };
232
+ }
233
+ //# sourceMappingURL=withdrawals.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawals.d.mts","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAItF;;;;;;OAMG;IACH,IAAI,CACF,KAAK,EAAE,oBAAoB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,iCAAiC,EAAE,sBAAsB,CAAC;CAG1E;AAED,MAAM,MAAM,iCAAiC,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAEnF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,G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IResource } from "../core/resource.js";
2
+ import * as Shared from "./shared.js";
3
+ import { APIPromise } from "../core/api-promise.js";
4
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js";
5
+ import { RequestOptions } from "../internal/request-options.js";
6
+ export declare class Withdrawals extends APIResource {
7
+ /**
8
+ * Retrieves a withdrawal by ID
9
+ *
10
+ * Required permissions:
11
+ *
12
+ * - `payout:withdrawal:read`
13
+ */
14
+ retrieve(id: string, options?: RequestOptions): APIPromise<WithdrawalRetrieveResponse>;
15
+ /**
16
+ * Lists withdrawals
17
+ *
18
+ * Required permissions:
19
+ *
20
+ * - `payout:withdrawal:read`
21
+ */
22
+ list(query: WithdrawalListParams, options?: RequestOptions): PagePromise<WithdrawalListResponsesCursorPage, WithdrawalListResponse>;
23
+ }
24
+ export type WithdrawalListResponsesCursorPage = CursorPage<WithdrawalListResponse>;
25
+ /**
26
+ * The different fee types for a withdrawal.
27
+ */
28
+ export type WithdrawalFeeTypes = 'exclusive' | 'inclusive';
29
+ /**
30
+ * The different speeds of withdrawals
31
+ */
32
+ export type WithdrawalSpeeds = 'standard' | 'instant';
33
+ /**
34
+ * The status of a withdrawal request
35
+ */
36
+ export type WithdrawalStatus = 'requested' | 'awaiting_payment' | 'in_transit' | 'completed' | 'failed' | 'canceled' | 'denied';
37
+ /**
38
+ * The types of withdrawals
39
+ */
40
+ export type WithdrawalTypes = 'regular' | 'clawback';
41
+ /**
42
+ * A withdrawal request.
43
+ */
44
+ export interface WithdrawalRetrieveResponse {
45
+ /**
46
+ * Internal ID of the withdrawal request.
47
+ */
48
+ id: string;
49
+ /**
50
+ * How much money was attempted to be withdrawn, in a float type.
51
+ */
52
+ amount: number;
53
+ /**
54
+ * When the withdrawal request was created.
55
+ */
56
+ created_at: string;
57
+ /**
58
+ * The currency of the withdrawal request.
59
+ */
60
+ currency: Shared.Currency;
61
+ /**
62
+ * The fee amount that was charged for the withdrawal. This is in the same currency
63
+ * as the withdrawal amount.
64
+ */
65
+ fee_amount: number;
66
+ /**
67
+ * The different fee types for a withdrawal.
68
+ */
69
+ fee_type: WithdrawalFeeTypes | null;
70
+ /**
71
+ * The latest payout associated with this withdrawal, if any.
72
+ */
73
+ latest_payout: WithdrawalRetrieveResponse.LatestPayout | null;
74
+ /**
75
+ * The payout token used for the withdrawal, if applicable.
76
+ */
77
+ payout_token: WithdrawalRetrieveResponse.PayoutToken | null;
78
+ /**
79
+ * The speed of the withdrawal.
80
+ */
81
+ speed: WithdrawalSpeeds;
82
+ /**
83
+ * Status of the withdrawal.
84
+ */
85
+ status: WithdrawalStatus;
86
+ /**
87
+ * The type of withdrawal.
88
+ */
89
+ withdrawal_type: WithdrawalTypes;
90
+ }
91
+ export declare namespace WithdrawalRetrieveResponse {
92
+ /**
93
+ * The latest payout associated with this withdrawal, if any.
94
+ */
95
+ interface LatestPayout {
96
+ /**
97
+ * The internal ID of the payout.
98
+ */
99
+ id: string;
100
+ /**
101
+ * The date and time the payout was created.
102
+ */
103
+ created_at: string;
104
+ /**
105
+ * The different error codes a payout can be in.
106
+ */
107
+ error_code: 'account_closed' | 'account_does_not_exist' | 'account_information_invalid' | 'account_number_invalid_region' | 'account_frozen' | 'account_lookup_failed' | 'account_not_found' | 'amount_out_of_bounds' | 'attributes_not_validated' | 'b2b_payments_prohibited' | 'bank_statement_required' | 'compliance_review' | 'currency_not_supported' | 'deposit_canceled' | 'deposit_failed' | 'deposit_rejected' | 'destination_unavailable' | 'exceeded_account_limit' | 'expired_quote' | 'generic_payout_error' | 'technical_problem' | 'identification_number_invalid' | 'invalid_account_number' | 'invalid_bank_code' | 'invalid_beneficiary' | 'invalid_branch_number' | 'invalid_branch_code' | 'invalid_phone_number' | 'invalid_routing_number' | 'invalid_swift_code' | 'invalid_company_details' | 'manual_cancelation' | 'misc_error' | 'missing_city_and_country' | 'missing_phone_number' | 'missing_remittance_info' | 'payee_name_invalid' | 'receiving_account_locked' | 'rejected_by_compliance' | 'rtp_not_supported' | 'non_transaction_account' | 'source_token_insufficient_funds' | 'ssn_invalid' | 'wallet_screenshot_required' | 'unsupported_region' | null;
108
+ /**
109
+ * The error message for the payout.
110
+ */
111
+ error_message: string | null;
112
+ /**
113
+ * The estimated availability date of the payout.
114
+ */
115
+ estimated_availability: string | null;
116
+ /**
117
+ * The name of the payer for the payout.
118
+ */
119
+ payer_name: string | null;
120
+ /**
121
+ * The status of the payout.
122
+ */
123
+ status: 'scheduled' | 'pending' | 'processing' | 'completed' | 'canceled' | 'ready_for_pickup' | 'hold' | 'error' | 'expired';
124
+ /**
125
+ * The trace code for the payout, if applicable. Provided on ACH transactions when
126
+ * available.
127
+ */
128
+ trace_code: string | null;
129
+ }
130
+ /**
131
+ * The payout token used for the withdrawal, if applicable.
132
+ */
133
+ interface PayoutToken {
134
+ /**
135
+ * The ID of the payout token
136
+ */
137
+ id: string;
138
+ /**
139
+ * The date and time the payout token was created
140
+ */
141
+ created_at: string;
142
+ /**
143
+ * The currency code of the payout destination. This is the currency that payouts
144
+ * will be made in for this token.
145
+ */
146
+ destination_currency_code: string;
147
+ /**
148
+ * An optional nickname for the payout token to help the user identify it. This is
149
+ * not used by the provider and is only for the user's reference.
150
+ */
151
+ nickname: string | null;
152
+ /**
153
+ * The status of the payout token.
154
+ */
155
+ status: 'created' | 'active' | 'broken';
156
+ }
157
+ }
158
+ /**
159
+ * A withdrawal request.
160
+ */
161
+ export interface WithdrawalListResponse {
162
+ /**
163
+ * Internal ID of the withdrawal request.
164
+ */
165
+ id: string;
166
+ /**
167
+ * How much money was attempted to be withdrawn, in a float type.
168
+ */
169
+ amount: number;
170
+ /**
171
+ * When the withdrawal request was created.
172
+ */
173
+ created_at: string;
174
+ /**
175
+ * The currency of the withdrawal request.
176
+ */
177
+ currency: Shared.Currency;
178
+ /**
179
+ * The fee amount that was charged for the withdrawal. This is in the same currency
180
+ * as the withdrawal amount.
181
+ */
182
+ fee_amount: number;
183
+ /**
184
+ * The different fee types for a withdrawal.
185
+ */
186
+ fee_type: WithdrawalFeeTypes | null;
187
+ /**
188
+ * The speed of the withdrawal.
189
+ */
190
+ speed: WithdrawalSpeeds;
191
+ /**
192
+ * Status of the withdrawal.
193
+ */
194
+ status: WithdrawalStatus;
195
+ /**
196
+ * The type of withdrawal.
197
+ */
198
+ withdrawal_type: WithdrawalTypes;
199
+ }
200
+ export interface WithdrawalListParams extends CursorPageParams {
201
+ /**
202
+ * The ID of the company to list withdrawals for
203
+ */
204
+ company_id: string;
205
+ /**
206
+ * Returns the elements in the list that come before the specified cursor.
207
+ */
208
+ before?: string | null;
209
+ /**
210
+ * The minimum creation date to filter by
211
+ */
212
+ created_after?: string | null;
213
+ /**
214
+ * The maximum creation date to filter by
215
+ */
216
+ created_before?: string | null;
217
+ /**
218
+ * The direction of the sort.
219
+ */
220
+ direction?: Shared.Direction | null;
221
+ /**
222
+ * Returns the first _n_ elements from the list.
223
+ */
224
+ first?: number | null;
225
+ /**
226
+ * Returns the last _n_ elements from the list.
227
+ */
228
+ last?: number | null;
229
+ }
230
+ export declare namespace Withdrawals {
231
+ export { type WithdrawalFeeTypes as WithdrawalFeeTypes, type WithdrawalSpeeds as WithdrawalSpeeds, type WithdrawalStatus as WithdrawalStatus, type WithdrawalTypes as WithdrawalTypes, type WithdrawalRetrieveResponse as WithdrawalRetrieveResponse, type WithdrawalListResponse as WithdrawalListResponse, type WithdrawalListResponsesCursorPage as WithdrawalListResponsesCursorPage, type WithdrawalListParams as WithdrawalListParams, };
232
+ }
233
+ //# sourceMappingURL=withdrawals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawals.d.ts","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;OAMG;IACH,QAAQ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W,CAAC;IACnC,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Withdrawals = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const pagination_1 = require("../core/pagination.js");
7
+ const path_1 = require("../internal/utils/path.js");
8
+ class Withdrawals extends resource_1.APIResource {
9
+ /**
10
+ * Retrieves a withdrawal by ID
11
+ *
12
+ * Required permissions:
13
+ *
14
+ * - `payout:withdrawal:read`
15
+ */
16
+ retrieve(id, options) {
17
+ return this._client.get((0, path_1.path) `/withdrawals/${id}`, options);
18
+ }
19
+ /**
20
+ * Lists withdrawals
21
+ *
22
+ * Required permissions:
23
+ *
24
+ * - `payout:withdrawal:read`
25
+ */
26
+ list(query, options) {
27
+ return this._client.getAPIList('/withdrawals', (pagination_1.CursorPage), { query, ...options });
28
+ }
29
+ }
30
+ exports.Withdrawals = Withdrawals;
31
+ //# sourceMappingURL=withdrawals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawals.js","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,KAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,uBAAkC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF;AAzBD,kCAyBC"}
@@ -0,0 +1,27 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { CursorPage } from "../core/pagination.mjs";
4
+ import { path } from "../internal/utils/path.mjs";
5
+ export class Withdrawals extends APIResource {
6
+ /**
7
+ * Retrieves a withdrawal by ID
8
+ *
9
+ * Required permissions:
10
+ *
11
+ * - `payout:withdrawal:read`
12
+ */
13
+ retrieve(id, options) {
14
+ return this._client.get(path `/withdrawals/${id}`, options);
15
+ }
16
+ /**
17
+ * Lists withdrawals
18
+ *
19
+ * Required permissions:
20
+ *
21
+ * - `payout:withdrawal:read`
22
+ */
23
+ list(query, options) {
24
+ return this._client.getAPIList('/withdrawals', (CursorPage), { query, ...options });
25
+ }
26
+ }
27
+ //# sourceMappingURL=withdrawals.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withdrawals.mjs","sourceRoot":"","sources":["../src/resources/withdrawals.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,KAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,UAAkC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF"}