export type Message = {diagnostic?: string | undefined, message?: string | undefined, severity?: ('ERROR' | 'WARNING' | 'INFO') | undefined, source?: ('SYSTEM' | 'CAPACITY_PROVIDER') | undefined}; export type CountryCode = 'US' | 'CA' | 'MX' | 'AG' | 'BB' | 'BS' | 'BZ' | 'CR' | 'CU' | 'DM' | 'DO' | 'GD' | 'GT' | 'HN' | 'HT' | 'JM' | 'KN' | 'LC' | 'NI' | 'PA' | 'SV' | 'TT' | 'VC' | 'AI' | 'AW' | 'BL' | 'BM' | 'BQ' | 'CW' | 'GL' | 'GP' | 'KY' | 'MF' | 'MQ' | 'MS' | 'PM' | 'PR' | 'SX' | 'TC' | 'UM' | 'VG' | 'VI' | 'AT' | 'BE' | 'BG' | 'CY' | 'CZ' | 'DK' | 'DE' | 'EE' | 'ES' | 'FI' | 'FR' | 'GB' | 'GR' | 'HR' | 'HU' | 'IE' | 'IT' | 'LT' | 'LU' | 'LV' | 'MT' | 'NL' | 'PL' | 'PT' | 'RO' | 'SE' | 'SK' | 'SI' | 'CH' | 'IS' | 'LI' | 'NO' | 'AL' | 'ME' | 'MK' | 'RS' | 'TR' | 'AD' | 'AX' | 'BA' | 'BV' | 'BY' | 'FO' | 'GG' | 'GI' | 'IM' | 'IO' | 'JE' | 'MC' | 'MD' | 'SJ' | 'SM' | 'TF' | 'UA' | 'VA' | 'AE' | 'AF' | 'AM' | 'AZ' | 'BD' | 'BH' | 'BN' | 'BT' | 'CN' | 'GE' | 'HK' | 'ID' | 'IL' | 'IN' | 'IQ' | 'IR' | 'JO' | 'JP' | 'KG' | 'KH' | 'KP' | 'KR' | 'KW' | 'KZ' | 'LA' | 'LB' | 'LK' | 'MM' | 'MN' | 'MO' | 'MV' | 'MY' | 'NP' | 'OM' | 'PH' | 'PK' | 'PS' | 'QA' | 'RU' | 'SA' | 'SG' | 'SY' | 'TH' | 'TJ' | 'TL' | 'TM' | 'TW' | 'UZ' | 'VN' | 'YE' | 'AO' | 'BF' | 'BI' | 'BJ' | 'BW' | 'CD' | 'CF' | 'CG' | 'CI' | 'CM' | 'CV' | 'DJ' | 'DZ' | 'EG' | 'EH' | 'ER' | 'ET' | 'GA' | 'GH' | 'GM' | 'GN' | 'GQ' | 'GW' | 'HM' | 'KE' | 'KM' | 'LR' | 'LS' | 'LY' | 'MA' | 'MG' | 'ML' | 'MR' | 'MU' | 'MW' | 'MZ' | 'NA' | 'NE' | 'NG' | 'RE' | 'RW' | 'SC' | 'SD' | 'SH' | 'SL' | 'SN' | 'SO' | 'SS' | 'ST' | 'SZ' | 'TD' | 'TG' | 'TN' | 'TZ' | 'UG' | 'YT' | 'ZA' | 'ZM' | 'ZW' | 'AR' | 'BO' | 'BR' | 'CL' | 'CO' | 'EC' | 'FK' | 'GF' | 'GS' | 'GY' | 'PE' | 'PY' | 'SR' | 'UY' | 'VE' | 'AS' | 'AU' | 'CC' | 'CK' | 'CX' | 'FJ' | 'FM' | 'GU' | 'KI' | 'MH' | 'MP' | 'NC' | 'NF' | 'NR' | 'NU' | 'NZ' | 'PF' | 'PG' | 'PN' | 'PW' | 'SB' | 'TK' | 'TO' | 'TV' | 'VU' | 'WF' | 'WS' | 'AQ' | 'EL' | 'UK' | 'XK' | 'XS' | 'XI'; export type Address = {addressLines?: Array | undefined, city?: string | undefined, country?: CountryCode | undefined, postalCode?: string | undefined, state?: string | undefined}; export type GeoCoordinates = {latitude?: number | undefined, longitude?: number | undefined}; export type TruckloadShipmentStatusReason = {code?: ('PENDING_TRACKING_METHOD' | 'SCHEDULED' | 'PENDING_APPROVAL' | 'ACQUIRING_LOCATION' | 'PENDING_CARRIER' | 'IN_MOTION' | 'IDLE' | 'APPROVAL_DENIED' | 'TIMED_OUT' | 'CANCELED' | 'DEPARTED_FINAL_STOP' | 'ARRIVED_FINAL_STOP' | 'FAILED_TO_ACQUIRE_LOCATION' | 'INFO') | undefined, description?: string | undefined}; export type TruckloadShipmentStatusUpdate = {address?: Address | undefined, geoCoordinates?: GeoCoordinates | undefined, statusCode?: ('DISPATCHED' | 'IN_TRANSIT' | 'AT_STOP' | 'COMPLETED' | 'TRACKING_FAILED' | 'INFO' | 'DELETED') | undefined, statusReason?: TruckloadShipmentStatusReason | undefined, stopNumber?: number | undefined, timestamp?: string | undefined}; export type TruckloadAdditionalAppointmentWindowStatus = {scanDateTime?: string | undefined, statusCode?: ('EARLY' | 'ON_TIME' | 'LATE') | undefined, windowType?: ('STRATEGIC' | 'SLOT_BOOKING_PICKUP' | 'SLOT_BOOKING_DELIVERY' | 'SLOT_BOOKING_PICKUP_DELIVERY') | undefined}; export type OffsetDateTimeWindow = {endDateTime?: string | undefined, startDateTime?: string | undefined}; export type TruckloadArrivalEstimate = {estimatedArrivalWindow?: OffsetDateTimeWindow | undefined, lastCalculatedDateTime?: string | undefined}; export type TruckloadShipmentStopStatus = {additionalAppointmentWindowStatuses?: Array | undefined, arrivalCode?: ('UNKNOWN' | 'EARLY' | 'ON_TIME' | 'LATE') | undefined, arrivalDateTime?: string | undefined, arrivalEstimate?: TruckloadArrivalEstimate | undefined, departureDateTime?: string | undefined, statusCode?: ('UNKNOWN' | 'EN_ROUTE' | 'ARRIVED' | 'DEPARTED') | undefined, stopNumber?: number | undefined}; export type TruckloadShipmentNotificationRule = {ruleInfo?: Record | undefined, ruleType?: ('DEPRECATED_SHIPMENT_LATE' | 'DEPRECATED_SHIPMENT_NEAR_ARRIVAL' | 'DEPRECATED_SHIPMENT_DEPARTED' | 'ALL_UPDATES' | 'SHIPMENT_LATE' | 'SHIPMENT_NEAR_ARRIVAL' | 'SHIPMENT_DEPARTED' | 'SHIPMENT_TRACKING_APPROVAL_DENIED' | 'SHIPMENT_DWELLING' | 'SHIPMENT_IDLE_IN_TRANSIT' | 'TEMPERATURE_OUT_OF_RANGE' | 'TRACKING_APPROVAL_PENDING') | undefined}; export type TruckloadShipmentPointOfInterestRecordedEntry = {entryDateTime?: string | undefined, exitDateTime?: string | undefined}; export type TruckloadShipmentPointOfInterestStatus = {pointOfInterestId?: string | undefined, recordedEntries?: Array | undefined, totalDwellTime?: number | undefined}; export type TruckloadShipmentSensorReading = {utcTimestamp?: string | undefined, value?: number | undefined}; export type TruckloadShipmentSensorIdentifier = {type?: 'TEMPERATURE' | undefined, value?: string | undefined}; export type TruckloadShipmentSensor = {identifier?: TruckloadShipmentSensorIdentifier | undefined, max?: number | undefined, min?: number | undefined, target?: number | undefined}; export type TruckloadShipmentSensorHistory = {readings?: Array | undefined, sensor?: TruckloadShipmentSensor | undefined}; export type TruckloadShipmentApiConfiguration = {enableIntelligentMatching?: boolean | undefined, fallBackToDefaultAccountGroup?: boolean | undefined, webhookEndpointConfigName?: string | undefined}; export type ShipmentAttribute = {name?: string | undefined, predefined?: boolean | undefined, value?: string | undefined, values?: Array | undefined}; export type CapacityProviderAccount = {code?: string | undefined}; export type CapacityProviderAccountGroup = {accounts?: Array | undefined, code?: string | undefined}; export type CapacityProviderIdentifier = {type?: ('SCAC' | 'DOT_NUMBER' | 'MC_NUMBER' | 'P44_EU' | 'SYSTEM' | 'P44_GLOBAL' | 'VAT') | undefined, value?: string | undefined}; export type TruckloadShipmentContent = {maxTemperatureThreshold?: number | undefined, minTemperatureThreshold?: number | undefined, temperatureSetPoint?: number | undefined}; export type TruckloadEquipmentIdentifierChange = {timestamp?: string | undefined, type?: ('MOBILE_PHONE_NUMBER' | 'VEHICLE_ID' | 'LICENSE_PLATE' | 'SENSITECH_DEVICE_ID' | 'EMERSON_DEVICE_ID' | 'TIVE_DEVICE_ID' | 'CONTAINER_ID') | undefined, value?: string | undefined}; export type TruckloadEquipmentIdentifier = {shouldDelete?: boolean | undefined, type?: ('MOBILE_PHONE_NUMBER' | 'VEHICLE_ID' | 'LICENSE_PLATE' | 'SENSITECH_DEVICE_ID' | 'TIVE_DEVICE_ID') | undefined, value?: string | undefined}; export type Contact = {companyName?: string | undefined, contactName?: string | undefined, email?: string | undefined, faxNumber?: string | undefined, faxNumberCountryCode?: string | undefined, phoneNumber?: string | undefined, phoneNumber2?: string | undefined, phoneNumber2CountryCode?: string | undefined, phoneNumberCountryCode?: string | undefined}; export type Location = {address?: Address | undefined, contact?: Contact | undefined}; export type LocationIdentifier = {type?: ('EXTERNAL' | 'SYSTEM') | undefined, value?: string | undefined}; export type TruckloadShipmentPointOfInterest = {geoCoordinates?: GeoCoordinates | undefined, location?: Location | undefined, locationIdentifiers?: Array | undefined, pointOfInterestDescription?: string | undefined, pointOfInterestId?: string | undefined, pointOfInterestName?: string | undefined, pointOfInterestType?: ('GENERAL' | 'TRUCK_CHANGE') | undefined, shouldDelete?: boolean | undefined}; export type PartyAddress = {addressLines?: Array | undefined, addressLabel?: string | undefined, city?: string | undefined, country?: CountryCode | undefined, id?: string | undefined, postalCode?: string | undefined, state?: string | undefined}; export type BookingContact = {companyName?: string | undefined, email?: string | undefined, familyName?: string | undefined, givenName?: string | undefined, mobilePhoneNumber?: string | undefined, phoneNumber?: string | undefined}; export type CodeListProvider = 'WAVE' | 'CARX' | 'ESSD' | 'IDT' | 'BOLE' | 'EDOX' | 'IQAX' | 'SECR' | 'TRGO' | 'ETEU' | 'TRAC' | 'BRIT' | 'GSBN' | 'WISE' | 'GLEIF' | 'W3C' | 'DNB' | 'FMC' | 'DCSA' | 'ZZZ'; export type CodeListName = 'DID' | 'LEI' | 'DUNS'; export type IdentifyingCodes = {codeListProvider?: CodeListProvider | undefined, codeListName?: CodeListName | undefined, partyCode?: string | undefined}; export type LocationIdentifierType = 'UNKNOWN' | 'AIRPORT_IATA' | 'AIRPORT_ICAO' | 'PORT_UN_LOCODE' | 'RAIL_SPLC' | 'DATA_PROVIDER_LOCATION_CODE' | 'LOCODE'; export type RatingLocationIdentifier = {type?: LocationIdentifierType | undefined, value?: string | undefined}; export type PartyType = 'SHIPPER' | 'CONSIGNEE' | 'BILL_TO' | 'NOTIFY_PARTY' | 'BOOKING_AGENT' | 'CARRIER_BOOKING_OFFICE'; export type Party = {addressInfo?: PartyAddress | undefined, contactInfo?: BookingContact | undefined, identifyingCodes?: IdentifyingCodes | undefined, locationIdentifiers?: Array | undefined, partyType?: PartyType | undefined, vatNumber?: string | undefined}; export type LineItemIdentifier = {type?: ('PURCHASE_ORDER' | 'SKU' | 'CONTAINER_NUMBER' | 'PALLET_NUMBER' | 'DELIVERY_NUMBER' | 'PICKUP_NUMBER' | 'VIN') | undefined, value?: string | undefined}; export type Currency = 'USD' | 'CAD' | 'MXN' | 'EUR'; export type MonetaryValue = {amount?: number | undefined, currency?: Currency | undefined}; export type Weight = {weight?: number | undefined, weightUnit?: ('LB' | 'KG') | undefined}; export type TruckloadShipmentSubLineItem = {commodityCode?: string | undefined, contact?: Contact | undefined, description?: string | undefined, freightClass?: ('50' | '55' | '60' | '65' | '70' | '77.5' | '85' | '92.5' | '100' | '110' | '125' | '150' | '175' | '200' | '250' | '300' | '400' | '500') | undefined, involvedParties?: Array | undefined, itemIdentifiers?: Array | undefined, itemPackageType?: ('BAG' | 'BALE' | 'BOX' | 'BUCKET' | 'BUNDLE' | 'CAN' | 'CARTON' | 'CASE' | 'COIL' | 'CRATE' | 'CYLINDER' | 'DRUM' | 'PAIL' | 'PLT' | 'PIECES' | 'REEL' | 'ROLL' | 'SKID' | 'TOTE' | 'TUBE' | 'EACH' | 'FLAT' | 'LOOSE') | undefined, itemQuantity?: number | undefined, monetaryValue?: MonetaryValue | undefined, totalWeight?: Weight | undefined}; export type TruckloadShipmentLineItem = {commodityCode?: string | undefined, contact?: Contact | undefined, deliveryStopNumber?: number | undefined, description?: string | undefined, freightClass?: ('50' | '55' | '60' | '65' | '70' | '77.5' | '85' | '92.5' | '100' | '110' | '125' | '150' | '175' | '200' | '250' | '300' | '400' | '500') | undefined, handlingUnitPackageType?: ('PLT' | 'BALE' | 'BOX' | 'BUNDLE' | 'CASE' | 'CRATE' | 'DRUM' | 'REEL' | 'ROLL' | 'SKID' | 'CONTAINER') | undefined, handlingUnitQuantity?: number | undefined, involvedParties?: Array | undefined, itemIdentifiers?: Array | undefined, itemPackageType?: ('BAG' | 'BALE' | 'BOX' | 'BUCKET' | 'BUNDLE' | 'CAN' | 'CARTON' | 'CASE' | 'COIL' | 'CRATE' | 'CYLINDER' | 'DRUM' | 'PAIL' | 'PLT' | 'PIECES' | 'REEL' | 'ROLL' | 'SKID' | 'TOTE' | 'TUBE' | 'EACH' | 'FLAT' | 'LOOSE') | undefined, itemQuantity?: number | undefined, monetaryValue?: MonetaryValue | undefined, pickupStopNumber?: number | undefined, subLineItems?: Array | undefined, totalWeight?: Weight | undefined}; export type TruckloadTrackingShipmentDetails = {lineItems?: Array | undefined}; export type TruckloadShipmentIdentifier = {type?: ('BILL_OF_LADING' | 'ORDER') | undefined, value?: string | undefined}; export type ZonedDateTimeWindow = {endDateTime?: string | undefined, localTimeZoneIdentifier?: string | undefined, startDateTime?: string | undefined}; export type AdditionalAppointmentWindowIdentifier = {type?: ('DOCK' | 'BOOKING_ID') | undefined, value?: string | undefined}; export type TruckloadAdditionalAppointmentWindow = {appointmentStatus?: ('PENDING' | 'REJECTED' | 'BOOKED' | 'CANCELLED' | 'COMPLETED' | 'PENDING_CARRIER' | 'PENDING_INTERNAL' | 'NONE_AVAILABLE') | undefined, appointmentWindow?: ZonedDateTimeWindow | undefined, identifiers?: Array | undefined, type?: ('STRATEGIC' | 'SLOT_BOOKING_PICKUP' | 'SLOT_BOOKING_DELIVERY' | 'SLOT_BOOKING_PICKUP_DELIVERY') | undefined}; export type TruckloadExternalArrivalEstimate = {dateTime?: string | undefined, source?: ('SHIPPER' | 'CARRIER' | 'UNKNOWN') | undefined}; export type TruckloadShipmentStop = {additionalAppointmentWindows?: Array | undefined, appointmentWindow?: ZonedDateTimeWindow | undefined, externalArrivalEstimate?: TruckloadExternalArrivalEstimate | undefined, geoCoordinates?: GeoCoordinates | undefined, involvedParties?: Array | undefined, location?: Location | undefined, locationIdentifiers?: Array | undefined, stopDescription?: string | undefined, stopName?: string | undefined, stopNumber?: number | undefined, stopType?: ('PICKUP' | 'DELIVERY' | 'DELIVERY_PICKUP') | undefined, uuid?: string | undefined}; export type TruckloadShipmentHazmatDetails = {hazardClasses?: Array | undefined}; export type TruckloadShipmentTruckDimensions = {height?: number | undefined, length?: number | undefined, unitOfMeasure?: ('IN' | 'CM' | 'FT' | 'M') | undefined, width?: number | undefined}; export type TruckloadShipmentTruckDetails = {truckDimensions?: TruckloadShipmentTruckDimensions | undefined, truckType?: ('AUTO_CARRIER' | 'B_TRAIN' | 'CONESTOGA' | 'CONTAINER' | 'CONTAINER_INSULATED' | 'CONTAINER_REFRIGERATED' | 'CONVEYOR' | 'DOUBLE_DROP' | 'DROP_DECK_LANDOLL' | 'DUMP_TRAILER' | 'FLAT_BED' | 'FLATBED_AIR_RIDE' | 'FLATBED_CONESTOGA' | 'FLATBED_DOUBLE' | 'FLATBED_HAZMAT' | 'FLATBED_HOTSHOT' | 'FLATBED_MAXI' | 'FLATBED_STEP_DECK' | 'FLATBED_OVERDOMENSION' | 'FLATBED_OVERDIMENSION' | 'FLATBED_CHAINS' | 'FLATBED_SIDES' | 'FLATBED_TARPS' | 'FLATBED_TEAM' | 'FLATBED_VAN_REEFER' | 'HOPPER_BOTTOM' | 'INSULATED_VAN_REEFER' | 'LOWBOY' | 'LOWBOY_REM_GOOSENECK' | 'LOWBOY_OVERDIMENSION' | 'MOVING_VAN' | 'PNEUMATIC' | 'POWER_ONLY' | 'REEFER' | 'REEFER_AIR_RIDE' | 'REEFER_DOUBLE' | 'REEFER_HAZMAT' | 'REEFER_INTERMODAL' | 'REEFER_LOGISTICS' | 'REEFER_VENTED_VAN' | 'REEFER_PALLET_EXCHANGE' | 'REEFER_TEAM' | 'REMOVABLE_GOOSENECK' | 'STEP_DECK' | 'STEP_DECK_REM_GOOSENECK' | 'STEP_DECK_CONESTOGA' | 'STRAIGHT_BOX_TRUCK' | 'STRETCH_TRAILER' | 'TANKER_ALUMINUM' | 'TANKER_INTERMODAL' | 'TANKER_STEEL' | 'TRUCK_AND_TRAILER' | 'DRY_VAN' | 'VAN' | 'VAN_AIR_RIDE' | 'VAN_BLANKET_WRAP' | 'VAN_CONESTOGA' | 'VAN_DOUBLE' | 'VAN_HAZMAT' | 'VAN_HOTSHOT' | 'VAN_INSULATED' | 'VAN_INTERMODAL' | 'VAN_LIFT_GATE' | 'VAN_LOGISTICS' | 'VAN_OPEN_TOP' | 'VAN_FLATBED' | 'VAN_FLATBED_TARPS' | 'VAN_FLATBET' | 'VAN_FLATBET_TARPS' | 'VAN_REEFER' | 'VAN_PALLET_EXCHANGE' | 'VAN_ROLLER_BED' | 'VAN_TRIPLE' | 'VAN_VENTED' | 'VAN_CURTAINS' | 'VAN_TEAM') | undefined, weight?: number | undefined, weightUnitOfMeasure?: ('LB' | 'KG') | undefined}; export type TruckloadShippingDetails = {hazmatDetails?: TruckloadShipmentHazmatDetails | undefined, multipleDrivers?: boolean | undefined, truckDetails?: TruckloadShipmentTruckDetails | undefined}; export type TruckloadTrackingMethodDetails = {equipmentIdentifier?: TruckloadEquipmentIdentifier | undefined, equipmentIdentifierSource?: ('CUSTOMER' | 'CARRIER' | 'AUTOMATIC') | undefined, trackingType?: ('MOBILE_PHONE' | 'TELEMATICS' | 'API') | undefined}; export type TruckloadShipment = {apiConfiguration?: TruckloadShipmentApiConfiguration | undefined, attributes?: Array | undefined, capacityProviderAccountGroup?: CapacityProviderAccountGroup | undefined, carrierIdentifier?: CapacityProviderIdentifier | undefined, contents?: Array | undefined, equipmentIdentifierChanges?: Array | undefined, equipmentIdentifiers?: Array | undefined, id?: number | undefined, idleDuration?: number | undefined, masterShipmentId?: string | undefined, pointsOfInterest?: Array | undefined, sensors?: Array | undefined, scope?: (Array<'RISK_MANAGEMENT' | 'ROUTE_DEVIATION' | 'IDLING'>) | undefined, shipmentDetails?: TruckloadTrackingShipmentDetails | undefined, shipmentIdentifiers?: Array | undefined, shipmentLegId?: string | undefined, shipmentStops?: Array | undefined, shippingDetails?: TruckloadShippingDetails | undefined, trackingDetails?: Array | undefined}; export type TruckloadShipmentStatus = {infoMessages?: Array | undefined, latestStatusUpdate?: TruckloadShipmentStatusUpdate | undefined, latestStopStatuses?: Array | undefined, mapUrl?: string | undefined, notificationRule?: TruckloadShipmentNotificationRule | undefined, pointOfInterestStatus?: Array | undefined, sensorHistories?: Array | undefined, shipment?: TruckloadShipment | undefined, statusUpdates?: Array | undefined}; export type CreateApiWebhookEndpointPathLegacyFTLArgs = {webhook_endpoint_path_legacy_FTL: string, body: TruckloadShipmentStatus}; export type CreateApiWebhookEndpointPathLegacyFTLOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Example of webhook payload for legacy Full Truckload. * * POST /{webhook_endpoint_path_legacy_FTL} */ export const createApiWebhookEndpointPathLegacyFTL = async (args: CreateApiWebhookEndpointPathLegacyFTLArgs, options?: CreateApiWebhookEndpointPathLegacyFTLOptions) => { const {baseUrl = "https://webhook.example.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.webhook_endpoint_path_legacy_FTL))}${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 };