export type AccountConfig = {id?: number | undefined, company_id: number, account_id?: number | undefined, accounttype_id?: number | undefined, paymentmethod_id?: number | undefined, currency_id?: number | undefined, any_currency?: boolean | undefined, created_at?: string | undefined, updated_at?: string | undefined}; export type CreateApiApiV1GwAccountconfigsArgs = {body: AccountConfig}; export type CreateApiApiV1GwAccountconfigsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Configuración de cuentas - Crear * * POST /api/v1/gw/accountconfigs */ export const createApiApiV1GwAccountconfigs = async (args: CreateApiApiV1GwAccountconfigsArgs, options: CreateApiApiV1GwAccountconfigsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/gw/accountconfigs${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 };