export type GetApiAdminCheckoutsCheckoutIdDJsonArgs = {checkout_id: number}; export type GetApiAdminCheckoutsCheckoutIdDJsonOptions = {baseUrl?: string | undefined, APPACCESSTOKEN?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve a single abandoned checkout * * GET /admin/checkouts/{checkout_id:\\d+}.json */ export const getApiAdminCheckoutsCheckoutIdDJson = async (args: GetApiAdminCheckoutsCheckoutIdDJsonArgs, options?: GetApiAdminCheckoutsCheckoutIdDJsonOptions) => { const {baseUrl = "https://shop-name.onshopbase.com", fetch: fetchFn = fetch, APPACCESSTOKEN} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APPACCESSTOKEN !== undefined) headers.set("APP_ACCESS_TOKEN", APPACCESSTOKEN) const url = `${baseUrl.replace(/\/+$/, '')}/admin/checkouts/${encodeURIComponent(String(args['checkout_id:\\\\d+']))}.json${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 };