import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export declare const Type: { readonly Click: "click"; readonly Lead: "lead"; readonly Sale: "sale"; readonly Custom: "custom"; }; export type Type = ClosedEnum; /** * Filter the list of commissions by their corresponding status. */ export declare const QueryParamStatus: { readonly Pending: "pending"; readonly Processed: "processed"; readonly Paid: "paid"; readonly Refunded: "refunded"; readonly Duplicate: "duplicate"; readonly Fraud: "fraud"; readonly Canceled: "canceled"; }; /** * Filter the list of commissions by their corresponding status. */ export type QueryParamStatus = ClosedEnum; /** * The field to sort the list of commissions by. */ export declare const ListCommissionsQueryParamSortBy: { readonly CreatedAt: "createdAt"; readonly Amount: "amount"; }; /** * The field to sort the list of commissions by. */ export type ListCommissionsQueryParamSortBy = ClosedEnum; /** * The sort order for the list of commissions. */ export declare const ListCommissionsQueryParamSortOrder: { readonly Asc: "asc"; readonly Desc: "desc"; }; /** * The sort order for the list of commissions. */ export type ListCommissionsQueryParamSortOrder = ClosedEnum; /** * The interval to retrieve commissions for. */ export declare const ListCommissionsQueryParamInterval: { readonly TwentyFourh: "24h"; readonly Sevend: "7d"; readonly Thirtyd: "30d"; readonly Ninetyd: "90d"; readonly Oney: "1y"; readonly Mtd: "mtd"; readonly Qtd: "qtd"; readonly Ytd: "ytd"; readonly All: "all"; }; /** * The interval to retrieve commissions for. */ export type ListCommissionsQueryParamInterval = ClosedEnum; export type ListCommissionsRequest = { type?: Type | undefined; /** * Filter the list of commissions by the associated customer. */ customerId?: string | undefined; /** * Filter the list of commissions by the associated payout. */ payoutId?: string | undefined; /** * Filter the list of commissions by the associated partner. When specified, takes precedence over `tenantId`. */ partnerId?: string | undefined; /** * Filter the list of commissions by the associated partner's `tenantId` (their unique ID within your database). */ tenantId?: string | undefined; /** * Filter the list of commissions by the associated partner group. */ groupId?: string | undefined; /** * Filter the list of commissions by the associated invoice. Since invoiceId is unique on a per-program basis, this will only return one commission per invoice. */ invoiceId?: string | undefined; /** * Filter the list of commissions by their corresponding status. */ status?: QueryParamStatus | undefined; /** * The field to sort the list of commissions by. */ sortBy?: ListCommissionsQueryParamSortBy | undefined; /** * The sort order for the list of commissions. */ sortOrder?: ListCommissionsQueryParamSortOrder | undefined; /** * The interval to retrieve commissions for. */ interval?: ListCommissionsQueryParamInterval | undefined; /** * The start date of the date range to filter the commissions by. */ start?: string | undefined; /** * The end date of the date range to filter the commissions by. */ end?: string | undefined; timezone?: string | undefined; /** * If specified, the query only searches for results before this cursor. Mutually exclusive with `startingAfter`. */ endingBefore?: string | undefined; /** * If specified, the query only searches for results after this cursor. Mutually exclusive with `endingBefore`. */ startingAfter?: string | undefined; /** * DEPRECATED. Use `startingAfter` instead. */ page?: number | undefined; /** * The number of items per page. */ pageSize?: number | undefined; }; export declare const ListCommissionsType: { readonly Click: "click"; readonly Lead: "lead"; readonly Sale: "sale"; readonly Custom: "custom"; }; export type ListCommissionsType = ClosedEnum; export declare const ListCommissionsStatus: { readonly Pending: "pending"; readonly Processed: "processed"; readonly Paid: "paid"; readonly Refunded: "refunded"; readonly Duplicate: "duplicate"; readonly Fraud: "fraud"; readonly Canceled: "canceled"; }; export type ListCommissionsStatus = ClosedEnum; export type ListCommissionsPartner = { /** * The partner's unique ID on Dub. */ id: string; /** * The partner's full legal name. */ name: string; /** * The partner's email address. Should be a unique value across Dub. */ email: string | null; /** * The partner's avatar image. */ image: string | null; /** * The date when the partner enabled payouts. */ payoutsEnabledAt: string | null; /** * The partner's country (required for tax purposes). */ country: string | null; /** * The partner's group ID on Dub. */ groupId?: string | null | undefined; }; export type ListCommissionsCustomer = { /** * The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). */ id: string; /** * Name of the customer. */ name: string; /** * Email of the customer. */ email?: string | null | undefined; /** * Avatar URL of the customer. */ avatar?: string | null | undefined; /** * Unique identifier for the customer in the client's app. */ externalId: string; /** * The customer's Stripe customer ID. This is useful for attributing recurring sale events to the partner who referred the customer. */ stripeCustomerId?: string | null | undefined; /** * Country of the customer. */ country?: string | null | undefined; /** * Total number of sales for the customer. */ sales?: number | null | undefined; /** * Total amount of sales for the customer. */ saleAmount?: number | null | undefined; /** * The date the customer was created (usually the signup date or trial start date). */ createdAt: string; /** * The date the customer made their first sale. Useful for calculating the time to first sale and LTV. */ firstSaleAt?: string | null | undefined; /** * The date the customer canceled their subscription. Useful for calculating LTV and churn rate. */ subscriptionCanceledAt?: string | null | undefined; }; export type ListCommissionsResponseBody = { /** * The commission's unique ID on Dub. */ id: string; type?: ListCommissionsType | undefined; amount: number; earnings: number; currency: string; status: ListCommissionsStatus; invoiceId: string | null; description: string | null; quantity: number; /** * The user who created the manual commission. */ userId?: string | null | undefined; createdAt: string; updatedAt: string; partner: ListCommissionsPartner; customer?: ListCommissionsCustomer | null | undefined; }; export type ListCommissionsResponse = { result: Array; }; /** @internal */ export declare const Type$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const QueryParamStatus$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const ListCommissionsQueryParamSortBy$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const ListCommissionsQueryParamSortOrder$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const ListCommissionsQueryParamInterval$outboundSchema: z.ZodNativeEnum; /** @internal */ export type ListCommissionsRequest$Outbound = { type?: string | undefined; customerId?: string | undefined; payoutId?: string | undefined; partnerId?: string | undefined; tenantId?: string | undefined; groupId?: string | undefined; invoiceId?: string | undefined; status?: string | undefined; sortBy: string; sortOrder: string; interval: string; start?: string | undefined; end?: string | undefined; timezone?: string | undefined; endingBefore?: string | undefined; startingAfter?: string | undefined; page?: number | undefined; pageSize: number; }; /** @internal */ export declare const ListCommissionsRequest$outboundSchema: z.ZodType; export declare function listCommissionsRequestToJSON(listCommissionsRequest: ListCommissionsRequest): string; /** @internal */ export declare const ListCommissionsType$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const ListCommissionsStatus$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const ListCommissionsPartner$inboundSchema: z.ZodType; export declare function listCommissionsPartnerFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const ListCommissionsCustomer$inboundSchema: z.ZodType; export declare function listCommissionsCustomerFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const ListCommissionsResponseBody$inboundSchema: z.ZodType; export declare function listCommissionsResponseBodyFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const ListCommissionsResponse$inboundSchema: z.ZodType; export declare function listCommissionsResponseFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=listcommissions.d.ts.map