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"; /** * The field to sort the customers by. The default is `createdAt`. */ export declare const GetCustomersQueryParamSortBy: { readonly CreatedAt: "createdAt"; readonly SaleAmount: "saleAmount"; readonly FirstSaleAt: "firstSaleAt"; readonly SubscriptionCanceledAt: "subscriptionCanceledAt"; }; /** * The field to sort the customers by. The default is `createdAt`. */ export type GetCustomersQueryParamSortBy = ClosedEnum; /** * The sort order. The default is `desc`. */ export declare const GetCustomersQueryParamSortOrder: { readonly Asc: "asc"; readonly Desc: "desc"; }; /** * The sort order. The default is `desc`. */ export type GetCustomersQueryParamSortOrder = ClosedEnum; export type GetCustomersRequest = { /** * A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. Takes precedence over `externalId`. */ email?: string | undefined; /** * A case-sensitive filter on the list based on the customer's `externalId` field. The value must be a string. Takes precedence over `search`. */ externalId?: string | undefined; /** * A search query to filter customers by email, externalId, or name. If `email` or `externalId` is provided, this will be ignored. */ search?: string | undefined; /** * A filter on the list based on the customer's `country` field. */ country?: string | undefined; /** * A filter on the list based on the customer's `linkId` field (the referral link ID). */ linkId?: string | undefined; /** * Program ID to filter by. */ programId?: string | undefined; /** * Partner ID to filter by. */ partnerId?: string | undefined; /** * Whether to include expanded fields on the customer (`link`, `partner`, `discount`). */ includeExpandedFields?: boolean | undefined; /** * The field to sort the customers by. The default is `createdAt`. */ sortBy?: GetCustomersQueryParamSortBy | undefined; /** * The sort order. The default is `desc`. */ sortOrder?: GetCustomersQueryParamSortOrder | 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 type GetCustomersLink = { /** * The unique ID of the short link. */ id: string; /** * The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains). */ domain: string; /** * The short link slug. If not provided, a random 7-character slug will be generated. */ key: string; /** * The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`). */ shortLink: string; /** * The destination URL of the short link. */ url: string; /** * The ID of the program the short link is associated with. */ programId: string | null; }; export type GetCustomersPartner = { /** * 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; }; export declare const GetCustomersType: { readonly Percentage: "percentage"; readonly Flat: "flat"; }; export type GetCustomersType = ClosedEnum; export type Discount = { id: string; amount: number; type: GetCustomersType; maxDuration: number | null; couponId: string | null; couponTestId: string | null; description?: string | null | undefined; partnersCount?: number | null | undefined; }; export type GetCustomersResponseBody = { /** * 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; link?: GetCustomersLink | null | undefined; programId?: string | null | undefined; partner?: GetCustomersPartner | null | undefined; discount?: Discount | null | undefined; }; export type GetCustomersResponse = { result: Array; }; /** @internal */ export declare const GetCustomersQueryParamSortBy$outboundSchema: z.ZodNativeEnum; /** @internal */ export declare const GetCustomersQueryParamSortOrder$outboundSchema: z.ZodNativeEnum; /** @internal */ export type GetCustomersRequest$Outbound = { email?: string | undefined; externalId?: string | undefined; search?: string | undefined; country?: string | undefined; linkId?: string | undefined; programId?: string | undefined; partnerId?: string | undefined; includeExpandedFields?: boolean | undefined; sortBy: string; sortOrder: string; endingBefore?: string | undefined; startingAfter?: string | undefined; page?: number | undefined; pageSize: number; }; /** @internal */ export declare const GetCustomersRequest$outboundSchema: z.ZodType; export declare function getCustomersRequestToJSON(getCustomersRequest: GetCustomersRequest): string; /** @internal */ export declare const GetCustomersLink$inboundSchema: z.ZodType; export declare function getCustomersLinkFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const GetCustomersPartner$inboundSchema: z.ZodType; export declare function getCustomersPartnerFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const GetCustomersType$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Discount$inboundSchema: z.ZodType; export declare function discountFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const GetCustomersResponseBody$inboundSchema: z.ZodType; export declare function getCustomersResponseBodyFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const GetCustomersResponse$inboundSchema: z.ZodType; export declare function getCustomersResponseFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=getcustomers.d.ts.map