import { APIResource } from "../../../../core/resource.mjs"; import { APIPromise } from "../../../../core/api-promise.mjs"; import { RequestOptions } from "../../../../internal/request-options.mjs"; export declare class TakeRate extends APIResource { /** * Administrative endpoint to calculate the take-rate commission and pricing * breakdown for a campaign lead offer. This admin-only endpoint determines the * flat 15% commission, influencer earnings, and brand cost based on the offered * amount. The calculation includes validation for minimum commission requirements * and creates a pricing record for the lead. * * @example * ```ts * const response = * await client.admin.campaigns.leads.takeRate.calculate( * '123e4567-e89b-12d3-a456-426614174000', * { offerAmount: 1000 }, * ); * ``` */ calculate(campaignLeadID: string, body: TakeRateCalculateParams, options?: RequestOptions): APIPromise; /** * Administrative endpoint to retrieve the detailed pricing breakdown for a * campaign lead including original price, take-rate amount, influencer earnings, * and brand cost. This admin-only endpoint provides transparency into the * commission structure and shows both what the influencer receives and what the * brand pays. * * @example * ```ts * const response = * await client.admin.campaigns.leads.takeRate.retrieveBreakdown( * '123e4567-e89b-12d3-a456-426614174000', * ); * ``` */ retrieveBreakdown(campaignLeadID: string, options?: RequestOptions): APIPromise; } export interface TakeRateCalculateResponse { data: TakeRateCalculateResponse.Data; success: boolean; } export declare namespace TakeRateCalculateResponse { interface Data { breakdown: Data.Breakdown; configUsed: Data.ConfigUsed; pricing: Data.Pricing; } namespace Data { interface Breakdown { actualOfferAmount: number; brandCost: number; currency: string; influencerEarnings: number; offerAmount: number; originalPrice: number; takeRateAmount: number; takeRatePercentage: number; } interface ConfigUsed { id: string; name: string; percentage: number; } interface Pricing { id: string; brandCost: number; campaignLeadId: string; currency: string; influencerEarnings: number; originalPrice: number; takeRateAmount: number; takeRatePercentage: number; } } } export interface TakeRateRetrieveBreakdownResponse { data: TakeRateRetrieveBreakdownResponse.Data | null; success: boolean; } export declare namespace TakeRateRetrieveBreakdownResponse { interface Data { actualOfferAmount: number; brandCost: number; currency: string; influencerEarnings: number; offerAmount: number; originalPrice: number; takeRateAmount: number; takeRatePercentage: number; } } export interface TakeRateCalculateParams { /** * The offer amount in USD for which to calculate take-rate */ offerAmount: number; /** * Currency code for the offer amount */ currency?: string; } export declare namespace TakeRate { export { type TakeRateCalculateResponse as TakeRateCalculateResponse, type TakeRateRetrieveBreakdownResponse as TakeRateRetrieveBreakdownResponse, type TakeRateCalculateParams as TakeRateCalculateParams, }; } //# sourceMappingURL=take-rate.d.mts.map