# Update/create carrier order by ID Endpoint: PUT /orders/{orderId} Version: 1.0.0 Security: M2X_auth_application ## Path parameters: - `orderId` (string, required) M2X order id ## Request fields (application/json): - `order` (object, required) - `order.orderId` (string, required) - `order.externalId` (string) - `order.externalNote` (string) - `order.bookingId` (string) - `order.customerBookingId` (string) - `order.largeContractId` (string) - `order.quantity` (number, required) The product quantity - `order.properties` (object,null) A key value store containing custom properties - `order.metadata` (object,null) A key value store containing metadata - `order.fromReference` (string) - `order.fromDateAndTimeConstraint` (object) - `order.fromDateAndTimeConstraint.date` (string, required) Day required (YYYY-MM-DD) - `order.fromDateAndTimeConstraint.timezone` (string, required) IANA (aka TZ database) timezone name Example: "Pacific/Auckland" - `order.fromDateAndTimeConstraint.timeConstraint` (any) - `order.toReference` (string) - `order.toDateAndTimeConstraint` (object) - `order.shortNote` (string) - `mappingRequests` (object, required) - `mappingRequests.customer` (object, required) Parameters to try to map a customer with M2X - `mappingRequests.customer.customerName` (string) Example: "Fruit World" - `mappingRequests.customer.customerId` (string) Example: "Yc7cXUulBhMM58iuOQce" - `mappingRequests.customer.integrationId` (string) Example: "C99" - `mappingRequests.content` (object,null) Specific information about the content carted - `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) Parameters to try to map a product with M2X - `mappingRequests.content.productBundle.payload.product.productCodeName` (string) - `mappingRequests.content.productBundle.payload.product.productCodeId` (string) - `mappingRequests.content.productBundle.payload.metadata` (object,null) Opaque passenger data - `mappingRequests.content.productBundle.payload.properties` (object,null) A key value store containing bespoke properties usable for pricing and optimisation - `mappingRequests.fromLocation` (object, required) Parameters to try to map a location with M2X - `mappingRequests.fromLocation.locationId` (string,null) M2X internal tracking id for the location code used Example: "C6mruxd3AVUTW14vEZ0v" - `mappingRequests.fromLocation.addressText` (string,null) Address, if present and no locationId or external Id is matching, will try to geocode Example: "123 Example Road, Auckland 1010" - `mappingRequests.fromLocation.externalId` (string,null) External Id Example: "WHC6" - `mappingRequests.fromLocation.locationName` (string,null) Helps user creating the missing mapping upon mapping failure, or used to save location if new Example: "Auckland Storage 1" - `mappingRequests.fromLocation.latitude` (number) Example: -36.983882 - `mappingRequests.fromLocation.longitude` (number) Example: 174.709879 - `mappingRequests.fromLocation.locationNameResolutionEnabled` (boolean) Try to resolve location by name, quick weak method, disabled by default - `mappingRequests.fromLocation.saveIfUnknown` (boolean) If no existing location is found, locationId provided and lat/lng provided or geocode successful, will create location - `mappingRequests.toLocation` (object, required) Parameters to try to map a location with M2X - `mappingRequests.defaultLegBranches` (array) The branches that will be applied to the legs of the order by default. When a leg is created, all of the defaultLegBranches will be applied to the branches field of the leg. Updating the defaultLegBranches will not update the branches field of existing legs. - `mappingRequests.defaultLegBranches.branchId` (string,null) - `mappingRequests.defaultLegBranches.branchName` (string,null) ## Response 200 fields (application/json): - `orderId` (string) Example: "ABC123-Ilon3tVMlqfCVLC8wZFy-1698357659017" ## Response 400 fields (application/json): - `message` (string) Example: "missing data"