export type DeleteApiApiV4TlShipmentsArgs = {'carrierIdentifier.type'?: ('SCAC' | 'DOT_NUMBER' | 'MC_NUMBER' | 'P44_EU' | 'SYSTEM' | 'P44_GLOBAL' | 'VAT') | undefined, 'carrierIdentifier.value'?: string | undefined, 'shipmentIdentifier.type'?: ('BILL_OF_LADING' | 'ORDER') | undefined, 'shipmentIdentifier.value'?: string | undefined}; export type DeleteApiApiV4TlShipmentsOptions = {baseUrl?: string | undefined, oAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete truckload shipment by shipment identifier * * DELETE /api/v4/tl/shipments */ export const deleteApiApiV4TlShipments = async (args: DeleteApiApiV4TlShipmentsArgs, options?: DeleteApiApiV4TlShipmentsOptions) => { const {baseUrl = "https://na12.api.project44.com", fetch: fetchFn = fetch, oAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['carrierIdentifier.type'] != null) query.append("carrierIdentifier.type", String(args['carrierIdentifier.type'])) if (args['carrierIdentifier.value'] != null) query.append("carrierIdentifier.value", String(args['carrierIdentifier.value'])) if (args['shipmentIdentifier.type'] != null) query.append("shipmentIdentifier.type", String(args['shipmentIdentifier.type'])) if (args['shipmentIdentifier.value'] != null) query.append("shipmentIdentifier.value", String(args['shipmentIdentifier.value'])) if (oAuth2 !== undefined) headers.set('authorization', `Bearer ${oAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v4/tl/shipments${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };