import { APIResource } from "../../../core/resource.mjs"; import * as ConfigsAPI from "./configs.mjs"; import { ConfigListResponse, ConfigRetrieveResponse, ConfigUpdateParams, ConfigUpdateResponse, Configs } from "./configs.mjs"; import { APIPromise } from "../../../core/api-promise.mjs"; import { RequestOptions } from "../../../internal/request-options.mjs"; export declare class TakeRate extends APIResource { configs: ConfigsAPI.Configs; /** * Administrative endpoint to create or update the global flat take-rate * configuration. This admin-only endpoint manages the single flat commission rate * used across all campaigns. * * @example * ```ts * const response = await client.admin.takeRate.config({ * percentage: 15, * }); * ``` */ config(body: TakeRateConfigParams, options?: RequestOptions): APIPromise; /** * Administrative endpoint to validate that an offer amount meets the minimum * commission requirements. This admin-only endpoint checks if the proposed offer * amount will generate at least the $10 minimum commission when the 15% take-rate * is applied. It returns validation status and the minimum required offer amount * if the current amount is insufficient. * * @example * ```ts * const response = await client.admin.takeRate.validateOffer({ * offerAmount: 1, * }); * ``` */ validateOffer(body: TakeRateValidateOfferParams, options?: RequestOptions): APIPromise; } export interface TakeRateConfigResponse { data: TakeRateConfigResponse.Data; message: string; success: boolean; } export declare namespace TakeRateConfigResponse { interface Data { id: string; createdAt: string; isActive: boolean; maxAmount: number | null; minAmount: number | null; name: string; percentage: number; updatedAt: string; } } export interface TakeRateValidateOfferResponse { data: TakeRateValidateOfferResponse.Data; success: boolean; } export declare namespace TakeRateValidateOfferResponse { interface Data { isValid: boolean; message: string; minimumRequired?: number; takeRateAmount?: number; } } export interface TakeRateConfigParams { /** * Take-rate percentage (0-25%) */ percentage: number; /** * Maximum commission amount in USD */ maxAmount?: number; /** * Minimum commission amount in USD */ minAmount?: number; } export interface TakeRateValidateOfferParams { offerAmount: number; } export declare namespace TakeRate { export { type TakeRateConfigResponse as TakeRateConfigResponse, type TakeRateValidateOfferResponse as TakeRateValidateOfferResponse, type TakeRateConfigParams as TakeRateConfigParams, type TakeRateValidateOfferParams as TakeRateValidateOfferParams, }; export { Configs as Configs, type ConfigRetrieveResponse as ConfigRetrieveResponse, type ConfigUpdateResponse as ConfigUpdateResponse, type ConfigListResponse as ConfigListResponse, type ConfigUpdateParams as ConfigUpdateParams, }; } //# sourceMappingURL=take-rate.d.mts.map