export type GetApiV1ShopsShopIdSubscriptionsExportArgs = {body: {page?: (number | null) | undefined, perPage?: (number | null) | undefined, orderColumn?: ('id' | 'created_at' | 'current_period_end' | 'recurring_price_usd' | 'cycles_completed' | null) | undefined, orderDirection?: ('asc' | 'desc' | null) | undefined, id?: (number | null) | undefined, status?: ('pending' | 'trialing' | 'active' | 'past_due' | 'cancelled' | 'expired' | null) | undefined, statuses?: (Array<'pending' | 'trialing' | 'active' | 'past_due' | 'cancelled' | 'expired'>) | undefined, email?: (string | null) | undefined, customer_id?: (number | null) | undefined, product_id?: (number | null) | undefined, variant_id?: (number | null) | undefined, product_name?: (string | null) | undefined, variant_name?: (string | null) | undefined, gateways?: (Record | null) | undefined, payment_method_ids?: (Record | null) | undefined, intervals?: (Array<'day' | 'week' | 'month' | 'year'>) | undefined, renewal_method?: ('auto' | 'manual' | null) | undefined, cancel_at_period_end?: (boolean | null) | undefined, has_failed_payments?: (boolean | null) | undefined, suspended?: (boolean | null) | undefined, currency?: (string | null) | undefined, external_id?: (string | null) | undefined, created_at_start?: (string | null) | undefined, created_at_end?: (string | null) | undefined, current_period_end_start?: (string | null) | undefined, current_period_end_end?: (string | null) | undefined, cancelled_at_start?: (string | null) | undefined, cancelled_at_end?: (string | null) | undefined}}; export type GetApiV1ShopsShopIdSubscriptionsExportOptions = {baseUrl?: string | undefined, defaultValue?: string | undefined, fetch?: typeof fetch | undefined}; /** * Export Subscriptions * * GET /v1/shops/{shopId}/subscriptions/export */ export const getApiV1ShopsShopIdSubscriptionsExport = async (args: GetApiV1ShopsShopIdSubscriptionsExportArgs, options?: GetApiV1ShopsShopIdSubscriptionsExportOptions) => { const {baseUrl = "https://api.sellauth.com", fetch: fetchFn = fetch, defaultValue} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "text/plain") if (defaultValue !== undefined) headers.set('authorization', `Bearer ${defaultValue}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/shops/${encodeURIComponent(String(args.shopId))}/subscriptions/export${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.text() };