export type CapacityProviderIdentifier = {type?: ('SCAC' | 'DOT_NUMBER' | 'MC_NUMBER' | 'P44_EU' | 'SYSTEM' | 'P44_GLOBAL' | 'VAT') | undefined, value?: string | undefined}; export type CustomerAccount = {accountIdentifier?: string | undefined}; export type ShipmentImagePage = {imageData?: string | undefined, imageUrl?: string | undefined, pageNumber?: number | undefined}; export type ShipmentImage = {carrierIdentifier?: CapacityProviderIdentifier | undefined, customerAccount?: CustomerAccount | undefined, documentType?: ('BILL_OF_LADING' | 'DELIVERY_RECEIPT' | 'WEIGHT_CERTIFICATE' | 'INVOICE' | 'INSPECTION_CERTIFICATE' | 'LETTER_OF_AUTHORIZATION' | 'LUMPER_CERTIFICATE' | 'PACKING_SLIP') | undefined, imageFormat?: ('PDF' | 'TIF' | 'PNG' | 'GIF' | 'JPG') | undefined, imagePages?: Array | undefined}; export type CreateApiApiV4CapacityprovidersLtlShipmentsImagesArgs = {body: ShipmentImage}; export type CreateApiApiV4CapacityprovidersLtlShipmentsImagesOptions = {baseUrl?: string | undefined, oAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create image of shipment document. * * POST /api/v4/capacityproviders/ltl/shipments/images */ export const createApiApiV4CapacityprovidersLtlShipmentsImages = async (args: CreateApiApiV4CapacityprovidersLtlShipmentsImagesArgs, options?: CreateApiApiV4CapacityprovidersLtlShipmentsImagesOptions) => { const {baseUrl = "https://na12.api.project44.com", fetch: fetchFn = fetch, oAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oAuth2 !== undefined) headers.set('authorization', `Bearer ${oAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v4/capacityproviders/ltl/shipments/images${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 };