@tolt/api 0.6.1 → 0.7.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.
- package/dist/api/errors/ContentTooLargeError.d.ts +7 -0
- package/dist/api/errors/ContentTooLargeError.js +17 -0
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/resources/clicks/client/Client.d.ts +6 -1
- package/dist/api/resources/clicks/client/Client.js +15 -4
- package/dist/api/resources/clicks/client/requests/GetClicksRequest.d.ts +1 -1
- package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +10 -5
- package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +1 -0
- package/dist/api/resources/clicks/types/ListClicksRequestOrder.js +1 -0
- package/dist/api/resources/clicks/types/ListClicksRequestSort.d.ts +1 -1
- package/dist/api/resources/clicks/types/ListClicksRequestSort.js +1 -1
- package/dist/api/resources/commissions/client/Client.d.ts +29 -7
- package/dist/api/resources/commissions/client/Client.js +56 -16
- package/dist/api/resources/commissions/client/requests/ApproveCommissionsRequest.d.ts +1 -1
- package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.d.ts +2 -2
- package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.d.ts +2 -2
- package/dist/api/resources/commissions/client/requests/DeclineCommissionsRequest.d.ts +1 -1
- package/dist/api/resources/commissions/client/requests/DeleteCommissionsRequest.d.ts +1 -1
- package/dist/api/resources/commissions/client/requests/GetCommissionsRequest.d.ts +1 -1
- package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +14 -5
- package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.d.ts +19 -4
- package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.js +8 -1
- package/dist/api/resources/commissions/client/requests/index.d.ts +1 -1
- package/dist/api/resources/commissions/client/requests/index.js +1 -1
- package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.d.ts +1 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.js +1 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestSort.d.ts +1 -1
- package/dist/api/resources/commissions/types/ListCommissionsRequestSort.js +1 -1
- package/dist/api/resources/customers/client/Client.d.ts +27 -4
- package/dist/api/resources/customers/client/Client.js +42 -9
- package/dist/api/resources/customers/client/requests/CreateCustomersRequest.d.ts +20 -2
- package/dist/api/resources/customers/client/requests/CreateCustomersRequest.js +1 -0
- package/dist/api/resources/customers/client/requests/DeleteCustomersRequest.d.ts +1 -1
- package/dist/api/resources/customers/client/requests/GetCustomersRequest.d.ts +1 -1
- package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +14 -5
- package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.d.ts +15 -2
- package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.js +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestOrder.d.ts +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestOrder.js +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestSort.d.ts +1 -1
- package/dist/api/resources/customers/types/ListCustomersRequestSort.js +1 -1
- package/dist/api/resources/customers/types/ListCustomersRequestStatus.d.ts +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestStatus.js +1 -0
- package/dist/api/resources/embed/client/Client.d.ts +5 -2
- package/dist/api/resources/embed/client/Client.js +9 -4
- package/dist/api/resources/embed/client/index.d.ts +1 -1
- package/dist/api/resources/embed/client/index.js +1 -1
- package/dist/api/resources/embed/types/CreateTokenEmbedRequest.d.ts +1 -0
- package/dist/api/resources/embed/types/index.d.ts +1 -0
- package/dist/api/resources/embed/types/index.js +1 -0
- package/dist/api/resources/flows/client/Client.d.ts +7 -1
- package/dist/api/resources/flows/client/Client.js +13 -3
- package/dist/api/resources/flows/client/requests/GetFlowsRequest.d.ts +1 -1
- package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +13 -5
- package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestActive.js +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestOrder.d.ts +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestOrder.js +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestSort.d.ts +1 -1
- package/dist/api/resources/flows/types/ListFlowsRequestSort.js +1 -1
- package/dist/api/resources/groups/client/Client.d.ts +7 -1
- package/dist/api/resources/groups/client/Client.js +13 -3
- package/dist/api/resources/groups/client/requests/GetGroupsRequest.d.ts +1 -1
- package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +10 -5
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestOrder.d.ts +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestOrder.js +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestSort.d.ts +1 -1
- package/dist/api/resources/groups/types/ListGroupsRequestSort.js +1 -1
- package/dist/api/resources/index.d.ts +0 -1
- package/dist/api/resources/index.js +0 -1
- package/dist/api/resources/links/client/Client.d.ts +17 -5
- package/dist/api/resources/links/client/Client.js +37 -11
- package/dist/api/resources/links/client/requests/CreateLinksRequest.d.ts +6 -2
- package/dist/api/resources/links/client/requests/DeleteLinksRequest.d.ts +1 -1
- package/dist/api/resources/links/client/requests/GetLinksRequest.d.ts +1 -1
- package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +12 -5
- package/dist/api/resources/links/client/requests/UpdateLinksRequest.d.ts +6 -2
- package/dist/api/resources/links/types/ListLinksRequestOrder.d.ts +1 -0
- package/dist/api/resources/links/types/ListLinksRequestOrder.js +1 -0
- package/dist/api/resources/links/types/ListLinksRequestSort.d.ts +1 -1
- package/dist/api/resources/links/types/ListLinksRequestSort.js +1 -1
- package/dist/api/resources/partners/client/Client.d.ts +39 -10
- package/dist/api/resources/partners/client/Client.js +66 -21
- package/dist/api/resources/partners/client/requests/ApprovePartnersRequest.d.ts +1 -1
- package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.d.ts +2 -2
- package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.d.ts +4 -2
- package/dist/api/resources/partners/client/requests/CreatePartnersRequest.d.ts +21 -7
- package/dist/api/resources/partners/client/requests/CreatePartnersRequest.js +1 -0
- package/dist/api/resources/partners/client/requests/GetPartnersRequest.d.ts +1 -1
- package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +11 -5
- package/dist/api/resources/partners/client/requests/RejectPartnersRequest.d.ts +2 -1
- package/dist/api/resources/partners/client/requests/SuspendPartnersRequest.d.ts +2 -1
- package/dist/api/resources/partners/client/requests/UpdatePartnersRequest.d.ts +10 -2
- package/dist/api/resources/partners/types/ListPartnersRequestOrder.d.ts +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestOrder.js +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestSort.d.ts +1 -1
- package/dist/api/resources/partners/types/ListPartnersRequestSort.js +1 -1
- package/dist/api/resources/partners/types/ListPartnersRequestStatus.d.ts +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestStatus.js +1 -0
- package/dist/api/resources/programs/client/Client.d.ts +7 -1
- package/dist/api/resources/programs/client/Client.js +13 -3
- package/dist/api/resources/programs/client/requests/GetProgramsRequest.d.ts +1 -1
- package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +8 -5
- package/dist/api/resources/programs/types/ListProgramsRequestOrder.d.ts +1 -0
- package/dist/api/resources/programs/types/ListProgramsRequestOrder.js +1 -0
- package/dist/api/resources/programs/types/ListProgramsRequestSort.d.ts +1 -1
- package/dist/api/resources/programs/types/ListProgramsRequestSort.js +1 -1
- package/dist/api/resources/promotionCodes/client/Client.d.ts +27 -5
- package/dist/api/resources/promotionCodes/client/Client.js +46 -10
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.d.ts +9 -2
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.js +1 -0
- package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodesRequest.d.ts +1 -1
- package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodesRequest.d.ts +1 -1
- package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +11 -5
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.d.ts +8 -1
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.js +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.d.ts +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.js +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.d.ts +1 -1
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.js +1 -1
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.d.ts +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.js +1 -0
- package/dist/api/resources/reports/client/Client.d.ts +15 -0
- package/dist/api/resources/reports/client/Client.js +30 -5
- package/dist/api/resources/reports/client/requests/CustomerStatsReportsRequest.d.ts +3 -0
- package/dist/api/resources/reports/client/requests/LinksReportsRequest.d.ts +8 -0
- package/dist/api/resources/reports/client/requests/OverviewReportsRequest.d.ts +3 -0
- package/dist/api/resources/reports/client/requests/PartnersReportsRequest.d.ts +8 -0
- package/dist/api/resources/reports/client/requests/TimeseriesReportsRequest.d.ts +5 -0
- package/dist/api/resources/reports/types/LinksReportsRequestOrder.d.ts +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestOrder.js +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestSort.d.ts +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestSort.js +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestOrder.d.ts +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestOrder.js +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestSort.d.ts +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestSort.js +1 -0
- package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.d.ts +1 -0
- package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.js +1 -0
- package/dist/api/resources/transactions/client/Client.d.ts +30 -7
- package/dist/api/resources/transactions/client/Client.js +53 -14
- package/dist/api/resources/transactions/client/requests/CreateTransactionsRequest.d.ts +17 -3
- package/dist/api/resources/transactions/client/requests/DeleteTransactionsRequest.d.ts +1 -1
- package/dist/api/resources/transactions/client/requests/GetTransactionsRequest.d.ts +1 -1
- package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +12 -5
- package/dist/api/resources/transactions/client/requests/RefundTransactionsRequest.d.ts +1 -1
- package/dist/api/resources/transactions/client/requests/RerunFlowsTransactionsRequest.d.ts +1 -1
- package/dist/api/resources/transactions/client/requests/UpdateTransactionsRequest.d.ts +13 -2
- package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.d.ts +1 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.js +1 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestSort.d.ts +1 -1
- package/dist/api/resources/transactions/types/ListTransactionsRequestSort.js +1 -1
- package/dist/api/types/Commission.d.ts +1 -1
- package/dist/api/types/Customer.d.ts +2 -2
- package/dist/api/types/Error_.d.ts +1 -0
- package/dist/api/types/Error_.js +1 -0
- package/dist/environments.d.ts +2 -2
- package/dist/environments.js +1 -1
- package/package.json +1 -1
- package/dist/api/resources/embed/client/requests/CreateTokenEmbedRequest.d.ts +0 -14
- package/dist/api/resources/embed/client/requests/index.d.ts +0 -1
- package/dist/api/resources/embed/client/requests/index.js +0 -1
- /package/dist/api/resources/embed/{client/requests → types}/CreateTokenEmbedRequest.js +0 -0
|
@@ -19,13 +19,14 @@ export class CommissionsClient {
|
|
|
19
19
|
*
|
|
20
20
|
* @throws {@link ToltApi.BadRequestError}
|
|
21
21
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
22
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
22
23
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
23
24
|
* @throws {@link errors.ToltApiError}
|
|
24
25
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
25
26
|
*
|
|
26
27
|
* @example
|
|
27
28
|
* await client.commissions.bulkApprove({
|
|
28
|
-
* ids: ["
|
|
29
|
+
* ids: ["comm_X85RLnefjTCNrypH4MA1PdSp", "comm_3RtV9kQ2mW8nX5pL1sB7cD4f"]
|
|
29
30
|
* })
|
|
30
31
|
*/
|
|
31
32
|
bulkApprove(request, requestOptions) {
|
|
@@ -37,7 +38,7 @@ export class CommissionsClient {
|
|
|
37
38
|
const _response = await core.fetcher({
|
|
38
39
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
39
40
|
(await core.Supplier.get(this._options.environment)) ??
|
|
40
|
-
environments.ToltApiEnvironment.
|
|
41
|
+
environments.ToltApiEnvironment.Default, "v2/commissions/bulk/approve"),
|
|
41
42
|
method: "POST",
|
|
42
43
|
headers: _headers,
|
|
43
44
|
contentType: "application/json",
|
|
@@ -62,6 +63,8 @@ export class CommissionsClient {
|
|
|
62
63
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
63
64
|
case 401:
|
|
64
65
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
66
|
+
case 413:
|
|
67
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
65
68
|
case 429:
|
|
66
69
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
67
70
|
default:
|
|
@@ -82,13 +85,14 @@ export class CommissionsClient {
|
|
|
82
85
|
*
|
|
83
86
|
* @throws {@link ToltApi.BadRequestError}
|
|
84
87
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
88
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
85
89
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
86
90
|
* @throws {@link errors.ToltApiError}
|
|
87
91
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
88
92
|
*
|
|
89
93
|
* @example
|
|
90
94
|
* await client.commissions.bulkDecline({
|
|
91
|
-
* ids: ["
|
|
95
|
+
* ids: ["comm_X85RLnefjTCNrypH4MA1PdSp", "comm_3RtV9kQ2mW8nX5pL1sB7cD4f"]
|
|
92
96
|
* })
|
|
93
97
|
*/
|
|
94
98
|
bulkDecline(request, requestOptions) {
|
|
@@ -100,7 +104,7 @@ export class CommissionsClient {
|
|
|
100
104
|
const _response = await core.fetcher({
|
|
101
105
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
102
106
|
(await core.Supplier.get(this._options.environment)) ??
|
|
103
|
-
environments.ToltApiEnvironment.
|
|
107
|
+
environments.ToltApiEnvironment.Default, "v2/commissions/bulk/decline"),
|
|
104
108
|
method: "POST",
|
|
105
109
|
headers: _headers,
|
|
106
110
|
contentType: "application/json",
|
|
@@ -125,6 +129,8 @@ export class CommissionsClient {
|
|
|
125
129
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
126
130
|
case 401:
|
|
127
131
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
132
|
+
case 413:
|
|
133
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
128
134
|
case 429:
|
|
129
135
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
130
136
|
default:
|
|
@@ -138,11 +144,14 @@ export class CommissionsClient {
|
|
|
138
144
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/commissions/bulk/decline");
|
|
139
145
|
}
|
|
140
146
|
/**
|
|
147
|
+
* Lists commissions. Filter by program, partner, customer, transaction, status or type, and page with cursors.
|
|
148
|
+
*
|
|
141
149
|
* @param {ToltApi.ListCommissionsRequest} request
|
|
142
150
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
143
151
|
*
|
|
144
152
|
* @throws {@link ToltApi.BadRequestError}
|
|
145
153
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
154
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
146
155
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
147
156
|
* @throws {@link errors.ToltApiError}
|
|
148
157
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
@@ -178,7 +187,7 @@ export class CommissionsClient {
|
|
|
178
187
|
const _response = await core.fetcher({
|
|
179
188
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
180
189
|
(await core.Supplier.get(this._options.environment)) ??
|
|
181
|
-
environments.ToltApiEnvironment.
|
|
190
|
+
environments.ToltApiEnvironment.Default, "v2/commissions"),
|
|
182
191
|
method: "GET",
|
|
183
192
|
headers: _headers,
|
|
184
193
|
queryString: core.url
|
|
@@ -201,6 +210,8 @@ export class CommissionsClient {
|
|
|
201
210
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
202
211
|
case 401:
|
|
203
212
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
213
|
+
case 413:
|
|
214
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
204
215
|
case 429:
|
|
205
216
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
206
217
|
default:
|
|
@@ -222,6 +233,7 @@ export class CommissionsClient {
|
|
|
222
233
|
* @throws {@link ToltApi.BadRequestError}
|
|
223
234
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
224
235
|
* @throws {@link ToltApi.ConflictError}
|
|
236
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
225
237
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
226
238
|
* @throws {@link errors.ToltApiError}
|
|
227
239
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
@@ -240,7 +252,7 @@ export class CommissionsClient {
|
|
|
240
252
|
const _response = await core.fetcher({
|
|
241
253
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
242
254
|
(await core.Supplier.get(this._options.environment)) ??
|
|
243
|
-
environments.ToltApiEnvironment.
|
|
255
|
+
environments.ToltApiEnvironment.Default, "v2/commissions"),
|
|
244
256
|
method: "POST",
|
|
245
257
|
headers: _headers,
|
|
246
258
|
contentType: "application/json",
|
|
@@ -264,6 +276,8 @@ export class CommissionsClient {
|
|
|
264
276
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
265
277
|
case 409:
|
|
266
278
|
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
279
|
+
case 413:
|
|
280
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
267
281
|
case 429:
|
|
268
282
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
269
283
|
default:
|
|
@@ -277,18 +291,21 @@ export class CommissionsClient {
|
|
|
277
291
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/commissions");
|
|
278
292
|
}
|
|
279
293
|
/**
|
|
294
|
+
* Gets a commission by ID, with its amount, status, type and partner, plus its customer and transaction when it has them.
|
|
295
|
+
*
|
|
280
296
|
* @param {ToltApi.GetCommissionsRequest} request
|
|
281
297
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
282
298
|
*
|
|
283
299
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
284
300
|
* @throws {@link ToltApi.NotFoundError}
|
|
301
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
285
302
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
286
303
|
* @throws {@link errors.ToltApiError}
|
|
287
304
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
288
305
|
*
|
|
289
306
|
* @example
|
|
290
307
|
* await client.commissions.get({
|
|
291
|
-
* id: "
|
|
308
|
+
* id: "comm_X85RLnefjTCNrypH4MA1PdSp"
|
|
292
309
|
* })
|
|
293
310
|
*/
|
|
294
311
|
get(request, requestOptions) {
|
|
@@ -301,7 +318,7 @@ export class CommissionsClient {
|
|
|
301
318
|
const _response = await core.fetcher({
|
|
302
319
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
303
320
|
(await core.Supplier.get(this._options.environment)) ??
|
|
304
|
-
environments.ToltApiEnvironment.
|
|
321
|
+
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id)}`),
|
|
305
322
|
method: "GET",
|
|
306
323
|
headers: _headers,
|
|
307
324
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -320,6 +337,8 @@ export class CommissionsClient {
|
|
|
320
337
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
321
338
|
case 404:
|
|
322
339
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
340
|
+
case 413:
|
|
341
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
323
342
|
case 429:
|
|
324
343
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
325
344
|
default:
|
|
@@ -342,13 +361,17 @@ export class CommissionsClient {
|
|
|
342
361
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
343
362
|
* @throws {@link ToltApi.NotFoundError}
|
|
344
363
|
* @throws {@link ToltApi.ConflictError}
|
|
364
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
345
365
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
346
366
|
* @throws {@link errors.ToltApiError}
|
|
347
367
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
348
368
|
*
|
|
349
369
|
* @example
|
|
350
370
|
* await client.commissions.update({
|
|
351
|
-
* id: "
|
|
371
|
+
* id: "comm_X85RLnefjTCNrypH4MA1PdSp",
|
|
372
|
+
* amount: 1000,
|
|
373
|
+
* revenue: 5000,
|
|
374
|
+
* status: "approved"
|
|
352
375
|
* })
|
|
353
376
|
*/
|
|
354
377
|
update(request, requestOptions) {
|
|
@@ -361,7 +384,7 @@ export class CommissionsClient {
|
|
|
361
384
|
const _response = await core.fetcher({
|
|
362
385
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
363
386
|
(await core.Supplier.get(this._options.environment)) ??
|
|
364
|
-
environments.ToltApiEnvironment.
|
|
387
|
+
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id)}`),
|
|
365
388
|
method: "PUT",
|
|
366
389
|
headers: _headers,
|
|
367
390
|
contentType: "application/json",
|
|
@@ -387,6 +410,8 @@ export class CommissionsClient {
|
|
|
387
410
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
388
411
|
case 409:
|
|
389
412
|
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
413
|
+
case 413:
|
|
414
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
390
415
|
case 429:
|
|
391
416
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
392
417
|
default:
|
|
@@ -400,6 +425,8 @@ export class CommissionsClient {
|
|
|
400
425
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v2/commissions/{id}");
|
|
401
426
|
}
|
|
402
427
|
/**
|
|
428
|
+
* Deletes a commission. Fails for paid commissions, refund commissions, commissions on a refunded transaction, and those on a confirmed or legacy autopayout invoice.
|
|
429
|
+
*
|
|
403
430
|
* @param {ToltApi.DeleteCommissionsRequest} request
|
|
404
431
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
405
432
|
*
|
|
@@ -407,13 +434,14 @@ export class CommissionsClient {
|
|
|
407
434
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
408
435
|
* @throws {@link ToltApi.NotFoundError}
|
|
409
436
|
* @throws {@link ToltApi.ConflictError}
|
|
437
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
410
438
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
411
439
|
* @throws {@link errors.ToltApiError}
|
|
412
440
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
413
441
|
*
|
|
414
442
|
* @example
|
|
415
443
|
* await client.commissions.delete({
|
|
416
|
-
* id: "
|
|
444
|
+
* id: "comm_X85RLnefjTCNrypH4MA1PdSp"
|
|
417
445
|
* })
|
|
418
446
|
*/
|
|
419
447
|
delete(request, requestOptions) {
|
|
@@ -426,7 +454,7 @@ export class CommissionsClient {
|
|
|
426
454
|
const _response = await core.fetcher({
|
|
427
455
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
428
456
|
(await core.Supplier.get(this._options.environment)) ??
|
|
429
|
-
environments.ToltApiEnvironment.
|
|
457
|
+
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id)}`),
|
|
430
458
|
method: "DELETE",
|
|
431
459
|
headers: _headers,
|
|
432
460
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -449,6 +477,8 @@ export class CommissionsClient {
|
|
|
449
477
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
450
478
|
case 409:
|
|
451
479
|
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
480
|
+
case 413:
|
|
481
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
452
482
|
case 429:
|
|
453
483
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
454
484
|
default:
|
|
@@ -462,6 +492,8 @@ export class CommissionsClient {
|
|
|
462
492
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v2/commissions/{id}");
|
|
463
493
|
}
|
|
464
494
|
/**
|
|
495
|
+
* Marks a commission approved so it is included in the next payout. Fails for paid commissions, refund commissions, commissions on a refunded transaction, and those on a confirmed or legacy autopayout invoice.
|
|
496
|
+
*
|
|
465
497
|
* @param {ToltApi.ApproveCommissionsRequest} request
|
|
466
498
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
467
499
|
*
|
|
@@ -469,13 +501,14 @@ export class CommissionsClient {
|
|
|
469
501
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
470
502
|
* @throws {@link ToltApi.NotFoundError}
|
|
471
503
|
* @throws {@link ToltApi.ConflictError}
|
|
504
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
472
505
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
473
506
|
* @throws {@link errors.ToltApiError}
|
|
474
507
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
475
508
|
*
|
|
476
509
|
* @example
|
|
477
510
|
* await client.commissions.approve({
|
|
478
|
-
* id: "
|
|
511
|
+
* id: "comm_X85RLnefjTCNrypH4MA1PdSp"
|
|
479
512
|
* })
|
|
480
513
|
*/
|
|
481
514
|
approve(request, requestOptions) {
|
|
@@ -488,7 +521,7 @@ export class CommissionsClient {
|
|
|
488
521
|
const _response = await core.fetcher({
|
|
489
522
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
490
523
|
(await core.Supplier.get(this._options.environment)) ??
|
|
491
|
-
environments.ToltApiEnvironment.
|
|
524
|
+
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id)}/approve`),
|
|
492
525
|
method: "POST",
|
|
493
526
|
headers: _headers,
|
|
494
527
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -511,6 +544,8 @@ export class CommissionsClient {
|
|
|
511
544
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
512
545
|
case 409:
|
|
513
546
|
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
547
|
+
case 413:
|
|
548
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
514
549
|
case 429:
|
|
515
550
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
516
551
|
default:
|
|
@@ -524,6 +559,8 @@ export class CommissionsClient {
|
|
|
524
559
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/commissions/{id}/approve");
|
|
525
560
|
}
|
|
526
561
|
/**
|
|
562
|
+
* Marks a commission declined so it is left out of payouts until it is approved again. Fails for paid commissions, refund commissions, commissions on a refunded transaction, and those on a confirmed or legacy autopayout invoice.
|
|
563
|
+
*
|
|
527
564
|
* @param {ToltApi.DeclineCommissionsRequest} request
|
|
528
565
|
* @param {CommissionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
529
566
|
*
|
|
@@ -531,13 +568,14 @@ export class CommissionsClient {
|
|
|
531
568
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
532
569
|
* @throws {@link ToltApi.NotFoundError}
|
|
533
570
|
* @throws {@link ToltApi.ConflictError}
|
|
571
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
534
572
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
535
573
|
* @throws {@link errors.ToltApiError}
|
|
536
574
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
537
575
|
*
|
|
538
576
|
* @example
|
|
539
577
|
* await client.commissions.decline({
|
|
540
|
-
* id: "
|
|
578
|
+
* id: "comm_X85RLnefjTCNrypH4MA1PdSp"
|
|
541
579
|
* })
|
|
542
580
|
*/
|
|
543
581
|
decline(request, requestOptions) {
|
|
@@ -550,7 +588,7 @@ export class CommissionsClient {
|
|
|
550
588
|
const _response = await core.fetcher({
|
|
551
589
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
552
590
|
(await core.Supplier.get(this._options.environment)) ??
|
|
553
|
-
environments.ToltApiEnvironment.
|
|
591
|
+
environments.ToltApiEnvironment.Default, `v2/commissions/${core.url.encodePathParam(id)}/decline`),
|
|
554
592
|
method: "POST",
|
|
555
593
|
headers: _headers,
|
|
556
594
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -573,6 +611,8 @@ export class CommissionsClient {
|
|
|
573
611
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
574
612
|
case 409:
|
|
575
613
|
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
614
|
+
case 413:
|
|
615
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
576
616
|
case 429:
|
|
577
617
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
578
618
|
default:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* ids: ["
|
|
4
|
+
* ids: ["comm_X85RLnefjTCNrypH4MA1PdSp", "comm_3RtV9kQ2mW8nX5pL1sB7cD4f"]
|
|
5
5
|
* }
|
|
6
6
|
*/
|
|
7
7
|
export interface BulkApproveCommissionsRequest {
|
|
8
|
-
/**
|
|
8
|
+
/** Ids of the commissions to act on, as returned when listing commissions. Each one succeeds or fails on its own and gets its own entry in results. */
|
|
9
9
|
ids: string[];
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* ids: ["
|
|
4
|
+
* ids: ["comm_X85RLnefjTCNrypH4MA1PdSp", "comm_3RtV9kQ2mW8nX5pL1sB7cD4f"]
|
|
5
5
|
* }
|
|
6
6
|
*/
|
|
7
7
|
export interface BulkDeclineCommissionsRequest {
|
|
8
|
-
/**
|
|
8
|
+
/** Ids of the commissions to act on, as returned when listing commissions. Each one succeeds or fails on its own and gets its own entry in results. */
|
|
9
9
|
ids: string[];
|
|
10
10
|
}
|
|
@@ -4,27 +4,36 @@ import type * as ToltApi from "../../../../index.js";
|
|
|
4
4
|
* {}
|
|
5
5
|
*/
|
|
6
6
|
export interface ListCommissionsRequest {
|
|
7
|
+
/** How many rows to return in one page. */
|
|
7
8
|
limit?: number;
|
|
9
|
+
/** Ranking direction: desc puts the most recently created or updated rows first. */
|
|
8
10
|
order?: ToltApi.ListCommissionsRequestOrder;
|
|
9
|
-
/**
|
|
11
|
+
/** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
|
|
10
12
|
sort?: ToltApi.ListCommissionsRequestSort;
|
|
11
13
|
/** Continue after a position: the next_cursor of a previous page, or an item id when sorting by created_at. Cannot be combined with ending_before. */
|
|
12
14
|
starting_after?: string;
|
|
13
15
|
/** Page backward from a position: the prev_cursor of a previous page, or an item id when sorting by created_at. Cannot be combined with starting_after. */
|
|
14
16
|
ending_before?: string;
|
|
15
|
-
/**
|
|
17
|
+
/** Start of a window on when items were created: items created at this time or later are included, for example 2026-01-01T00:00:00Z. Leave it out for no lower bound. */
|
|
16
18
|
created_after?: string;
|
|
17
|
-
/**
|
|
19
|
+
/** End of a window on when items were created: only items created before this time are included. Leave it out for no upper bound. */
|
|
18
20
|
created_before?: string;
|
|
19
|
-
/** Only items
|
|
21
|
+
/** Only items last changed at or after this moment; with sort=updated_at, use it to fetch what changed since a previous sync. */
|
|
20
22
|
updated_after?: string;
|
|
21
|
-
/** Only items
|
|
23
|
+
/** Only items last changed before this moment; pair it with updated_after to fetch what changed in a period. */
|
|
22
24
|
updated_before?: string;
|
|
25
|
+
/** Limit to one program, by its id (prg_...) as returned when listing programs. */
|
|
23
26
|
program_id?: string;
|
|
27
|
+
/** Limit to one partner, by its id (part_...) as returned when listing partners. */
|
|
24
28
|
partner_id?: string;
|
|
29
|
+
/** Only commissions for this customer, by Tolt customer id (cus_...) as returned when listing customers. */
|
|
25
30
|
customer_id?: string;
|
|
31
|
+
/** Only commissions linked to this transaction, by its id (txn_...). */
|
|
26
32
|
transaction_id?: string;
|
|
33
|
+
/** Only commissions in this status, matched exactly, such as pending, approved or paid. */
|
|
27
34
|
status?: string;
|
|
35
|
+
/** Only commissions whose type equals this stored value exactly. */
|
|
28
36
|
type?: string;
|
|
37
|
+
/** Text matched anywhere in the commission id or its charge_id, ignoring case. */
|
|
29
38
|
search?: string;
|
|
30
39
|
}
|
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* id: "
|
|
4
|
+
* id: "comm_X85RLnefjTCNrypH4MA1PdSp",
|
|
5
|
+
* amount: 1000,
|
|
6
|
+
* revenue: 5000,
|
|
7
|
+
* status: "approved"
|
|
5
8
|
* }
|
|
6
9
|
*/
|
|
7
10
|
export interface UpdateCommissionsRequest {
|
|
8
11
|
id: string;
|
|
9
|
-
/**
|
|
12
|
+
/** What the partner earns for this commission, in minor units of the program currency (cents for USD). */
|
|
10
13
|
amount?: number;
|
|
11
|
-
/**
|
|
14
|
+
/** The sale amount the commission is based on, in minor units of the program currency. */
|
|
12
15
|
revenue?: number;
|
|
13
|
-
status?:
|
|
16
|
+
status?: UpdateCommissionsRequest.Status;
|
|
17
|
+
/** Free-form label for where the commission came from, such as stripe or api. */
|
|
14
18
|
source?: string | null;
|
|
19
|
+
/** Id of the payment in your billing system that the commission is for, such as a Stripe charge id. */
|
|
15
20
|
charge_id?: string | null;
|
|
21
|
+
/** Id of the transaction the commission is for (txn_...). It must belong to the commission's customer, or to its partner and program, and must not be refunded. */
|
|
16
22
|
transaction_id?: string | null;
|
|
23
|
+
/** When the commission was earned, as a timestamp with a time zone, for example 2026-03-01T12:00:00Z. Reports and filters by creation date place the commission on this date; the upcoming approvals forecast goes by its scheduled approval date, which this does not change. */
|
|
17
24
|
created_at?: string;
|
|
18
25
|
}
|
|
26
|
+
export declare namespace UpdateCommissionsRequest {
|
|
27
|
+
const Status: {
|
|
28
|
+
readonly Pending: "pending";
|
|
29
|
+
readonly Approved: "approved";
|
|
30
|
+
readonly Rejected: "rejected";
|
|
31
|
+
};
|
|
32
|
+
type Status = (typeof Status)[keyof typeof Status];
|
|
33
|
+
}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
2
|
+
export var UpdateCommissionsRequest;
|
|
3
|
+
(function (UpdateCommissionsRequest) {
|
|
4
|
+
UpdateCommissionsRequest.Status = {
|
|
5
|
+
Pending: "pending",
|
|
6
|
+
Approved: "approved",
|
|
7
|
+
Rejected: "rejected",
|
|
8
|
+
};
|
|
9
|
+
})(UpdateCommissionsRequest || (UpdateCommissionsRequest = {}));
|
|
@@ -5,4 +5,4 @@ export type { DeclineCommissionsRequest } from "./DeclineCommissionsRequest.js";
|
|
|
5
5
|
export type { DeleteCommissionsRequest } from "./DeleteCommissionsRequest.js";
|
|
6
6
|
export type { GetCommissionsRequest } from "./GetCommissionsRequest.js";
|
|
7
7
|
export type { ListCommissionsRequest } from "./ListCommissionsRequest.js";
|
|
8
|
-
export
|
|
8
|
+
export { UpdateCommissionsRequest } from "./UpdateCommissionsRequest.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { UpdateCommissionsRequest } from "./UpdateCommissionsRequest.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
|
|
2
2
|
export declare const ListCommissionsRequestSort: {
|
|
3
3
|
readonly CreatedAt: "created_at";
|
|
4
4
|
readonly UpdatedAt: "updated_at";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
/**
|
|
2
|
+
/** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
|
|
3
3
|
export const ListCommissionsRequestSort = {
|
|
4
4
|
CreatedAt: "created_at",
|
|
5
5
|
UpdatedAt: "updated_at",
|
|
@@ -11,11 +11,14 @@ export declare class CustomersClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<CustomersClient.Options>;
|
|
12
12
|
constructor(options: CustomersClient.Options);
|
|
13
13
|
/**
|
|
14
|
+
* Lists customers. Filter by program, partner, link, click, status or your own customer_id, and page with cursors.
|
|
15
|
+
*
|
|
14
16
|
* @param {ToltApi.ListCustomersRequest} request
|
|
15
17
|
* @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
18
|
*
|
|
17
19
|
* @throws {@link ToltApi.BadRequestError}
|
|
18
20
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
21
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
19
22
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
20
23
|
* @throws {@link errors.ToltApiError}
|
|
21
24
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
@@ -26,39 +29,53 @@ export declare class CustomersClient {
|
|
|
26
29
|
list(request?: ToltApi.ListCustomersRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.ListCustomersResponse>;
|
|
27
30
|
private __list;
|
|
28
31
|
/**
|
|
32
|
+
* Creates a customer attributed to a partner. Pass partner_id or link_id, and optionally the click_id that brought them in.
|
|
33
|
+
*
|
|
29
34
|
* @param {ToltApi.CreateCustomersRequest} request
|
|
30
35
|
* @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
36
|
*
|
|
32
37
|
* @throws {@link ToltApi.BadRequestError}
|
|
33
38
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
34
39
|
* @throws {@link ToltApi.ConflictError}
|
|
40
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
35
41
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
36
42
|
* @throws {@link errors.ToltApiError}
|
|
37
43
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
38
44
|
*
|
|
39
45
|
* @example
|
|
40
|
-
* await client.customers.create(
|
|
46
|
+
* await client.customers.create({
|
|
47
|
+
* email: "alex@example.com",
|
|
48
|
+
* name: "Alex Morgan",
|
|
49
|
+
* customer_id: "user_4821",
|
|
50
|
+
* link_id: "lnk_mtTeeckFa1vMdvDFXretQNs6",
|
|
51
|
+
* partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
52
|
+
* })
|
|
41
53
|
*/
|
|
42
54
|
create(request?: ToltApi.CreateCustomersRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreateCustomersResponse>;
|
|
43
55
|
private __create;
|
|
44
56
|
/**
|
|
57
|
+
* Gets a customer by ID, with its status, the partner it is attributed to and your own customer and subscription IDs.
|
|
58
|
+
*
|
|
45
59
|
* @param {ToltApi.GetCustomersRequest} request
|
|
46
60
|
* @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
47
61
|
*
|
|
48
62
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
49
63
|
* @throws {@link ToltApi.NotFoundError}
|
|
64
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
50
65
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
51
66
|
* @throws {@link errors.ToltApiError}
|
|
52
67
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
53
68
|
*
|
|
54
69
|
* @example
|
|
55
70
|
* await client.customers.get({
|
|
56
|
-
* id: "
|
|
71
|
+
* id: "cus_LBfjvtfct9pVUeLojMHiGnXv"
|
|
57
72
|
* })
|
|
58
73
|
*/
|
|
59
74
|
get(request: ToltApi.GetCustomersRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetCustomersResponse>;
|
|
60
75
|
private __get;
|
|
61
76
|
/**
|
|
77
|
+
* Updates a customer's name, email, status, your own IDs, or the click and link the customer came from.
|
|
78
|
+
*
|
|
62
79
|
* @param {ToltApi.UpdateCustomersRequest} request
|
|
63
80
|
* @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
81
|
*
|
|
@@ -66,31 +83,37 @@ export declare class CustomersClient {
|
|
|
66
83
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
67
84
|
* @throws {@link ToltApi.NotFoundError}
|
|
68
85
|
* @throws {@link ToltApi.ConflictError}
|
|
86
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
69
87
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
70
88
|
* @throws {@link errors.ToltApiError}
|
|
71
89
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
72
90
|
*
|
|
73
91
|
* @example
|
|
74
92
|
* await client.customers.update({
|
|
75
|
-
* id: "
|
|
93
|
+
* id: "cus_LBfjvtfct9pVUeLojMHiGnXv",
|
|
94
|
+
* name: "Alex Morgan",
|
|
95
|
+
* status: "active"
|
|
76
96
|
* })
|
|
77
97
|
*/
|
|
78
98
|
update(request: ToltApi.UpdateCustomersRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.UpdateCustomersResponse>;
|
|
79
99
|
private __update;
|
|
80
100
|
/**
|
|
101
|
+
* Deletes a customer. Fails when any of the customer's commissions is paid or already included in a payout.
|
|
102
|
+
*
|
|
81
103
|
* @param {ToltApi.DeleteCustomersRequest} request
|
|
82
104
|
* @param {CustomersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
83
105
|
*
|
|
84
106
|
* @throws {@link ToltApi.BadRequestError}
|
|
85
107
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
86
108
|
* @throws {@link ToltApi.NotFoundError}
|
|
109
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
87
110
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
88
111
|
* @throws {@link errors.ToltApiError}
|
|
89
112
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
90
113
|
*
|
|
91
114
|
* @example
|
|
92
115
|
* await client.customers.delete({
|
|
93
|
-
* id: "
|
|
116
|
+
* id: "cus_LBfjvtfct9pVUeLojMHiGnXv"
|
|
94
117
|
* })
|
|
95
118
|
*/
|
|
96
119
|
delete(request: ToltApi.DeleteCustomersRequest, requestOptions?: CustomersClient.RequestOptions): core.HttpResponsePromise<ToltApi.DeleteCustomersResponse>;
|