# Update/create demand by ID Endpoint: PUT /corporatePlanning/demands/{demandId} Version: 1.0.0 Security: M2X_auth_application ## Path parameters: - `demandId` (string, required) The demand Id ## Query parameters: - `sync` (boolean) Whether mapping errors should be returned synchronously - `reprocessId` (string) Used to retry a request that fail and clear the issues in the integration issues ## Request fields (application/json): - `demand` (object) - `demand.agent` (object) - `demand.agent.email` (string,null) - `demand.agent.uid` (string,null) M2X user identifier - `demand.agent.phone` (string,null) - `demand.agent.name` (string,null) - `demand.agent.externalId` (string,null) - `demand.externalReference` (string) - `demand.externalNote` (string) - `demand.quantity` (number) The product quantity - `demand.properties` (object,null) A key value store containing bespoke properties usable for pricing and optimisation - `demand.productSpatialRequirement` (number,null) Optional override for the volume - `demand.productMassKg` (number,null) Optional total weight override for the booking - `demand.metadata` (object,null) Opaque passenger data - `demand.location` (object) - `demand.location.addressText` (string, required) - `demand.location.latitude` (number, required) - `demand.location.longitude` (number, required) - `demand.location.locationName` (string, required) - `demand.location.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. - `demand.location.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. - `demand.location.timezone` (string) IANA (aka TZ database) timezone name Example: "Pacific/Auckland" - `demand.location.properties` (object,null) - `demand.locationGroup` (object) - `demand.locationGroup.groupId` (string) Internal M2X Location Id - `demand.locationGroup.code` (string) Rapid searchable code for front end users Example: "C123" - `demand.locationGroup.externalId` (string,null) Id to map group to an external system Example: "asd-asd-asd" - `demand.locationGroup.name` (string) Group name - `demand.contactDetails` (object) - `demand.orderDay` (string, required) The date from where the node will be available for dispatch, if not provided, assume today - `demand.locationDate` (string, required) The date of interaction - `demand.locationDateFlexibility` (string, required) Enum: "AFTER", "EXACT", "BEFORE" - `requestTimestamp` (string) Request timestamp, useful to discard stale updates than were made offline and came online later - `mappingRequests` (object) - `mappingRequests.product` (object) - `mappingRequests.product.productCode` (string,null) M2X internal tracking id for the product code used - `mappingRequests.product.productCodeExternalId` (string,null) External Id for product tracking - `mappingRequests.product.productDescription` (string,null) Helps user creating the missing mapping upon mapping failure - `mappingRequests.products` (array) ## Response 200 fields (application/json): - `batchId` (string) Example: "XYZ123" - `id` (string) Example: "ABC123" ## Response 400 fields (application/json): - `message` (string) Example: "missing data" ## Response 202 fields