export type RewardIssued = {createdAt?: string | undefined, deliveredAt?: string | undefined, deliveryType?: ('OFFLINE' | 'ONLINE') | undefined, id?: string | undefined, orderId?: string | undefined, sentAt?: string | undefined, sentTo?: string | undefined, status?: ('CANCELLED' | 'DELIVERED' | 'ISSUED' | 'SENT') | undefined}; export type CreateApiApiV3RewardsInternalIssuancesArgs = {body: RewardIssued}; export type CreateApiApiV3RewardsInternalIssuancesOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * 나(기업)의 리워드 상품 발급 기록 등록 * * POST /api/v3/rewards/internal/issuances */ export const createApiApiV3RewardsInternalIssuances = async (args: CreateApiApiV3RewardsInternalIssuancesArgs, options?: CreateApiApiV3RewardsInternalIssuancesOptions) => { const {baseUrl = "https://api.wincl.io:443", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3/rewards/internal/issuances${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 };