export type GetApiV1MarketplaceEstablishmentsTransfersArgs = {'integration-key': string, 'x-token': string}; export type GetApiV1MarketplaceEstablishmentsTransfersOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /v1/marketplace/establishments/transfers */ export const getApiV1MarketplaceEstablishmentsTransfers = async (args: GetApiV1MarketplaceEstablishmentsTransfersArgs, options?: GetApiV1MarketplaceEstablishmentsTransfersOptions) => { const {baseUrl = "https://api.sandbox.paytime.com.br", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['integration-key'] != null) headers.set("integration-key", String(args['integration-key'])) if (args['x-token'] != null) headers.set("x-token", String(args['x-token'])) if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/marketplace/establishments/transfers${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };