export type RewardCompany = {agreedTermsPrivacy?: string | undefined, agreedTermsReward?: string | undefined, agreedTermsService?: string | undefined, approvedAt?: string | undefined, approvedBy?: string | undefined, commerceRegDoc?: string | undefined, commerceRegNo?: string | undefined, companyName?: string | undefined, companyNo?: string | undefined, companyRegDoc?: string | undefined, contactEmail?: string | undefined, contactName?: string | undefined, contactPhone?: string | undefined, createdAt?: string | undefined, id?: string | undefined, rejectionReason?: string | undefined, representativeName?: string | undefined, status?: ('APPROVED' | 'PENDING' | 'REJECTED' | 'SUSPENDED') | undefined, updatedAt?: string | undefined}; export type CreateApiBapiV3RewardsCompaniesArgs = {body: RewardCompany}; export type CreateApiBapiV3RewardsCompaniesOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * 리워드 기업 등록 * * POST /bapi/v3/rewards/companies */ export const createApiBapiV3RewardsCompanies = async (args: CreateApiBapiV3RewardsCompaniesArgs, options?: CreateApiBapiV3RewardsCompaniesOptions) => { 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(/\/+$/, '')}/bapi/v3/rewards/companies${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 };