export type CreateApiBusinessModelsApiTransactionsOwnerChargesByListingArgs = {body: {name: string, category?: ('advertising' | 'cleaning' | 'damage_waiver' | 'electricity' | 'furniture_appliances' | 'gas' | 'internet' | 'lock_automation' | 'management' | 'mortgage' | 'pest_control' | 'pool_cleaning' | 'property_taxes' | 'repairs_maintenance' | 'supplies_purchases' | 'other_misc' | 'taxes_paid' | 'telephone' | 'television' | 'trash' | 'water_septic' | 'guest_cleaning' | 'owner_cleaning' | 'channel_commission' | 'payment_charge' | 'pet_fee' | 'startup_fee' | 'fotoshoot' | 'vat' | 'gst' | 'insurance' | 'monitoring_surveillance' | 'garden_maintenance' | 'jacuzzi_maintenance' | 'sauna_maintenance' | 'photoshoot' | 'bank_fees' | 'sta_licensing' | 'security' | 'laundry' | 'listing_fee' | 'gardening' | 'guest_compensation' | 'home_improvement' | 'other_expenses' | 'other_income' | 'other_services_ops_assistants' | 'painting' | 'plumbing' | 'refund' | 'refund_security_deposit' | 'rubbish_removal_service' | 'set_up_fee' | 'strata_rates' | 'security_deposit') | undefined, categoryId?: string | undefined, description: string, amount: number, recognitionDate: string, ownerId: string, listingId?: string | undefined, revenueShare?: {shareSplit: number, vendorId: string} | undefined, vatOCConfig?: ({name: string, description: string, percent: number, categoryCode?: ('vat' | 'gst') | undefined, categoryId?: string | undefined, categoryName?: string | undefined}) | undefined, referenceId?: string | undefined, attachments?: Array<{url: string, urlThumbnail: string, extension: string, fileName: string}> | undefined}}; export type CreateApiBusinessModelsApiTransactionsOwnerChargesByListingOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create owner charges by listing * * POST /business-models-api/transactions/owner-charges-by-listing */ export const createApiBusinessModelsApiTransactionsOwnerChargesByListing = async (args: CreateApiBusinessModelsApiTransactionsOwnerChargesByListingArgs, options?: CreateApiBusinessModelsApiTransactionsOwnerChargesByListingOptions) => { const {baseUrl = "https://open-api.guesty.com/v1", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set("authorization", bearerAuth) const url = `${baseUrl.replace(/\/+$/, '')}/business-models-api/transactions/owner-charges-by-listing${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 };