export type CreateApiOrdersV3MarketplaceTechnicalCodeAccountIdBeezUPOrderIdHarvestArgs = {marketplaceTechnicalCode: unknown, accountId: number, beezUPOrderId: unknown}; export type CreateApiOrdersV3MarketplaceTechnicalCodeAccountIdBeezUPOrderIdHarvestOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Send harvest request for a single Order * * POST /orders/v3//{marketplaceTechnicalCode}/{accountId}/{beezUPOrderId}/harvest */ export const createApiOrdersV3MarketplaceTechnicalCodeAccountIdBeezUPOrderIdHarvest = async (args: CreateApiOrdersV3MarketplaceTechnicalCodeAccountIdBeezUPOrderIdHarvestArgs, options?: CreateApiOrdersV3MarketplaceTechnicalCodeAccountIdBeezUPOrderIdHarvestOptions) => { const {baseUrl = "https://api.beezup.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/orders/v3//${encodeURIComponent(String(args.marketplaceTechnicalCode))}/${encodeURIComponent(String(args.accountId))}/${encodeURIComponent(String(args.beezUPOrderId))}/harvest${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };