@tolt/api 0.6.0 → 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.
Files changed (167) hide show
  1. package/README.md +2 -2
  2. package/dist/api/errors/ContentTooLargeError.d.ts +7 -0
  3. package/dist/api/errors/ContentTooLargeError.js +17 -0
  4. package/dist/api/errors/index.d.ts +1 -0
  5. package/dist/api/errors/index.js +1 -0
  6. package/dist/api/resources/clicks/client/Client.d.ts +6 -1
  7. package/dist/api/resources/clicks/client/Client.js +15 -4
  8. package/dist/api/resources/clicks/client/requests/GetClicksRequest.d.ts +1 -1
  9. package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +10 -5
  10. package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +1 -0
  11. package/dist/api/resources/clicks/types/ListClicksRequestOrder.js +1 -0
  12. package/dist/api/resources/clicks/types/ListClicksRequestSort.d.ts +1 -1
  13. package/dist/api/resources/clicks/types/ListClicksRequestSort.js +1 -1
  14. package/dist/api/resources/commissions/client/Client.d.ts +29 -7
  15. package/dist/api/resources/commissions/client/Client.js +56 -16
  16. package/dist/api/resources/commissions/client/requests/ApproveCommissionsRequest.d.ts +1 -1
  17. package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.d.ts +2 -2
  18. package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.d.ts +2 -2
  19. package/dist/api/resources/commissions/client/requests/DeclineCommissionsRequest.d.ts +1 -1
  20. package/dist/api/resources/commissions/client/requests/DeleteCommissionsRequest.d.ts +1 -1
  21. package/dist/api/resources/commissions/client/requests/GetCommissionsRequest.d.ts +1 -1
  22. package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +14 -5
  23. package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.d.ts +19 -4
  24. package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.js +8 -1
  25. package/dist/api/resources/commissions/client/requests/index.d.ts +1 -1
  26. package/dist/api/resources/commissions/client/requests/index.js +1 -1
  27. package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.d.ts +1 -0
  28. package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.js +1 -0
  29. package/dist/api/resources/commissions/types/ListCommissionsRequestSort.d.ts +1 -1
  30. package/dist/api/resources/commissions/types/ListCommissionsRequestSort.js +1 -1
  31. package/dist/api/resources/customers/client/Client.d.ts +27 -4
  32. package/dist/api/resources/customers/client/Client.js +42 -9
  33. package/dist/api/resources/customers/client/requests/CreateCustomersRequest.d.ts +20 -2
  34. package/dist/api/resources/customers/client/requests/CreateCustomersRequest.js +1 -0
  35. package/dist/api/resources/customers/client/requests/DeleteCustomersRequest.d.ts +1 -1
  36. package/dist/api/resources/customers/client/requests/GetCustomersRequest.d.ts +1 -1
  37. package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +14 -5
  38. package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.d.ts +15 -2
  39. package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.js +1 -0
  40. package/dist/api/resources/customers/types/ListCustomersRequestOrder.d.ts +1 -0
  41. package/dist/api/resources/customers/types/ListCustomersRequestOrder.js +1 -0
  42. package/dist/api/resources/customers/types/ListCustomersRequestSort.d.ts +1 -1
  43. package/dist/api/resources/customers/types/ListCustomersRequestSort.js +1 -1
  44. package/dist/api/resources/customers/types/ListCustomersRequestStatus.d.ts +1 -0
  45. package/dist/api/resources/customers/types/ListCustomersRequestStatus.js +1 -0
  46. package/dist/api/resources/embed/client/Client.d.ts +5 -2
  47. package/dist/api/resources/embed/client/Client.js +9 -4
  48. package/dist/api/resources/embed/client/index.d.ts +1 -1
  49. package/dist/api/resources/embed/client/index.js +1 -1
  50. package/dist/api/resources/embed/types/CreateTokenEmbedRequest.d.ts +1 -0
  51. package/dist/api/resources/embed/types/index.d.ts +1 -0
  52. package/dist/api/resources/embed/types/index.js +1 -0
  53. package/dist/api/resources/flows/client/Client.d.ts +7 -1
  54. package/dist/api/resources/flows/client/Client.js +13 -3
  55. package/dist/api/resources/flows/client/requests/GetFlowsRequest.d.ts +1 -1
  56. package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +13 -5
  57. package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +1 -0
  58. package/dist/api/resources/flows/types/ListFlowsRequestActive.js +1 -0
  59. package/dist/api/resources/flows/types/ListFlowsRequestOrder.d.ts +1 -0
  60. package/dist/api/resources/flows/types/ListFlowsRequestOrder.js +1 -0
  61. package/dist/api/resources/flows/types/ListFlowsRequestSort.d.ts +1 -1
  62. package/dist/api/resources/flows/types/ListFlowsRequestSort.js +1 -1
  63. package/dist/api/resources/groups/client/Client.d.ts +7 -1
  64. package/dist/api/resources/groups/client/Client.js +13 -3
  65. package/dist/api/resources/groups/client/requests/GetGroupsRequest.d.ts +1 -1
  66. package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +10 -5
  67. package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +1 -0
  68. package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +1 -0
  69. package/dist/api/resources/groups/types/ListGroupsRequestOrder.d.ts +1 -0
  70. package/dist/api/resources/groups/types/ListGroupsRequestOrder.js +1 -0
  71. package/dist/api/resources/groups/types/ListGroupsRequestSort.d.ts +1 -1
  72. package/dist/api/resources/groups/types/ListGroupsRequestSort.js +1 -1
  73. package/dist/api/resources/index.d.ts +0 -1
  74. package/dist/api/resources/index.js +0 -1
  75. package/dist/api/resources/links/client/Client.d.ts +17 -5
  76. package/dist/api/resources/links/client/Client.js +37 -11
  77. package/dist/api/resources/links/client/requests/CreateLinksRequest.d.ts +6 -2
  78. package/dist/api/resources/links/client/requests/DeleteLinksRequest.d.ts +1 -1
  79. package/dist/api/resources/links/client/requests/GetLinksRequest.d.ts +1 -1
  80. package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +12 -5
  81. package/dist/api/resources/links/client/requests/UpdateLinksRequest.d.ts +6 -2
  82. package/dist/api/resources/links/types/ListLinksRequestOrder.d.ts +1 -0
  83. package/dist/api/resources/links/types/ListLinksRequestOrder.js +1 -0
  84. package/dist/api/resources/links/types/ListLinksRequestSort.d.ts +1 -1
  85. package/dist/api/resources/links/types/ListLinksRequestSort.js +1 -1
  86. package/dist/api/resources/partners/client/Client.d.ts +39 -10
  87. package/dist/api/resources/partners/client/Client.js +66 -21
  88. package/dist/api/resources/partners/client/requests/ApprovePartnersRequest.d.ts +1 -1
  89. package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.d.ts +2 -2
  90. package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.d.ts +4 -2
  91. package/dist/api/resources/partners/client/requests/CreatePartnersRequest.d.ts +21 -7
  92. package/dist/api/resources/partners/client/requests/CreatePartnersRequest.js +1 -0
  93. package/dist/api/resources/partners/client/requests/GetPartnersRequest.d.ts +1 -1
  94. package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +11 -5
  95. package/dist/api/resources/partners/client/requests/RejectPartnersRequest.d.ts +2 -1
  96. package/dist/api/resources/partners/client/requests/SuspendPartnersRequest.d.ts +2 -1
  97. package/dist/api/resources/partners/client/requests/UpdatePartnersRequest.d.ts +10 -2
  98. package/dist/api/resources/partners/types/ListPartnersRequestOrder.d.ts +1 -0
  99. package/dist/api/resources/partners/types/ListPartnersRequestOrder.js +1 -0
  100. package/dist/api/resources/partners/types/ListPartnersRequestSort.d.ts +1 -1
  101. package/dist/api/resources/partners/types/ListPartnersRequestSort.js +1 -1
  102. package/dist/api/resources/partners/types/ListPartnersRequestStatus.d.ts +1 -0
  103. package/dist/api/resources/partners/types/ListPartnersRequestStatus.js +1 -0
  104. package/dist/api/resources/programs/client/Client.d.ts +7 -1
  105. package/dist/api/resources/programs/client/Client.js +13 -3
  106. package/dist/api/resources/programs/client/requests/GetProgramsRequest.d.ts +1 -1
  107. package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +8 -5
  108. package/dist/api/resources/programs/types/ListProgramsRequestOrder.d.ts +1 -0
  109. package/dist/api/resources/programs/types/ListProgramsRequestOrder.js +1 -0
  110. package/dist/api/resources/programs/types/ListProgramsRequestSort.d.ts +1 -1
  111. package/dist/api/resources/programs/types/ListProgramsRequestSort.js +1 -1
  112. package/dist/api/resources/promotionCodes/client/Client.d.ts +27 -5
  113. package/dist/api/resources/promotionCodes/client/Client.js +46 -10
  114. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.d.ts +9 -2
  115. package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.js +1 -0
  116. package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodesRequest.d.ts +1 -1
  117. package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodesRequest.d.ts +1 -1
  118. package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +11 -5
  119. package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.d.ts +8 -1
  120. package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.js +1 -0
  121. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.d.ts +1 -0
  122. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.js +1 -0
  123. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.d.ts +1 -1
  124. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.js +1 -1
  125. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.d.ts +1 -0
  126. package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.js +1 -0
  127. package/dist/api/resources/reports/client/Client.d.ts +15 -0
  128. package/dist/api/resources/reports/client/Client.js +30 -5
  129. package/dist/api/resources/reports/client/requests/CustomerStatsReportsRequest.d.ts +3 -0
  130. package/dist/api/resources/reports/client/requests/LinksReportsRequest.d.ts +8 -0
  131. package/dist/api/resources/reports/client/requests/OverviewReportsRequest.d.ts +3 -0
  132. package/dist/api/resources/reports/client/requests/PartnersReportsRequest.d.ts +8 -0
  133. package/dist/api/resources/reports/client/requests/TimeseriesReportsRequest.d.ts +5 -0
  134. package/dist/api/resources/reports/types/LinksReportsRequestOrder.d.ts +1 -0
  135. package/dist/api/resources/reports/types/LinksReportsRequestOrder.js +1 -0
  136. package/dist/api/resources/reports/types/LinksReportsRequestSort.d.ts +1 -0
  137. package/dist/api/resources/reports/types/LinksReportsRequestSort.js +1 -0
  138. package/dist/api/resources/reports/types/PartnersReportsRequestOrder.d.ts +1 -0
  139. package/dist/api/resources/reports/types/PartnersReportsRequestOrder.js +1 -0
  140. package/dist/api/resources/reports/types/PartnersReportsRequestSort.d.ts +1 -0
  141. package/dist/api/resources/reports/types/PartnersReportsRequestSort.js +1 -0
  142. package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.d.ts +1 -0
  143. package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.js +1 -0
  144. package/dist/api/resources/transactions/client/Client.d.ts +30 -7
  145. package/dist/api/resources/transactions/client/Client.js +53 -14
  146. package/dist/api/resources/transactions/client/requests/CreateTransactionsRequest.d.ts +17 -3
  147. package/dist/api/resources/transactions/client/requests/DeleteTransactionsRequest.d.ts +1 -1
  148. package/dist/api/resources/transactions/client/requests/GetTransactionsRequest.d.ts +1 -1
  149. package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +12 -5
  150. package/dist/api/resources/transactions/client/requests/RefundTransactionsRequest.d.ts +1 -1
  151. package/dist/api/resources/transactions/client/requests/RerunFlowsTransactionsRequest.d.ts +1 -1
  152. package/dist/api/resources/transactions/client/requests/UpdateTransactionsRequest.d.ts +13 -2
  153. package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.d.ts +1 -0
  154. package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.js +1 -0
  155. package/dist/api/resources/transactions/types/ListTransactionsRequestSort.d.ts +1 -1
  156. package/dist/api/resources/transactions/types/ListTransactionsRequestSort.js +1 -1
  157. package/dist/api/types/Commission.d.ts +1 -1
  158. package/dist/api/types/Customer.d.ts +2 -2
  159. package/dist/api/types/Error_.d.ts +1 -0
  160. package/dist/api/types/Error_.js +1 -0
  161. package/dist/environments.d.ts +2 -2
  162. package/dist/environments.js +1 -1
  163. package/package.json +1 -1
  164. package/dist/api/resources/embed/client/requests/CreateTokenEmbedRequest.d.ts +0 -14
  165. package/dist/api/resources/embed/client/requests/index.d.ts +0 -1
  166. package/dist/api/resources/embed/client/requests/index.js +0 -1
  167. /package/dist/api/resources/embed/{client/requests → types}/CreateTokenEmbedRequest.js +0 -0
@@ -1,45 +1,59 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * email: "sam@acme.com",
5
- * program_id: "prg_YRsbPDAK"
4
+ * email: "sam@example.com",
5
+ * program_id: "prg_T6z8aRW3XCmvFWP972RKxpAd",
6
+ * first_name: "Sam",
7
+ * last_name: "Taylor",
8
+ * group_id: "grp_zUQ8Pt281MsbNDApmDPN3Y2a",
9
+ * link: {
10
+ * value: "sam",
11
+ * param: "ref"
12
+ * }
6
13
  * }
7
14
  */
8
15
  export interface CreatePartnersRequest {
9
- /** Unique within the program, compared case-insensitively. */
16
+ /** Partner's email address, where program emails such as the welcome email go. It identifies the partner in the program, so it cannot match another partner's email there, ignoring case. */
10
17
  email: string;
18
+ /** Id of the program to add the partner to (prg_...), as returned when listing programs. */
11
19
  program_id: string;
20
+ /** Partner's first name. With last_name it is used for the default link value when link is omitted. */
12
21
  first_name?: string;
22
+ /** Partner's last name. With first_name it makes up the name shown for the partner unless display_name is set. */
13
23
  last_name?: string;
14
24
  /** Overrides the name shown for the partner; defaults to the first and last name. */
15
25
  display_name?: string;
26
+ /** Business the partner promotes through, if they are a company rather than a person. Leave it out for an individual. */
16
27
  company_name?: string;
17
28
  /** Two-letter ISO country code. */
18
29
  country_code?: string;
30
+ /** URL of the partner's website, starting with http:// or https://. */
19
31
  website_url?: string;
20
32
  /** Backdate the partner's creation time. Defaults to now. */
21
33
  created_at?: string;
22
34
  /** Group in the program. Defaults to the program's default group. */
23
35
  group_id?: string;
36
+ /** Use pending to add the partner as an application that still needs approval instead of an active partner. */
24
37
  status?: CreatePartnersRequest.Status;
25
- /** The referral link created with the partner. Defaults to a slug of the name or email. */
38
+ /** The referral link created with the partner. Leave it out to build the slug from the partner's name, or from the part of the email before the @ when there is no name. */
26
39
  link?: CreatePartnersRequest.Link;
27
40
  /** Send the partner the program's welcome email. Only goes out when the program's welcome email is enabled and the partner is active. */
28
41
  notify_partner?: boolean;
29
42
  }
30
43
  export declare namespace CreatePartnersRequest {
44
+ /** Use pending to add the partner as an application that still needs approval instead of an active partner. */
31
45
  const Status: {
32
46
  readonly Active: "active";
33
47
  readonly Pending: "pending";
34
48
  };
35
49
  type Status = (typeof Status)[keyof typeof Status];
36
50
  /**
37
- * The referral link created with the partner. Defaults to a slug of the name or email.
51
+ * The referral link created with the partner. Leave it out to build the slug from the partner's name, or from the part of the email before the @ when there is no name.
38
52
  */
39
53
  interface Link {
40
- /** The slug after the parameter, e.g. `sam` in `?ref=sam`. */
54
+ /** Slug that identifies the partner in referral URLs, such as `sam` in `?ref=sam`. Pick one that no other link uses with the same parameter. */
41
55
  value: string;
42
- /** Defaults to the program's first link parameter. */
56
+ /** Query parameter of the link, such as `ref` in `?ref=sam`. Leave it out to use the program's first link parameter. */
43
57
  param?: string | undefined;
44
58
  }
45
59
  }
@@ -1,6 +1,7 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  export var CreatePartnersRequest;
3
3
  (function (CreatePartnersRequest) {
4
+ /** Use pending to add the partner as an application that still needs approval instead of an active partner. */
4
5
  CreatePartnersRequest.Status = {
5
6
  Active: "active",
6
7
  Pending: "pending",
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * id: "id"
4
+ * id: "part_NLYzgNKuSuASvrvoxNtau6SY"
5
5
  * }
6
6
  */
7
7
  export interface GetPartnersRequest {
@@ -4,24 +4,30 @@ import type * as ToltApi from "../../../../index.js";
4
4
  * {}
5
5
  */
6
6
  export interface ListPartnersRequest {
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.ListPartnersRequestOrder;
9
- /** Column the list is ordered and paged by. */
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.ListPartnersRequestSort;
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
- /** Only items created at or after this ISO 8601 time. */
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
- /** Only items created before this ISO 8601 time. */
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 updated at or after this ISO 8601 time. Combine with sort=updated_at to sync changes. */
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 updated before this ISO 8601 time. */
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
+ /** Keep only partners at this review stage; approved partners appear as active. */
23
26
  status?: ToltApi.ListPartnersRequestStatus;
27
+ /** Limit to one program, by its id (prg_...) as returned when listing programs. */
24
28
  program_id?: string;
29
+ /** Limit to partners in one group, by the group id (grp_...) as returned when listing groups. */
25
30
  group_id?: string;
31
+ /** Text matched anywhere in the partner's id, email, first name, last name or company name, ignoring case. */
26
32
  search?: string;
27
33
  }
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * id: "id"
4
+ * id: "part_NLYzgNKuSuASvrvoxNtau6SY"
5
5
  * }
6
6
  */
7
7
  export interface RejectPartnersRequest {
8
8
  id: string;
9
+ /** Reason for the rejection, shown to the partner in the partner portal. Null clears an earlier note. */
9
10
  rejection_note?: string | null;
10
11
  }
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * id: "id"
4
+ * id: "part_NLYzgNKuSuASvrvoxNtau6SY"
5
5
  * }
6
6
  */
7
7
  export interface SuspendPartnersRequest {
8
8
  id: string;
9
+ /** Reason for the suspension, shown to the partner in the partner portal. Null clears an earlier reason. */
9
10
  suspension_reason?: string | null;
10
11
  }
@@ -1,16 +1,24 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * id: "id"
4
+ * id: "part_NLYzgNKuSuASvrvoxNtau6SY",
5
+ * first_name: "Sam",
6
+ * last_name: "Taylor",
7
+ * group_id: "grp_zUQ8Pt281MsbNDApmDPN3Y2a"
5
8
  * }
6
9
  */
7
10
  export interface UpdatePartnersRequest {
8
11
  id: string;
9
- email?: string;
12
+ /** Partner's first name, part of the name shown for them unless they have a display name; null clears it. */
10
13
  first_name?: string | null;
14
+ /** Partner's family name, shown with first_name in the dashboard and partner portal; null clears it. */
11
15
  last_name?: string | null;
16
+ /** Business the partner promotes through; null clears it. */
12
17
  company_name?: string | null;
18
+ /** Partner's country as a two-letter ISO code. Commission flows can match on it. */
13
19
  country_code?: string | null;
20
+ /** URL of the partner's website, starting with http:// or https://; null clears it. */
14
21
  website_url?: string | null;
22
+ /** Id of a group in the partner's program to move them to (grp_...), as returned when listing groups. Commission flows scoped to that group then apply to them; null removes them from their group. */
15
23
  group_id?: string | null;
16
24
  }
@@ -1,3 +1,4 @@
1
+ /** Ranking direction: desc puts the most recently created or updated rows first. */
1
2
  export declare const ListPartnersRequestOrder: {
2
3
  readonly Asc: "asc";
3
4
  readonly Desc: "desc";
@@ -1,4 +1,5 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
+ /** Ranking direction: desc puts the most recently created or updated rows first. */
2
3
  export const ListPartnersRequestOrder = {
3
4
  Asc: "asc",
4
5
  Desc: "desc",
@@ -1,4 +1,4 @@
1
- /** Column the list is ordered and paged by. */
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 ListPartnersRequestSort: {
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
- /** Column the list is ordered and paged by. */
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 ListPartnersRequestSort = {
4
4
  CreatedAt: "created_at",
5
5
  UpdatedAt: "updated_at",
@@ -1,3 +1,4 @@
1
+ /** Keep only partners at this review stage; approved partners appear as active. */
1
2
  export declare const ListPartnersRequestStatus: {
2
3
  readonly Active: "active";
3
4
  readonly Pending: "pending";
@@ -1,4 +1,5 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
+ /** Keep only partners at this review stage; approved partners appear as active. */
2
3
  export const ListPartnersRequestStatus = {
3
4
  Active: "active",
4
5
  Pending: "pending",
@@ -11,11 +11,14 @@ export declare class ProgramsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<ProgramsClient.Options>;
12
12
  constructor(options: ProgramsClient.Options);
13
13
  /**
14
+ * Lists the programs in your organization, with search, date filters and cursor pagination.
15
+ *
14
16
  * @param {ToltApi.ListProgramsRequest} request
15
17
  * @param {ProgramsClient.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,18 +29,21 @@ export declare class ProgramsClient {
26
29
  list(request?: ToltApi.ListProgramsRequest, requestOptions?: ProgramsClient.RequestOptions): core.HttpResponsePromise<ToltApi.ListProgramsResponse>;
27
30
  private __list;
28
31
  /**
32
+ * Gets a program by ID, with its name, currency, website, cookie duration and payout terms.
33
+ *
29
34
  * @param {ToltApi.GetProgramsRequest} request
30
35
  * @param {ProgramsClient.RequestOptions} requestOptions - Request-specific configuration.
31
36
  *
32
37
  * @throws {@link ToltApi.UnauthorizedError}
33
38
  * @throws {@link ToltApi.NotFoundError}
39
+ * @throws {@link ToltApi.ContentTooLargeError}
34
40
  * @throws {@link ToltApi.TooManyRequestsError}
35
41
  * @throws {@link errors.ToltApiError}
36
42
  * @throws {@link errors.ToltApiTimeoutError}
37
43
  *
38
44
  * @example
39
45
  * await client.programs.get({
40
- * id: "id"
46
+ * id: "prg_T6z8aRW3XCmvFWP972RKxpAd"
41
47
  * })
42
48
  */
43
49
  get(request: ToltApi.GetProgramsRequest, requestOptions?: ProgramsClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetProgramsResponse>;
@@ -11,11 +11,14 @@ export class ProgramsClient {
11
11
  this._options = normalizeClientOptionsWithAuth(options);
12
12
  }
13
13
  /**
14
+ * Lists the programs in your organization, with search, date filters and cursor pagination.
15
+ *
14
16
  * @param {ToltApi.ListProgramsRequest} request
15
17
  * @param {ProgramsClient.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}
@@ -45,7 +48,7 @@ export class ProgramsClient {
45
48
  const _response = await core.fetcher({
46
49
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
47
50
  (await core.Supplier.get(this._options.environment)) ??
48
- environments.ToltApiEnvironment.Production, "v2/programs"),
51
+ environments.ToltApiEnvironment.Default, "v2/programs"),
49
52
  method: "GET",
50
53
  headers: _headers,
51
54
  queryString: core.url
@@ -68,6 +71,8 @@ export class ProgramsClient {
68
71
  throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
69
72
  case 401:
70
73
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
74
+ case 413:
75
+ throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
71
76
  case 429:
72
77
  throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
73
78
  default:
@@ -81,18 +86,21 @@ export class ProgramsClient {
81
86
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/programs");
82
87
  }
83
88
  /**
89
+ * Gets a program by ID, with its name, currency, website, cookie duration and payout terms.
90
+ *
84
91
  * @param {ToltApi.GetProgramsRequest} request
85
92
  * @param {ProgramsClient.RequestOptions} requestOptions - Request-specific configuration.
86
93
  *
87
94
  * @throws {@link ToltApi.UnauthorizedError}
88
95
  * @throws {@link ToltApi.NotFoundError}
96
+ * @throws {@link ToltApi.ContentTooLargeError}
89
97
  * @throws {@link ToltApi.TooManyRequestsError}
90
98
  * @throws {@link errors.ToltApiError}
91
99
  * @throws {@link errors.ToltApiTimeoutError}
92
100
  *
93
101
  * @example
94
102
  * await client.programs.get({
95
- * id: "id"
103
+ * id: "prg_T6z8aRW3XCmvFWP972RKxpAd"
96
104
  * })
97
105
  */
98
106
  get(request, requestOptions) {
@@ -105,7 +113,7 @@ export class ProgramsClient {
105
113
  const _response = await core.fetcher({
106
114
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
107
115
  (await core.Supplier.get(this._options.environment)) ??
108
- environments.ToltApiEnvironment.Production, `v2/programs/${core.url.encodePathParam(id)}`),
116
+ environments.ToltApiEnvironment.Default, `v2/programs/${core.url.encodePathParam(id)}`),
109
117
  method: "GET",
110
118
  headers: _headers,
111
119
  queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
@@ -124,6 +132,8 @@ export class ProgramsClient {
124
132
  throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
125
133
  case 404:
126
134
  throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
135
+ case 413:
136
+ throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
127
137
  case 429:
128
138
  throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
129
139
  default:
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * id: "id"
4
+ * id: "prg_T6z8aRW3XCmvFWP972RKxpAd"
5
5
  * }
6
6
  */
7
7
  export interface GetProgramsRequest {
@@ -4,21 +4,24 @@ import type * as ToltApi from "../../../../index.js";
4
4
  * {}
5
5
  */
6
6
  export interface ListProgramsRequest {
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.ListProgramsRequestOrder;
9
- /** Column the list is ordered and paged by. */
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.ListProgramsRequestSort;
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
- /** Only items created at or after this ISO 8601 time. */
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
- /** Only items created before this ISO 8601 time. */
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 updated at or after this ISO 8601 time. Combine with sort=updated_at to sync changes. */
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 updated before this ISO 8601 time. */
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
+ /** Text matched anywhere in the program name, ignoring case. */
23
26
  search?: string;
24
27
  }
@@ -1,3 +1,4 @@
1
+ /** Ranking direction: desc puts the most recently created or updated rows first. */
1
2
  export declare const ListProgramsRequestOrder: {
2
3
  readonly Asc: "asc";
3
4
  readonly Desc: "desc";
@@ -1,4 +1,5 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
+ /** Ranking direction: desc puts the most recently created or updated rows first. */
2
3
  export const ListProgramsRequestOrder = {
3
4
  Asc: "asc",
4
5
  Desc: "desc",
@@ -1,4 +1,4 @@
1
- /** Column the list is ordered and paged by. */
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 ListProgramsRequestSort: {
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
- /** Column the list is ordered and paged by. */
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 ListProgramsRequestSort = {
4
4
  CreatedAt: "created_at",
5
5
  UpdatedAt: "updated_at",
@@ -11,11 +11,14 @@ export declare class PromotionCodesClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<PromotionCodesClient.Options>;
12
12
  constructor(options: PromotionCodesClient.Options);
13
13
  /**
14
+ * Lists promotion codes. Filter by program, partner or type, and page with cursors.
15
+ *
14
16
  * @param {ToltApi.ListPromotionCodesRequest} request
15
17
  * @param {PromotionCodesClient.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,71 +29,90 @@ export declare class PromotionCodesClient {
26
29
  list(request?: ToltApi.ListPromotionCodesRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.ListPromotionCodesResponse>;
27
30
  private __list;
28
31
  /**
32
+ * Creates a promotion code for a partner, so customers who use it are credited to them. A partner cannot have the same code twice.
33
+ *
29
34
  * @param {ToltApi.CreatePromotionCodesRequest} request
30
35
  * @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
31
36
  *
32
37
  * @throws {@link ToltApi.BadRequestError}
33
38
  * @throws {@link ToltApi.UnauthorizedError}
39
+ * @throws {@link ToltApi.ConflictError}
40
+ * @throws {@link ToltApi.ContentTooLargeError}
34
41
  * @throws {@link ToltApi.TooManyRequestsError}
35
42
  * @throws {@link errors.ToltApiError}
36
43
  * @throws {@link errors.ToltApiTimeoutError}
37
44
  *
38
45
  * @example
39
46
  * await client.promotionCodes.create({
40
- * code: "code",
41
- * partner_id: "partner_id"
47
+ * code: "SAM20",
48
+ * type: "percentage",
49
+ * value: "20",
50
+ * partner_id: "part_NLYzgNKuSuASvrvoxNtau6SY"
42
51
  * })
43
52
  */
44
53
  create(request: ToltApi.CreatePromotionCodesRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreatePromotionCodesResponse>;
45
54
  private __create;
46
55
  /**
56
+ * Gets a promotion code by ID, with its discount type and value and the partner, group or program it belongs to.
57
+ *
47
58
  * @param {ToltApi.GetPromotionCodesRequest} request
48
59
  * @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
49
60
  *
50
61
  * @throws {@link ToltApi.UnauthorizedError}
51
62
  * @throws {@link ToltApi.NotFoundError}
63
+ * @throws {@link ToltApi.ContentTooLargeError}
52
64
  * @throws {@link ToltApi.TooManyRequestsError}
53
65
  * @throws {@link errors.ToltApiError}
54
66
  * @throws {@link errors.ToltApiTimeoutError}
55
67
  *
56
68
  * @example
57
69
  * await client.promotionCodes.get({
58
- * id: "id"
70
+ * id: "promo_gTCAUsWfdmN2GuCVRaHWNRan"
59
71
  * })
60
72
  */
61
73
  get(request: ToltApi.GetPromotionCodesRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetPromotionCodesResponse>;
62
74
  private __get;
63
75
  /**
76
+ * Updates a promotion code's code, discount type or value.
77
+ *
64
78
  * @param {ToltApi.UpdatePromotionCodesRequest} request
65
79
  * @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
66
80
  *
67
81
  * @throws {@link ToltApi.BadRequestError}
68
82
  * @throws {@link ToltApi.UnauthorizedError}
69
83
  * @throws {@link ToltApi.NotFoundError}
84
+ * @throws {@link ToltApi.ConflictError}
85
+ * @throws {@link ToltApi.ContentTooLargeError}
70
86
  * @throws {@link ToltApi.TooManyRequestsError}
71
87
  * @throws {@link errors.ToltApiError}
72
88
  * @throws {@link errors.ToltApiTimeoutError}
73
89
  *
74
90
  * @example
75
91
  * await client.promotionCodes.update({
76
- * id: "id"
92
+ * id: "promo_gTCAUsWfdmN2GuCVRaHWNRan",
93
+ * code: "SAM20",
94
+ * type: "percentage",
95
+ * value: "20"
77
96
  * })
78
97
  */
79
98
  update(request: ToltApi.UpdatePromotionCodesRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.UpdatePromotionCodesResponse>;
80
99
  private __update;
81
100
  /**
101
+ * Deletes a promotion code, so customers who use it afterwards are no longer attributed through it.
102
+ *
82
103
  * @param {ToltApi.DeletePromotionCodesRequest} request
83
104
  * @param {PromotionCodesClient.RequestOptions} requestOptions - Request-specific configuration.
84
105
  *
85
106
  * @throws {@link ToltApi.UnauthorizedError}
86
107
  * @throws {@link ToltApi.NotFoundError}
108
+ * @throws {@link ToltApi.ContentTooLargeError}
87
109
  * @throws {@link ToltApi.TooManyRequestsError}
88
110
  * @throws {@link errors.ToltApiError}
89
111
  * @throws {@link errors.ToltApiTimeoutError}
90
112
  *
91
113
  * @example
92
114
  * await client.promotionCodes.delete({
93
- * id: "id"
115
+ * id: "promo_gTCAUsWfdmN2GuCVRaHWNRan"
94
116
  * })
95
117
  */
96
118
  delete(request: ToltApi.DeletePromotionCodesRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.DeletePromotionCodesResponse>;