export type CreateApiNetworksAffiliateSignupArgs = {body: {firstname: string, lastname: string, email: string, phone?: string | undefined, legal_type?: ('individual' | 'partnership' | 'corporation' | 'sole_proprietorship' | 'other' | 'foreign' | 'llc' | 'llp' | 'non_profit' | 'non_us_entity') | undefined, company: string, website: string, advertise_method_description: string, custom_terms?: string | undefined, platform_terms?: string | undefined, contact_address: {address_1?: string | undefined, address_2?: string | undefined, city?: string | undefined, region_code?: string | undefined, country_id?: number | undefined, zip_postal_code?: string | undefined}, referral_code?: string | undefined, tax_id?: string | undefined, affiliate_manager_encoded_value?: string | undefined, referrer_encoded_value?: string | undefined, password?: string | undefined, billing: {payment_type: 'none' | 'pay' | 'paypal' | 'check' | 'wire' | 'direct_deposit' | 'tipalti' | 'paxum' | 'veem' | 'payoneer' | 'bitcoin' | 'webmoney' | 'capitalist' | 'transferwise' | 'gift_card' | 'masspay' | 'skrill', billing: {paxum_id?: string | undefined, paypal_reception_method?: string | undefined, reception_identifier?: string | undefined, email?: string | undefined, is_existing_payee?: boolean | undefined, idap?: string | undefined, first_name?: string | undefined, last_name?: string | undefined, phone?: string | undefined, country_iso?: string | undefined, bank_name?: string | undefined, bank_address?: string | undefined, account_name?: string | undefined, account_number?: string | undefined, routing_number?: string | undefined, swift_code?: string | undefined}}, custom_field_values?: Array<{network_signup_custom_field_id: number, field_value: string}> | undefined}}; export type CreateApiNetworksAffiliateSignupOptions = {baseUrl?: string | undefined, APIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Submit Affiliate Signup * * POST /networks/affiliate/signup */ export const createApiNetworksAffiliateSignup = async (args: CreateApiNetworksAffiliateSignupArgs, options?: CreateApiNetworksAffiliateSignupOptions) => { const {baseUrl = "https://api.eflow.team/v1", fetch: fetchFn = fetch, APIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (APIKey !== undefined) headers.set("X-Eflow-Api-Key", APIKey) const url = `${baseUrl.replace(/\/+$/, '')}/networks/affiliate/signup${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };