export type OrderDeliveryInformationBase = {ExternalReferenceId?: string | undefined, TrackUrl?: string | undefined, Status?: ('None' | 'Unassigned' | 'Unaccepted' | 'Accepted' | 'Carrying' | 'OnTheWay' | 'ArrivedAtLocation' | 'Delivered' | 'CannotDeliver' | null) | undefined, DeliveryStatusNotes?: string | undefined, ErrorMessage?: string | undefined, IntegrationCode?: string | undefined, IntegrationName?: string | undefined}; export type CreateApiApiV10OrdersOrderIdDeliveryinfoArgs = {orderId: number, body: OrderDeliveryInformationBase}; export type CreateApiApiV10OrdersOrderIdDeliveryinfoOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /api/v1.0/orders/{orderId}/deliveryinfo */ export const createApiApiV10OrdersOrderIdDeliveryinfo = async (args: CreateApiApiV10OrdersOrderIdDeliveryinfoArgs, options?: CreateApiApiV10OrdersOrderIdDeliveryinfoOptions) => { const {baseUrl = "https://api.flipdish.co", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1.0/orders/${encodeURIComponent(String(args.orderId))}/deliveryinfo${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 undefined };