export type RefundId = string; export type SellerId = string; export type RefundProcessingError = {code?: string | undefined, message: string}; export type RefundProcessingResult = {refundId: RefundId, sellerId: SellerId, isAccepted: boolean, processingErrorList?: Array | undefined}; export type CreateApiV1ChannelOrderRefundProcessingResultArgs = {body: RefundProcessingResult}; export type CreateApiV1ChannelOrderRefundProcessingResultOptions = {baseUrl?: string | undefined, ChannelAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Refund Processing Result * * POST /v1/channel/order/refund/processing-result */ export const createApiV1ChannelOrderRefundProcessingResult = async (args: CreateApiV1ChannelOrderRefundProcessingResultArgs, options?: CreateApiV1ChannelOrderRefundProcessingResultOptions) => { const {baseUrl = "https://scx-sbx.api.jtl-software.com", fetch: fetchFn = fetch, ChannelAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ChannelAuth !== undefined) headers.set('authorization', `Bearer ${ChannelAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/channel/order/refund/processing-result${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 };