export type Channel = string; export type SellerId = string; export type OrderCancellationRequestId = string; export type OrderCancellationAccept = {channel: Channel, sellerId: SellerId, orderCancellationRequestId: OrderCancellationRequestId}; export type UpdateApiV1ChannelOrderCancellationAcceptArgs = {body: OrderCancellationAccept}; export type UpdateApiV1ChannelOrderCancellationAcceptOptions = {baseUrl?: string | undefined, SellerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Accept Cancellation Request * * PUT /v1/channel/order/cancellation-accept */ export const updateApiV1ChannelOrderCancellationAccept = async (args: UpdateApiV1ChannelOrderCancellationAcceptArgs, options?: UpdateApiV1ChannelOrderCancellationAcceptOptions) => { const {baseUrl = "https://scx-sbx.api.jtl-software.com", fetch: fetchFn = fetch, SellerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (SellerAuth !== undefined) headers.set('authorization', `Bearer ${SellerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/channel/order/cancellation-accept${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };