@tolt/api 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/dist/api/errors/TooManyRequestsError.d.ts +7 -0
  2. package/dist/api/errors/TooManyRequestsError.js +17 -0
  3. package/dist/api/errors/index.d.ts +1 -0
  4. package/dist/api/errors/index.js +1 -0
  5. package/dist/api/resources/clicks/client/Client.d.ts +10 -4
  6. package/dist/api/resources/clicks/client/Client.js +22 -24
  7. package/dist/api/resources/clicks/client/requests/index.d.ts +0 -1
  8. package/dist/api/resources/clicks/types/CreateClickRequest.d.ts +1 -0
  9. package/dist/api/resources/clicks/types/{ListClicksResponse.d.ts → CreateClickResponse.d.ts} +2 -3
  10. package/dist/api/resources/clicks/types/index.d.ts +2 -2
  11. package/dist/api/resources/clicks/types/index.js +2 -2
  12. package/dist/api/resources/commissions/client/Client.d.ts +45 -0
  13. package/dist/api/resources/commissions/client/Client.js +154 -1
  14. package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.d.ts +10 -0
  15. package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.js +2 -0
  16. package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.d.ts +10 -0
  17. package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.js +2 -0
  18. package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +13 -0
  19. package/dist/api/resources/commissions/client/requests/UpdateCommissionRequest.d.ts +3 -3
  20. package/dist/api/resources/commissions/client/requests/index.d.ts +2 -0
  21. package/dist/api/resources/commissions/types/BulkApproveCommissionsResponse.d.ts +6 -0
  22. package/dist/api/resources/commissions/types/BulkApproveCommissionsResponse.js +2 -0
  23. package/dist/api/resources/commissions/types/BulkDeclineCommissionsResponse.d.ts +6 -0
  24. package/dist/api/resources/commissions/types/BulkDeclineCommissionsResponse.js +2 -0
  25. package/dist/api/resources/commissions/types/ListCommissionsRequestSort.d.ts +6 -0
  26. package/dist/api/resources/commissions/types/ListCommissionsRequestSort.js +6 -0
  27. package/dist/api/resources/commissions/types/ListCommissionsResponse.d.ts +4 -0
  28. package/dist/api/resources/commissions/types/index.d.ts +3 -0
  29. package/dist/api/resources/commissions/types/index.js +3 -0
  30. package/dist/api/resources/customers/client/Client.d.ts +5 -1
  31. package/dist/api/resources/customers/client/Client.js +22 -4
  32. package/dist/api/resources/customers/client/requests/CreateCustomerRequest.d.ts +5 -5
  33. package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +13 -0
  34. package/dist/api/resources/customers/client/requests/UpdateCustomerRequest.d.ts +6 -6
  35. package/dist/api/resources/customers/types/ListCustomersRequestSort.d.ts +6 -0
  36. package/dist/api/resources/customers/types/ListCustomersRequestSort.js +6 -0
  37. package/dist/api/resources/customers/types/ListCustomersResponse.d.ts +4 -0
  38. package/dist/api/resources/customers/types/index.d.ts +1 -0
  39. package/dist/api/resources/customers/types/index.js +1 -0
  40. package/dist/api/resources/embed/client/Client.d.ts +1 -0
  41. package/dist/api/resources/embed/client/Client.js +3 -0
  42. package/dist/api/resources/embed/client/requests/CreateEmbedTokenRequest.d.ts +2 -2
  43. package/dist/api/resources/flows/client/Client.d.ts +2 -0
  44. package/dist/api/resources/flows/client/Client.js +13 -1
  45. package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +13 -0
  46. package/dist/api/resources/flows/types/ListFlowsRequestSort.d.ts +6 -0
  47. package/dist/api/resources/flows/types/ListFlowsRequestSort.js +6 -0
  48. package/dist/api/resources/flows/types/ListFlowsResponse.d.ts +4 -0
  49. package/dist/api/resources/flows/types/index.d.ts +1 -0
  50. package/dist/api/resources/flows/types/index.js +1 -0
  51. package/dist/api/resources/groups/client/Client.d.ts +2 -0
  52. package/dist/api/resources/groups/client/Client.js +13 -1
  53. package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +13 -0
  54. package/dist/api/resources/groups/types/ListGroupsRequestSort.d.ts +6 -0
  55. package/dist/api/resources/groups/types/ListGroupsRequestSort.js +6 -0
  56. package/dist/api/resources/groups/types/ListGroupsResponse.d.ts +4 -0
  57. package/dist/api/resources/groups/types/index.d.ts +1 -0
  58. package/dist/api/resources/groups/types/index.js +1 -0
  59. package/dist/api/resources/links/client/Client.d.ts +6 -1
  60. package/dist/api/resources/links/client/Client.js +23 -2
  61. package/dist/api/resources/links/client/requests/CreateLinkRequest.d.ts +2 -2
  62. package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +13 -0
  63. package/dist/api/resources/links/types/ListLinksRequestSort.d.ts +6 -0
  64. package/dist/api/resources/links/types/ListLinksRequestSort.js +6 -0
  65. package/dist/api/resources/links/types/ListLinksResponse.d.ts +4 -0
  66. package/dist/api/resources/links/types/index.d.ts +1 -0
  67. package/dist/api/resources/links/types/index.js +1 -0
  68. package/dist/api/resources/partners/client/Client.d.ts +85 -0
  69. package/dist/api/resources/partners/client/Client.js +273 -1
  70. package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.d.ts +10 -0
  71. package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.js +2 -0
  72. package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.d.ts +11 -0
  73. package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.js +2 -0
  74. package/dist/api/resources/partners/client/requests/CreatePartnerRequest.d.ts +41 -0
  75. package/dist/api/resources/partners/client/requests/CreatePartnerRequest.js +8 -0
  76. package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +13 -0
  77. package/dist/api/resources/partners/client/requests/RejectPartnerRequest.d.ts +1 -1
  78. package/dist/api/resources/partners/client/requests/SuspendPartnerRequest.d.ts +1 -1
  79. package/dist/api/resources/partners/client/requests/UpdatePartnerRequest.d.ts +16 -0
  80. package/dist/api/resources/partners/client/requests/UpdatePartnerRequest.js +2 -0
  81. package/dist/api/resources/partners/client/requests/index.d.ts +4 -0
  82. package/dist/api/resources/partners/client/requests/index.js +1 -1
  83. package/dist/api/resources/partners/types/BulkApprovePartnersResponse.d.ts +6 -0
  84. package/dist/api/resources/partners/types/BulkApprovePartnersResponse.js +2 -0
  85. package/dist/api/resources/partners/types/BulkRejectPartnersResponse.d.ts +6 -0
  86. package/dist/api/resources/partners/types/BulkRejectPartnersResponse.js +2 -0
  87. package/dist/api/resources/partners/types/CreatePartnerResponse.d.ts +6 -0
  88. package/dist/api/resources/partners/types/CreatePartnerResponse.js +2 -0
  89. package/dist/api/resources/partners/types/ListPartnersRequestSort.d.ts +6 -0
  90. package/dist/api/resources/partners/types/ListPartnersRequestSort.js +6 -0
  91. package/dist/api/resources/partners/types/ListPartnersResponse.d.ts +4 -0
  92. package/dist/api/resources/partners/types/UpdatePartnerResponse.d.ts +6 -0
  93. package/dist/api/resources/partners/types/UpdatePartnerResponse.js +2 -0
  94. package/dist/api/resources/partners/types/index.d.ts +5 -0
  95. package/dist/api/resources/partners/types/index.js +5 -0
  96. package/dist/api/resources/programs/client/Client.d.ts +2 -0
  97. package/dist/api/resources/programs/client/Client.js +13 -1
  98. package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +13 -0
  99. package/dist/api/resources/programs/types/ListProgramsRequestSort.d.ts +6 -0
  100. package/dist/api/resources/programs/types/ListProgramsRequestSort.js +6 -0
  101. package/dist/api/resources/programs/types/ListProgramsResponse.d.ts +4 -0
  102. package/dist/api/resources/programs/types/index.d.ts +1 -0
  103. package/dist/api/resources/programs/types/index.js +1 -0
  104. package/dist/api/resources/promotionCodes/client/Client.d.ts +6 -1
  105. package/dist/api/resources/promotionCodes/client/Client.js +23 -2
  106. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodeRequest.d.ts +2 -2
  107. package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +13 -0
  108. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.d.ts +6 -0
  109. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.js +6 -0
  110. package/dist/api/resources/promotionCodes/types/ListPromotionCodesResponse.d.ts +4 -0
  111. package/dist/api/resources/promotionCodes/types/index.d.ts +1 -0
  112. package/dist/api/resources/promotionCodes/types/index.js +1 -0
  113. package/dist/api/resources/reports/client/Client.d.ts +5 -0
  114. package/dist/api/resources/reports/client/Client.js +15 -0
  115. package/dist/api/resources/transactions/client/Client.d.ts +8 -1
  116. package/dist/api/resources/transactions/client/Client.js +29 -2
  117. package/dist/api/resources/transactions/client/requests/CreateTransactionRequest.d.ts +5 -5
  118. package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +13 -0
  119. package/dist/api/resources/transactions/client/requests/UpdateTransactionRequest.d.ts +4 -4
  120. package/dist/api/resources/transactions/types/ListTransactionsRequestSort.d.ts +6 -0
  121. package/dist/api/resources/transactions/types/ListTransactionsRequestSort.js +6 -0
  122. package/dist/api/resources/transactions/types/ListTransactionsResponse.d.ts +4 -0
  123. package/dist/api/resources/transactions/types/index.d.ts +1 -0
  124. package/dist/api/resources/transactions/types/index.js +1 -0
  125. package/dist/api/types/BulkResult.d.ts +24 -0
  126. package/dist/api/types/BulkResult.js +14 -0
  127. package/dist/api/types/Click.d.ts +5 -5
  128. package/dist/api/types/Commission.d.ts +13 -13
  129. package/dist/api/types/CreatedPartner.d.ts +19 -0
  130. package/dist/api/types/CreatedPartner.js +2 -0
  131. package/dist/api/types/Customer.d.ts +11 -11
  132. package/dist/api/types/EmbedToken.d.ts +1 -1
  133. package/dist/api/types/Error_.d.ts +34 -0
  134. package/dist/api/types/Error_.js +21 -1
  135. package/dist/api/types/Flow.d.ts +8 -8
  136. package/dist/api/types/Group.d.ts +9 -9
  137. package/dist/api/types/Link.d.ts +5 -5
  138. package/dist/api/types/Partner.d.ts +12 -8
  139. package/dist/api/types/Program.d.ts +8 -8
  140. package/dist/api/types/PromotionCode.d.ts +8 -8
  141. package/dist/api/types/ReportsLinkRow.d.ts +2 -2
  142. package/dist/api/types/ReportsOverview.d.ts +3 -3
  143. package/dist/api/types/ReportsPartnerRow.d.ts +4 -4
  144. package/dist/api/types/Transaction.d.ts +17 -17
  145. package/dist/api/types/index.d.ts +2 -0
  146. package/dist/api/types/index.js +2 -0
  147. package/package.json +1 -1
  148. package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +0 -16
  149. package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +0 -5
  150. package/dist/api/resources/clicks/types/ListClicksRequestOrder.js +0 -5
  151. /package/dist/api/resources/clicks/{client/requests/ListClicksRequest.js → types/CreateClickRequest.js} +0 -0
  152. /package/dist/api/resources/clicks/types/{ListClicksResponse.js → CreateClickResponse.js} +0 -0
@@ -17,6 +17,7 @@ export class TransactionsClient {
17
17
  *
18
18
  * @throws {@link ToltApi.BadRequestError}
19
19
  * @throws {@link ToltApi.UnauthorizedError}
20
+ * @throws {@link ToltApi.TooManyRequestsError}
20
21
  * @throws {@link errors.ToltApiError}
21
22
  * @throws {@link errors.ToltApiTimeoutError}
22
23
  *
@@ -27,11 +28,17 @@ export class TransactionsClient {
27
28
  return core.HttpResponsePromise.fromPromise(this.__listTransactions(request, requestOptions));
28
29
  }
29
30
  async __listTransactions(request = {}, requestOptions) {
30
- const { limit, order, starting_after: startingAfter, program_id: programId, partner_id: partnerId, customer_id: customerId, status, search, } = request;
31
+ const { limit, order, sort, starting_after: startingAfter, ending_before: endingBefore, created_after: createdAfter, created_before: createdBefore, updated_after: updatedAfter, updated_before: updatedBefore, program_id: programId, partner_id: partnerId, customer_id: customerId, status, search, } = request;
31
32
  const _queryParams = {
32
33
  limit,
33
34
  order: order != null ? order : undefined,
35
+ sort: sort != null ? sort : undefined,
34
36
  starting_after: startingAfter,
37
+ ending_before: endingBefore,
38
+ created_after: createdAfter != null ? createdAfter : undefined,
39
+ created_before: createdBefore != null ? createdBefore : undefined,
40
+ updated_after: updatedAfter != null ? updatedAfter : undefined,
41
+ updated_before: updatedBefore != null ? updatedBefore : undefined,
35
42
  program_id: programId,
36
43
  partner_id: partnerId,
37
44
  customer_id: customerId,
@@ -66,6 +73,8 @@ export class TransactionsClient {
66
73
  throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
67
74
  case 401:
68
75
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
76
+ case 429:
77
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
69
78
  default:
70
79
  throw new errors.ToltApiError({
71
80
  statusCode: _response.error.statusCode,
@@ -82,13 +91,14 @@ export class TransactionsClient {
82
91
  *
83
92
  * @throws {@link ToltApi.BadRequestError}
84
93
  * @throws {@link ToltApi.UnauthorizedError}
94
+ * @throws {@link ToltApi.TooManyRequestsError}
85
95
  * @throws {@link errors.ToltApiError}
86
96
  * @throws {@link errors.ToltApiTimeoutError}
87
97
  *
88
98
  * @example
89
99
  * await client.transactions.createTransaction({
90
100
  * amount: 1,
91
- * customerId: "customerId"
101
+ * customer_id: "customer_id"
92
102
  * })
93
103
  */
94
104
  createTransaction(request, requestOptions) {
@@ -122,6 +132,8 @@ export class TransactionsClient {
122
132
  throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
123
133
  case 401:
124
134
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
135
+ case 429:
136
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
125
137
  default:
126
138
  throw new errors.ToltApiError({
127
139
  statusCode: _response.error.statusCode,
@@ -138,6 +150,7 @@ export class TransactionsClient {
138
150
  *
139
151
  * @throws {@link ToltApi.UnauthorizedError}
140
152
  * @throws {@link ToltApi.NotFoundError}
153
+ * @throws {@link ToltApi.TooManyRequestsError}
141
154
  * @throws {@link errors.ToltApiError}
142
155
  * @throws {@link errors.ToltApiTimeoutError}
143
156
  *
@@ -175,6 +188,8 @@ export class TransactionsClient {
175
188
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
176
189
  case 404:
177
190
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
191
+ case 429:
192
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
178
193
  default:
179
194
  throw new errors.ToltApiError({
180
195
  statusCode: _response.error.statusCode,
@@ -193,6 +208,7 @@ export class TransactionsClient {
193
208
  * @throws {@link ToltApi.UnauthorizedError}
194
209
  * @throws {@link ToltApi.NotFoundError}
195
210
  * @throws {@link ToltApi.ConflictError}
211
+ * @throws {@link ToltApi.TooManyRequestsError}
196
212
  * @throws {@link errors.ToltApiError}
197
213
  * @throws {@link errors.ToltApiTimeoutError}
198
214
  *
@@ -237,6 +253,8 @@ export class TransactionsClient {
237
253
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
238
254
  case 409:
239
255
  throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
256
+ case 429:
257
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
240
258
  default:
241
259
  throw new errors.ToltApiError({
242
260
  statusCode: _response.error.statusCode,
@@ -254,6 +272,7 @@ export class TransactionsClient {
254
272
  * @throws {@link ToltApi.UnauthorizedError}
255
273
  * @throws {@link ToltApi.NotFoundError}
256
274
  * @throws {@link ToltApi.ConflictError}
275
+ * @throws {@link ToltApi.TooManyRequestsError}
257
276
  * @throws {@link errors.ToltApiError}
258
277
  * @throws {@link errors.ToltApiTimeoutError}
259
278
  *
@@ -293,6 +312,8 @@ export class TransactionsClient {
293
312
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
294
313
  case 409:
295
314
  throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
315
+ case 429:
316
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
296
317
  default:
297
318
  throw new errors.ToltApiError({
298
319
  statusCode: _response.error.statusCode,
@@ -310,6 +331,7 @@ export class TransactionsClient {
310
331
  * @throws {@link ToltApi.UnauthorizedError}
311
332
  * @throws {@link ToltApi.NotFoundError}
312
333
  * @throws {@link ToltApi.ConflictError}
334
+ * @throws {@link ToltApi.TooManyRequestsError}
313
335
  * @throws {@link errors.ToltApiError}
314
336
  * @throws {@link errors.ToltApiTimeoutError}
315
337
  *
@@ -349,6 +371,8 @@ export class TransactionsClient {
349
371
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
350
372
  case 409:
351
373
  throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
374
+ case 429:
375
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
352
376
  default:
353
377
  throw new errors.ToltApiError({
354
378
  statusCode: _response.error.statusCode,
@@ -368,6 +392,7 @@ export class TransactionsClient {
368
392
  * @throws {@link ToltApi.UnauthorizedError}
369
393
  * @throws {@link ToltApi.NotFoundError}
370
394
  * @throws {@link ToltApi.ConflictError}
395
+ * @throws {@link ToltApi.TooManyRequestsError}
371
396
  * @throws {@link errors.ToltApiError}
372
397
  * @throws {@link errors.ToltApiTimeoutError}
373
398
  *
@@ -410,6 +435,8 @@ export class TransactionsClient {
410
435
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
411
436
  case 409:
412
437
  throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
438
+ case 429:
439
+ throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
413
440
  default:
414
441
  throw new errors.ToltApiError({
415
442
  statusCode: _response.error.statusCode,
@@ -2,16 +2,16 @@
2
2
  * @example
3
3
  * {
4
4
  * amount: 1,
5
- * customerId: "customerId"
5
+ * customer_id: "customer_id"
6
6
  * }
7
7
  */
8
8
  export interface CreateTransactionRequest {
9
9
  /** Monetary amount as an integer in the smallest currency unit (cents), e.g. 500 = 5.00 */
10
10
  amount: number;
11
- customerId: string;
12
- billingType?: string;
13
- chargeId?: string;
14
- clickId?: string;
11
+ customer_id: string;
12
+ billing_type?: string;
13
+ charge_id?: string;
14
+ click_id?: string;
15
15
  interval?: string;
16
16
  source?: string;
17
17
  }
@@ -6,7 +6,20 @@ import type * as ToltApi from "../../../../index.js";
6
6
  export interface ListTransactionsRequest {
7
7
  limit?: number;
8
8
  order?: ToltApi.ListTransactionsRequestOrder;
9
+ /** Column the list is ordered and paged by. */
10
+ sort?: ToltApi.ListTransactionsRequestSort;
11
+ /** 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. */
9
12
  starting_after?: string;
13
+ /** 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
+ ending_before?: string;
15
+ /** Only items created at or after this ISO 8601 time. */
16
+ created_after?: string;
17
+ /** Only items created before this ISO 8601 time. */
18
+ created_before?: string;
19
+ /** Only items updated at or after this ISO 8601 time. Combine with sort=updated_at to sync changes. */
20
+ updated_after?: string;
21
+ /** Only items updated before this ISO 8601 time. */
22
+ updated_before?: string;
10
23
  program_id?: string;
11
24
  partner_id?: string;
12
25
  customer_id?: string;
@@ -10,9 +10,9 @@ export interface UpdateTransactionRequest {
10
10
  amount?: number;
11
11
  status?: string | null;
12
12
  source?: string | null;
13
- billingType?: string | null;
14
- chargeId?: string | null;
15
- clickId?: string | null;
13
+ billing_type?: string | null;
14
+ charge_id?: string | null;
15
+ click_id?: string | null;
16
16
  interval?: string | null;
17
- createdAt?: string;
17
+ created_at?: string;
18
18
  }
@@ -0,0 +1,6 @@
1
+ /** Column the list is ordered and paged by. */
2
+ export declare const ListTransactionsRequestSort: {
3
+ readonly CreatedAt: "created_at";
4
+ readonly UpdatedAt: "updated_at";
5
+ };
6
+ export type ListTransactionsRequestSort = (typeof ListTransactionsRequestSort)[keyof typeof ListTransactionsRequestSort];
@@ -0,0 +1,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /** Column the list is ordered and paged by. */
3
+ export const ListTransactionsRequestSort = {
4
+ CreatedAt: "created_at",
5
+ UpdatedAt: "updated_at",
6
+ };
@@ -4,4 +4,8 @@ export interface ListTransactionsResponse {
4
4
  message: string;
5
5
  data: ToltApi.Transaction[];
6
6
  has_more: boolean;
7
+ /** Opaque cursor marking the last item on this page. Pass it as starting_after to continue. Null when the page is empty. */
8
+ next_cursor: string | null;
9
+ /** Opaque cursor marking the first item on this page. Pass it as ending_before to page backward. Null when the page is empty. */
10
+ prev_cursor: string | null;
7
11
  }
@@ -2,6 +2,7 @@ export * from "./CreateTransactionResponse.js";
2
2
  export * from "./DeleteTransactionResponse.js";
3
3
  export * from "./GetTransactionResponse.js";
4
4
  export * from "./ListTransactionsRequestOrder.js";
5
+ export * from "./ListTransactionsRequestSort.js";
5
6
  export * from "./ListTransactionsResponse.js";
6
7
  export * from "./RefundTransactionResponse.js";
7
8
  export * from "./RerunTransactionFlowsResponse.js";
@@ -2,6 +2,7 @@ export * from "./CreateTransactionResponse.js";
2
2
  export * from "./DeleteTransactionResponse.js";
3
3
  export * from "./GetTransactionResponse.js";
4
4
  export * from "./ListTransactionsRequestOrder.js";
5
+ export * from "./ListTransactionsRequestSort.js";
5
6
  export * from "./ListTransactionsResponse.js";
6
7
  export * from "./RefundTransactionResponse.js";
7
8
  export * from "./RerunTransactionFlowsResponse.js";
@@ -0,0 +1,24 @@
1
+ export interface BulkResult {
2
+ succeeded: number;
3
+ failed: number;
4
+ results: BulkResult.Results.Item[];
5
+ }
6
+ export declare namespace BulkResult {
7
+ type Results = Results.Item[];
8
+ namespace Results {
9
+ interface Item {
10
+ id: string;
11
+ status: Item.Status;
12
+ /** Error code when status is error. */
13
+ code?: string | undefined;
14
+ message?: string | undefined;
15
+ }
16
+ namespace Item {
17
+ const Status: {
18
+ readonly Ok: "ok";
19
+ readonly Error: "error";
20
+ };
21
+ type Status = (typeof Status)[keyof typeof Status];
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,14 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var BulkResult;
3
+ (function (BulkResult) {
4
+ let Results;
5
+ (function (Results) {
6
+ let Item;
7
+ (function (Item) {
8
+ Item.Status = {
9
+ Ok: "ok",
10
+ Error: "error",
11
+ };
12
+ })(Item = Results.Item || (Results.Item = {}));
13
+ })(Results = BulkResult.Results || (BulkResult.Results = {}));
14
+ })(BulkResult || (BulkResult = {}));
@@ -6,9 +6,9 @@ export interface Click {
6
6
  browser: string | null;
7
7
  country: string | null;
8
8
  state: string | null;
9
- linkId: string | null;
10
- programId: string | null;
11
- partnerId: string | null;
12
- createdAt: string;
13
- updatedAt: string;
9
+ link_id: string | null;
10
+ program_id: string | null;
11
+ partner_id: string | null;
12
+ created_at: string;
13
+ updated_at: string;
14
14
  }
@@ -8,17 +8,17 @@ export interface Commission {
8
8
  status: string | null;
9
9
  type: string | null;
10
10
  source: string | null;
11
- partnerId: string | null;
12
- customerId: string | null;
13
- programId: string | null;
14
- transactionId: string | null;
15
- payoutId: string | null;
16
- chargeId: string | null;
17
- chargeStatus: string | null;
18
- isAdClick: boolean | null;
19
- isSelfReferral: boolean | null;
20
- approvalType: string | null;
21
- scheduledApprovalDate: string;
22
- createdAt: string;
23
- updatedAt: string;
11
+ partner_id: string | null;
12
+ customer_id: string | null;
13
+ program_id: string | null;
14
+ transaction_id: string | null;
15
+ payout_id: string | null;
16
+ charge_id: string | null;
17
+ charge_status: string | null;
18
+ is_ad_click: boolean | null;
19
+ is_self_referral: boolean | null;
20
+ approval_type: string | null;
21
+ scheduled_approval_date: string;
22
+ created_at: string;
23
+ updated_at: string;
24
24
  }
@@ -0,0 +1,19 @@
1
+ import type * as ToltApi from "../index.js";
2
+ export interface CreatedPartner {
3
+ id: string;
4
+ email: string;
5
+ first_name: string | null;
6
+ last_name: string | null;
7
+ company_name: string | null;
8
+ status: string;
9
+ group_id: string | null;
10
+ program_id: string | null;
11
+ country_code: string | null;
12
+ website_url: string | null;
13
+ /** Name shown for the partner in the dashboard. */
14
+ display_name: string | null;
15
+ completed_onboarding: boolean | null;
16
+ created_at: string;
17
+ updated_at: string;
18
+ link: ToltApi.Link;
19
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,19 +1,19 @@
1
1
  export interface Customer {
2
2
  id: string;
3
- customerId: string | null;
3
+ customer_id: string | null;
4
4
  identifier: string | null;
5
5
  email: string | null;
6
6
  name: string | null;
7
7
  status: string | null;
8
8
  plan: string | null;
9
- subscriptionId: string | null;
10
- partnerId: string | null;
11
- programId: string | null;
12
- linkId: string | null;
13
- promotionCodeId: string | null;
14
- clickId: string | null;
15
- leadAt: string;
16
- activeAt: string;
17
- createdAt: string;
18
- updatedAt: string;
9
+ subscription_id: string | null;
10
+ partner_id: string | null;
11
+ program_id: string | null;
12
+ link_id: string | null;
13
+ promotion_code_id: string | null;
14
+ click_id: string | null;
15
+ lead_at: string;
16
+ active_at: string;
17
+ created_at: string;
18
+ updated_at: string;
19
19
  }
@@ -1,4 +1,4 @@
1
1
  export interface EmbedToken {
2
2
  token: string;
3
- expiresAt: string;
3
+ expires_at: string;
4
4
  }
@@ -1,4 +1,38 @@
1
1
  export interface Error_ {
2
2
  success: boolean;
3
+ /** Human-readable explanation. May change; branch on code instead. */
3
4
  message: string;
5
+ /** Stable machine-readable error code. */
6
+ code: Error_.Code;
7
+ doc_url: string;
8
+ /** One entry per offending field. Present on validation_error and invalid_reference. */
9
+ errors?: Error_.Errors.Item[] | undefined;
10
+ }
11
+ export declare namespace Error_ {
12
+ /** Stable machine-readable error code. */
13
+ const Code: {
14
+ readonly BadRequest: "bad_request";
15
+ readonly ValidationError: "validation_error";
16
+ readonly InvalidReference: "invalid_reference";
17
+ readonly InvalidCursor: "invalid_cursor";
18
+ readonly Unauthorized: "unauthorized";
19
+ readonly Forbidden: "forbidden";
20
+ readonly NotFound: "not_found";
21
+ readonly Conflict: "conflict";
22
+ readonly AlreadyExists: "already_exists";
23
+ readonly CommissionPaid: "commission_paid";
24
+ readonly CommissionFrozen: "commission_frozen";
25
+ readonly TransactionRefunded: "transaction_refunded";
26
+ readonly CommissionExists: "commission_exists";
27
+ readonly RateLimited: "rate_limited";
28
+ readonly InternalError: "internal_error";
29
+ };
30
+ type Code = (typeof Code)[keyof typeof Code];
31
+ type Errors = Errors.Item[];
32
+ namespace Errors {
33
+ interface Item {
34
+ field: string;
35
+ message: string;
36
+ }
37
+ }
4
38
  }
@@ -1,2 +1,22 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ export var Error_;
3
+ (function (Error_) {
4
+ /** Stable machine-readable error code. */
5
+ Error_.Code = {
6
+ BadRequest: "bad_request",
7
+ ValidationError: "validation_error",
8
+ InvalidReference: "invalid_reference",
9
+ InvalidCursor: "invalid_cursor",
10
+ Unauthorized: "unauthorized",
11
+ Forbidden: "forbidden",
12
+ NotFound: "not_found",
13
+ Conflict: "conflict",
14
+ AlreadyExists: "already_exists",
15
+ CommissionPaid: "commission_paid",
16
+ CommissionFrozen: "commission_frozen",
17
+ TransactionRefunded: "transaction_refunded",
18
+ CommissionExists: "commission_exists",
19
+ RateLimited: "rate_limited",
20
+ InternalError: "internal_error",
21
+ };
22
+ })(Error_ || (Error_ = {}));
@@ -3,16 +3,16 @@ export interface Flow {
3
3
  name: string | null;
4
4
  description: string | null;
5
5
  event: string | null;
6
- actionType: string | null;
6
+ action_type: string | null;
7
7
  action?: unknown | undefined;
8
8
  conditions?: unknown | undefined;
9
- programId: string | null;
10
- groupId: string | null;
11
- campaignId: string | null;
9
+ program_id: string | null;
10
+ group_id: string | null;
11
+ campaign_id: string | null;
12
12
  active: boolean | null;
13
- partnerOverrides?: unknown | undefined;
14
- linkOverrides?: unknown | undefined;
13
+ partner_overrides?: unknown | undefined;
14
+ link_overrides?: unknown | undefined;
15
15
  options?: unknown | undefined;
16
- createdAt: string;
17
- updatedAt: string;
16
+ created_at: string;
17
+ updated_at: string;
18
18
  }
@@ -2,13 +2,13 @@ export interface Group {
2
2
  id: string;
3
3
  name: string | null;
4
4
  description: string | null;
5
- programId: string | null;
6
- isDefault: boolean | null;
7
- publicKey: string | null;
8
- websiteUrl: string | null;
9
- isPrivate: boolean | null;
10
- allowManualLeadSubmission: boolean | null;
11
- minimumPayout: number | null;
12
- createdAt: string;
13
- updatedAt: string;
5
+ program_id: string | null;
6
+ is_default: boolean | null;
7
+ public_key: string | null;
8
+ website_url: string | null;
9
+ is_private: boolean | null;
10
+ allow_manual_lead_submission: boolean | null;
11
+ minimum_payout: number | null;
12
+ created_at: string;
13
+ updated_at: string;
14
14
  }
@@ -3,9 +3,9 @@ export interface Link {
3
3
  value: string | null;
4
4
  param: string | null;
5
5
  status: string | null;
6
- partnerId: string | null;
7
- programId: string | null;
8
- campaignId: string | null;
9
- createdAt: string;
10
- updatedAt: string;
6
+ partner_id: string | null;
7
+ program_id: string | null;
8
+ campaign_id: string | null;
9
+ created_at: string;
10
+ updated_at: string;
11
11
  }
@@ -1,13 +1,17 @@
1
1
  export interface Partner {
2
2
  id: string;
3
3
  email: string;
4
- firstName: string | null;
5
- lastName: string | null;
6
- companyName: string | null;
4
+ first_name: string | null;
5
+ last_name: string | null;
6
+ company_name: string | null;
7
7
  status: string;
8
- groupId: string | null;
9
- programId: string | null;
10
- countryCode: string | null;
11
- createdAt: string;
12
- updatedAt: string;
8
+ group_id: string | null;
9
+ program_id: string | null;
10
+ country_code: string | null;
11
+ website_url: string | null;
12
+ /** Name shown for the partner in the dashboard. */
13
+ display_name: string | null;
14
+ completed_onboarding: boolean | null;
15
+ created_at: string;
16
+ updated_at: string;
13
17
  }
@@ -1,15 +1,15 @@
1
1
  export interface Program {
2
2
  id: string;
3
3
  name: string | null;
4
- productName: string | null;
4
+ product_name: string | null;
5
5
  type: string | null;
6
6
  status: string | null;
7
- currencyCode: string | null;
8
- cookieDuration: number | null;
9
- payoutTerm: string | null;
10
- minimumPayout: number | null;
11
- websiteUrl: string | null;
7
+ currency_code: string | null;
8
+ cookie_duration: number | null;
9
+ payout_term: string | null;
10
+ minimum_payout: number | null;
11
+ website_url: string | null;
12
12
  subdomain: string | null;
13
- createdAt: string;
14
- updatedAt: string;
13
+ created_at: string;
14
+ updated_at: string;
15
15
  }
@@ -4,13 +4,13 @@ export interface PromotionCode {
4
4
  type: string | null;
5
5
  value: string | null;
6
6
  duration: string;
7
- durationInMonths: string | null;
7
+ duration_in_months: string | null;
8
8
  active: boolean | null;
9
- entityType: string | null;
10
- externalId: string | null;
11
- partnerId: string | null;
12
- programId: string | null;
13
- groupId: string | null;
14
- createdAt: string;
15
- updatedAt: string;
9
+ entity_type: string | null;
10
+ external_id: string | null;
11
+ partner_id: string | null;
12
+ program_id: string | null;
13
+ group_id: string | null;
14
+ created_at: string;
15
+ updated_at: string;
16
16
  }
@@ -1,5 +1,5 @@
1
1
  export interface ReportsLinkRow {
2
- linkId: string;
2
+ link_id: string;
3
3
  param: string | null;
4
4
  value: string | null;
5
5
  clicks: number;
@@ -8,5 +8,5 @@ export interface ReportsLinkRow {
8
8
  revenue: string;
9
9
  /** Integer amount in the smallest currency unit (cents), serialized as a string. Summed across the row's currencies; scope to a single-currency program with program_id, or use /reports/overview for the per-currency split. */
10
10
  commissions: string;
11
- conversionRate: number;
11
+ conversion_rate: number;
12
12
  }
@@ -4,9 +4,9 @@ export interface ReportsOverview {
4
4
  /** Approved and paid commission totals, one entry per currency. */
5
5
  commissions: ReportsOverview.Commissions.Item[];
6
6
  /** Number of approved and paid commissions. */
7
- commissionCount: number;
8
- customerCount: number;
9
- partnerCount: number;
7
+ commission_count: number;
8
+ customer_count: number;
9
+ partner_count: number;
10
10
  }
11
11
  export declare namespace ReportsOverview {
12
12
  type Revenue = Revenue.Item[];
@@ -1,7 +1,7 @@
1
1
  export interface ReportsPartnerRow {
2
- partnerId: string;
3
- firstName: string | null;
4
- lastName: string | null;
2
+ partner_id: string;
3
+ first_name: string | null;
4
+ last_name: string | null;
5
5
  email: string | null;
6
6
  clicks: number;
7
7
  /** Converted (non-lead) customers. */
@@ -11,5 +11,5 @@ export interface ReportsPartnerRow {
11
11
  /** Integer amount in the smallest currency unit (cents), serialized as a string. Summed across the row's currencies; scope to a single-currency program with program_id, or use /reports/overview for the per-currency split. */
12
12
  commissions: string;
13
13
  /** Customers / clicks as a percentage. */
14
- conversionRate: number;
14
+ conversion_rate: number;
15
15
  }