# Upsert a delivery request that references tanks at the delivery location Endpoint: PUT /fuel/bulkTankDeliveryRequests/{deliveryRequestId} Version: 1.0.0 Security: M2X_auth_application ## Path parameters: - `deliveryRequestId` (string, required) The unique delivery requests Id ## Request fields (application/json): - `customer` (object, required) Parameters to try to map a customer with M2X - `customer.customerName` (string) Example: "Fruit World" - `customer.customerId` (string) Example: "Yc7cXUulBhMM58iuOQce" - `customer.externalId` (string) Example: "FTW" - `customer.integrationId` (string) Example: "C99" - `location` (object, required) Parameters to try to map a location with M2X - `location.locationId` (string,null) M2X internal tracking id for the location code used Example: "C6mruxd3AVUTW14vEZ0v" - `location.addressText` (string,null) Address, if present and no locationId or external Id is matching, will try to geocode Example: "123 Example Road, Auckland 1010" - `location.externalId` (string,null) External Id Example: "WHC6" - `location.locationName` (string,null) Helps user creating the missing mapping upon mapping failure, or used to save location if new Example: "Auckland Storage 1" - `location.latitude` (number) Example: -36.983882 - `location.longitude` (number) Example: 174.709879 - `location.locationNameResolutionEnabled` (boolean) Try to resolve location by name, quick weak method, disabled by default - `location.saveIfUnknown` (boolean) If no existing location is found, locationId provided and lat/lng provided or geocode successful, will create location - `tanks` (array, required) - `tanks.tankName` (string) - `tanks.tankId` (string) M2X internal tank id - `tanks.product` (object) Parameters to try to map a product with M2X - `tanks.product.productCodeName` (string) - `tanks.product.productCodeId` (string) - `tanks.quantity` (number) The product quantity - `priority` (string) Enum: "LOW", "MEDIUM", "HIGH" - `orderDay` (string) The date from where the deliver will be available for dispatch, if not provided, assume today - `targetDate` (string) The target date for the delivery - `shortNote` (string) a short note for the delivery, going to the driver - `officeNotes` (string) an office note for the delivery, not going to the driver - `properties` (object,null) A key value store containing bespoke properties usable for pricing and optimisation - `metadata` (object,null) Opaque passenger data - `readonlyFields` (object,null) Specifies which field should not be touched by the user - `readonlyFields.deleted` (boolean) - `readonlyFields.customer` (boolean) - `readonlyFields.location` (boolean) - `readonlyFields.properties` (boolean) - `associationConstraints` (array) - `associationConstraints.operation` (string, required) The type of operation to be constrained Enum: "LOADING", "UNLOADING", "ACCESS", "CARGO_MOVEMENT" - `associationConstraints.entities` (array, required) List of entity types to be considered when evaluating the constraint Enum: "VEHICLE", "DRIVER", "TRAILER", "TRACTOR_UNIT", "LOCATION", "COMPARTMENT" - `associationConstraints.conditionType` (string, required) Whether this constraint requires or forbids entities that possess the constraint label Enum: "REQUIRE", "FORBID" - `associationConstraints.constraintLabelId` (string, required) Identifier for the constraint label ## Response 200 fields (application/json): - `success` (boolean) Example: true ## Response 400 fields (application/json): - `error` (string) The issue description - `code` (string) The code for the issue Enum: "CUSTOMER_NOT_FOUND", "INVALID_SCHEMA", "PRODUCT_NOT_FOUND", "TANK_NOT_FOUND", "INSUFFICIENT_TANK_CAPACITY", "LOCATION_NOT_FOUND", "INTERNAL_ERROR"