# Update/create supply by ID Endpoint: PUT /corporatePlanning/supplies/{supplyId} Version: 1.0.0 Security: M2X_auth_application ## Path parameters: - `supplyId` (string, required) The supply 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): - `supply` (object) - `supply.agent` (object) - `supply.agent.email` (string,null) - `supply.agent.uid` (string,null) M2X user identifier - `supply.agent.phone` (string,null) - `supply.agent.name` (string,null) - `supply.agent.externalId` (string,null) - `supply.externalReference` (string) - `supply.externalNote` (string) - `supply.quantity` (number) The product quantity - `supply.properties` (object,null) A key value store containing bespoke properties usable for pricing and optimisation - `supply.productSpatialRequirement` (number,null) Optional override for the volume - `supply.productMassKg` (number,null) Optional total weight override for the booking - `supply.metadata` (object,null) Opaque passenger data - `supply.location` (object) - `supply.location.addressText` (string, required) - `supply.location.latitude` (number, required) - `supply.location.longitude` (number, required) - `supply.location.locationName` (string, required) - `supply.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. - `supply.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. - `supply.location.timezone` (string) IANA (aka TZ database) timezone name Example: "Pacific/Auckland" - `supply.location.properties` (object,null) - `supply.locationGroup` (object) - `supply.locationGroup.groupId` (string) Internal M2X Location Id - `supply.locationGroup.code` (string) Rapid searchable code for front end users Example: "C123" - `supply.locationGroup.externalId` (string,null) Id to map group to an external system Example: "asd-asd-asd" - `supply.locationGroup.name` (string) Group name - `supply.contactDetails` (object) - `supply.orderDay` (string, required) The date from where the node will be available for dispatch, if not provided, assume today - `supply.locationDate` (string, required) The date of interaction - `supply.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" - `reprocessId` (string) Example: "reprocess123" ## Response 400 fields (application/json): - `message` (string) Example: "missing data" ## Response 202 fields