export type CreateApiAccountsOidPayoutDestinationsPayoutDestinationIdPayoutsArgs = {oid: unknown, payout_destination_id: string}; export type CreateApiAccountsOidPayoutDestinationsPayoutDestinationIdPayoutsOptions = {baseUrl?: string | undefined, JWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * oid_mgmnt_payout_destinations_payouts_post * * POST /accounts/{oid}/payout-destinations/{payout_destination_id}/payouts */ export const createApiAccountsOidPayoutDestinationsPayoutDestinationIdPayouts = async (args: CreateApiAccountsOidPayoutDestinationsPayoutDestinationIdPayoutsArgs, options?: CreateApiAccountsOidPayoutDestinationsPayoutDestinationIdPayoutsOptions) => { const {baseUrl = "https://api.dintero.com/v1", fetch: fetchFn = fetch, JWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (JWT !== undefined) headers.set('authorization', `Bearer ${JWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/accounts/${encodeURIComponent(String(args.oid))}/payout-destinations/${encodeURIComponent(String(args.payout_destination_id))}/payouts${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };