export type CreateApiCustomersCustomerIdSubscriptionsSubscriptionIdSendCustomerPaymentEmailArgs = {customerId: string, subscriptionId: string}; export type CreateApiCustomersCustomerIdSubscriptionsSubscriptionIdSendCustomerPaymentEmailOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Send customer email to change payment method * * POST /customers/{customerId}/subscriptions/{subscriptionId}/send-customer-payment-email */ export const createApiCustomersCustomerIdSubscriptionsSubscriptionIdSendCustomerPaymentEmail = async (args: CreateApiCustomersCustomerIdSubscriptionsSubscriptionIdSendCustomerPaymentEmailArgs, options?: CreateApiCustomersCustomerIdSubscriptionsSubscriptionIdSendCustomerPaymentEmailOptions) => { const {baseUrl = "https://api.awtomic.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/customers/${encodeURIComponent(String(args.customerId))}/subscriptions/${encodeURIComponent(String(args.subscriptionId))}/send-customer-payment-email${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };