export type GetApiOrdersOrderUuidBankTransferQrBillArgs = {order_uuid: string}; export type GetApiOrdersOrderUuidBankTransferQrBillOptions = {baseUrl?: string | undefined, bityAccountOauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get the QR-bill of an order where the input is bank_transfer. * * GET /orders/{order_uuid}/bank_transfer_qr_bill * * Also accepts auth: bity_account_client_oauth, client_oauth */ export const getApiOrdersOrderUuidBankTransferQrBill = async (args: GetApiOrdersOrderUuidBankTransferQrBillArgs, options?: GetApiOrdersOrderUuidBankTransferQrBillOptions) => { const {baseUrl = "https://exchange.api.bity.com/v2", fetch: fetchFn = fetch, bityAccountOauth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/pdf") if (bityAccountOauth !== undefined) headers.set('authorization', `Bearer ${bityAccountOauth}`) const url = `${baseUrl.replace(/\/+$/, '')}/orders/${encodeURIComponent(String(args.order_uuid))}/bank_transfer_qr_bill${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 res.blob() };