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"; /** * Useful for marking a commission as pending, refunded, duplicate, canceled, or fraudulent. Takes precedence over `saleAmount` and `modifySaleAmount`. When a commission is marked as pending, refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated. */ export declare const Status: { readonly Pending: "pending"; readonly Refunded: "refunded"; readonly Duplicate: "duplicate"; readonly Canceled: "canceled"; readonly Fraud: "fraud"; }; /** * Useful for marking a commission as pending, refunded, duplicate, canceled, or fraudulent. Takes precedence over `saleAmount` and `modifySaleAmount`. When a commission is marked as pending, refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated. */ export type Status = ClosedEnum; export type UpdateCommissionRequestBody = { /** * The new absolute amount for the sale. Paid commissions cannot be updated. */ saleAmount?: number | undefined; /** * Modify the current sale amount: use positive values to increase the amount, negative values to decrease it. Takes precedence over `saleAmount`. Paid commissions cannot be updated. */ modifySaleAmount?: number | undefined; /** * The new absolute earnings for the custom commission. Paid commissions cannot be updated. */ earnings?: number | undefined; /** * The currency of the sale amount to update. Accepts ISO 4217 currency codes. */ currency?: string | undefined; /** * Useful for marking a commission as pending, refunded, duplicate, canceled, or fraudulent. Takes precedence over `saleAmount` and `modifySaleAmount`. When a commission is marked as pending, refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated. */ status?: Status | undefined; /** * Deprecated. Use `saleAmount` instead. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ amount?: number | undefined; /** * Deprecated. Use `modifySaleAmount` instead. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ modifyAmount?: number | undefined; }; export type UpdateCommissionRequest = { /** * The commission's unique ID on Dub. */ id: string; requestBody?: UpdateCommissionRequestBody | undefined; }; export declare const UpdateCommissionType: { readonly Click: "click"; readonly Lead: "lead"; readonly Sale: "sale"; readonly Custom: "custom"; }; export type UpdateCommissionType = ClosedEnum; export declare const UpdateCommissionStatus: { readonly Pending: "pending"; readonly Processed: "processed"; readonly Paid: "paid"; readonly Refunded: "refunded"; readonly Duplicate: "duplicate"; readonly Fraud: "fraud"; readonly Canceled: "canceled"; }; export type UpdateCommissionStatus = ClosedEnum; export type UpdateCommissionPartner = { /** * 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 UpdateCommissionCustomer = { /** * 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; }; /** * The updated commission. */ export type UpdateCommissionResponseBody = { /** * The commission's unique ID on Dub. */ id: string; type?: UpdateCommissionType | undefined; amount: number; earnings: number; currency: string; status: UpdateCommissionStatus; invoiceId: string | null; description: string | null; quantity: number; /** * The user who created the manual commission. */ userId?: string | null | undefined; createdAt: string; updatedAt: string; partner: UpdateCommissionPartner; customer?: UpdateCommissionCustomer | null | undefined; }; /** @internal */ export declare const Status$outboundSchema: z.ZodNativeEnum; /** @internal */ export type UpdateCommissionRequestBody$Outbound = { saleAmount?: number | undefined; modifySaleAmount?: number | undefined; earnings?: number | undefined; currency: string; status?: string | undefined; amount?: number | undefined; modifyAmount?: number | undefined; }; /** @internal */ export declare const UpdateCommissionRequestBody$outboundSchema: z.ZodType; export declare function updateCommissionRequestBodyToJSON(updateCommissionRequestBody: UpdateCommissionRequestBody): string; /** @internal */ export type UpdateCommissionRequest$Outbound = { id: string; RequestBody?: UpdateCommissionRequestBody$Outbound | undefined; }; /** @internal */ export declare const UpdateCommissionRequest$outboundSchema: z.ZodType; export declare function updateCommissionRequestToJSON(updateCommissionRequest: UpdateCommissionRequest): string; /** @internal */ export declare const UpdateCommissionType$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const UpdateCommissionStatus$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const UpdateCommissionPartner$inboundSchema: z.ZodType; export declare function updateCommissionPartnerFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const UpdateCommissionCustomer$inboundSchema: z.ZodType; export declare function updateCommissionCustomerFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const UpdateCommissionResponseBody$inboundSchema: z.ZodType; export declare function updateCommissionResponseBodyFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=updatecommission.d.ts.map