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 type GetCustomerRequest = { /** * 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; /** * Whether to include expanded fields on the customer (`link`, `partner`, `discount`). */ includeExpandedFields?: boolean | undefined; }; export type GetCustomerLink = { /** * 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 GetCustomerPartner = { /** * 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 GetCustomerType: { readonly Percentage: "percentage"; readonly Flat: "flat"; }; export type GetCustomerType = ClosedEnum; export type GetCustomerDiscount = { id: string; amount: number; type: GetCustomerType; maxDuration: number | null; couponId: string | null; couponTestId: string | null; description?: string | null | undefined; partnersCount?: number | null | undefined; }; /** * The customer object. */ export type GetCustomerResponseBody = { /** * 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?: GetCustomerLink | null | undefined; programId?: string | null | undefined; partner?: GetCustomerPartner | null | undefined; discount?: GetCustomerDiscount | null | undefined; }; /** @internal */ export type GetCustomerRequest$Outbound = { id: string; includeExpandedFields?: boolean | undefined; }; /** @internal */ export declare const GetCustomerRequest$outboundSchema: z.ZodType; export declare function getCustomerRequestToJSON(getCustomerRequest: GetCustomerRequest): string; /** @internal */ export declare const GetCustomerLink$inboundSchema: z.ZodType; export declare function getCustomerLinkFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const GetCustomerPartner$inboundSchema: z.ZodType; export declare function getCustomerPartnerFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const GetCustomerType$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const GetCustomerDiscount$inboundSchema: z.ZodType; export declare function getCustomerDiscountFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const GetCustomerResponseBody$inboundSchema: z.ZodType; export declare function getCustomerResponseBodyFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=getcustomer.d.ts.map