export type GetApiTransactionsCompositeTransactionIdMessageArgs = {'orderful-api-key': string, 'orderful-api-version': string, compositeTransactionId: string}; export type GetApiTransactionsCompositeTransactionIdMessageOptions = {baseUrl?: string | undefined, APIKEY?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get a Transaction Message * * GET /transactions/{compositeTransactionId}/message */ export const getApiTransactionsCompositeTransactionIdMessage = async (args: GetApiTransactionsCompositeTransactionIdMessageArgs, options?: GetApiTransactionsCompositeTransactionIdMessageOptions) => { const {baseUrl = "https://api.orderful.com", fetch: fetchFn = fetch, APIKEY} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['orderful-api-key'] != null) headers.set("orderful-api-key", String(args['orderful-api-key'])) if (args['orderful-api-version'] != null) headers.set("orderful-api-version", String(args['orderful-api-version'])) if (APIKEY !== undefined) headers.set("orderful-api-key", APIKEY) const url = `${baseUrl.replace(/\/+$/, '')}/transactions/${encodeURIComponent(String(args.compositeTransactionId))}/message${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 };