# DEPRECATED, use PUT instead - create new booking (deprecated) Endpoint: POST /bookings Version: 1.0.0 Security: M2X_auth_application ## Request fields (application/json): - `booking` (object) - `booking.agent` (object) - `booking.agent.email` (string,null) - `booking.agent.uid` (string,null) M2X user identifier - `booking.agent.phone` (string,null) - `booking.agent.name` (string,null) - `booking.agent.externalId` (string,null) - `booking.externalReference` (string) - `booking.externalNote` (string) - `booking.carrierId` (string) The M2X carrier id for this booking - `booking.canceled` (boolean) - `booking.completed` (boolean) - `booking.quantity` (number) The product quantity - `booking.noPayment` (boolean) Whether upon acceptance the carrier shall get a payment or not (e.g. freight forward) - `booking.noPrice` (boolean) Whether the booking is free of charge, no offer generated - `booking.properties` (object,null) A key value store containing bespoke properties usable for pricing and optimisation - `booking.productSpatialRequirement` (number,null) Optional override for the volume - `booking.productMassKg` (number,null) Optional total weight override for the booking - `booking.productNetWeightKg` (number,null) Optional net weight override for the booking - `booking.productTareWeightKg` (number,null) Optional tare weight override for the booking - `booking.metadata` (object,null) Opaque passenger data - `booking.fromLocation` (object) - `booking.fromLocation.addressText` (string, required) - `booking.fromLocation.latitude` (number, required) - `booking.fromLocation.longitude` (number, required) - `booking.fromLocation.locationName` (string, required) - `booking.fromLocation.locationId` (string,null) The M2X internal location id. When a location is manually created in M2X, this is a randomly generated unique identifier. If creating locations via API, the caller can set the Location ID. - `booking.fromLocation.externalId` (string,null) An optional external identifier assigned to the location. This ID can be provided when creating the location and is typically used for cross-system referencing or integration with external data sources. - `booking.fromLocation.timezone` (string) IANA (aka TZ database) timezone name Example: "Pacific/Auckland" - `booking.fromLocation.properties` (object,null) - `booking.fromDateAndTimeConstraint` (object) - `booking.fromDateAndTimeConstraint.date` (string, required) Day required (YYYY-MM-DD) - `booking.fromDateAndTimeConstraint.timeConstraint` (any) - `booking.fromTimeWindows` (array) - `booking.fromTimeWindows.start` (integer, required) Epoch timestamp (seconds since 1970), start of the window - `booking.fromTimeWindows.end` (integer, required) Epoch timestamp (seconds since 1970), end of the window - `booking.fromLocationGroup` (object) - `booking.fromLocationGroup.groupId` (string) Internal M2X Location Id - `booking.fromLocationGroup.code` (string) Rapid searchable code for front end users Example: "C123" - `booking.fromLocationGroup.externalId` (string,null) Id to map group to an external system Example: "asd-asd-asd" - `booking.fromLocationGroup.name` (string) Group name - `booking.fromContactDetails` (object) - `booking.toLocation` (object) - `booking.toDateAndTimeConstraint` (object) - `booking.toTimeWindows` (array) - `booking.toLocationGroup` (object) - `booking.toContactDetails` (object) - `requestTimestamp` (string) Request timestamp, useful to discard stale updates than were made offline and came online later - `mappingRequests` (object) - `mappingRequests.carrier` (object) - `mappingRequests.carrier.carrierExternalId` (string) External carrier id for this booking - `mappingRequests.content` (object,null) Specific information about the content of the booking - `mappingRequests.content.description` (string) Description of the payload - `mappingRequests.content.productBundle` (object) Details of the products carted - `mappingRequests.content.productBundle.payload` (array) - `mappingRequests.content.productBundle.payload.itemId` (string) - `mappingRequests.content.productBundle.payload.quantity` (number) This item quantity - `mappingRequests.content.productBundle.payload.description` (string) - `mappingRequests.content.productBundle.payload.massKg` (number) Optional override for the weight - `mappingRequests.content.productBundle.payload.spatialRequirement` (number) Optional override for the volume - `mappingRequests.content.productBundle.payload.unitOfMeasure` (string) Optional unit of measure (e.g. bags) - `mappingRequests.content.productBundle.payload.product` (object) - `mappingRequests.content.productBundle.payload.product.productCode` (string,null) M2X internal tracking id for the product code used - `mappingRequests.content.productBundle.payload.product.productCodeExternalId` (string,null) External Id for product tracking - `mappingRequests.content.productBundle.payload.product.productDescription` (string,null) Helps user creating the missing mapping upon mapping failure - `mappingRequests.corporateSubaccount` (object) - `mappingRequests.corporateSubaccount.corporateSubaccountId` (string) The M2X corporate subaccount id for this booking - `mappingRequests.corporateSubaccount.corporateSubaccountIntegrationId` (string) The M2X corporate subaccount integration id for this booking ## Response 200 fields (application/json): - `batchId` (string) Example: "XYZ123" - `id` (string) Example: "ABC123-example-1737580145879" ## Response 400 fields (application/json): - `message` (string) Example: "missing data" ## Response 202 fields