@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.
- package/README.md +2 -2
- 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
|
@@ -1,45 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* email: "sam@
|
|
5
|
-
* program_id: "
|
|
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
|
-
/**
|
|
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.
|
|
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.
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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",
|
|
@@ -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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
+
/** 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: "
|
|
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: "
|
|
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: "
|
|
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
|
-
|
|
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,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 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
|
-
/**
|
|
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",
|
|
@@ -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: "
|
|
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.
|
|
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: "
|
|
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.
|
|
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:
|
|
@@ -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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
+
/** Text matched anywhere in the program name, ignoring case. */
|
|
23
26
|
search?: string;
|
|
24
27
|
}
|
|
@@ -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 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
|
-
/**
|
|
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: "
|
|
41
|
-
*
|
|
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: "
|
|
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: "
|
|
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: "
|
|
115
|
+
* id: "promo_gTCAUsWfdmN2GuCVRaHWNRan"
|
|
94
116
|
* })
|
|
95
117
|
*/
|
|
96
118
|
delete(request: ToltApi.DeletePromotionCodesRequest, requestOptions?: PromotionCodesClient.RequestOptions): core.HttpResponsePromise<ToltApi.DeletePromotionCodesResponse>;
|