Order Update Ep
POST/v1/order/update
Update an Order
Updates an existing order or order request with new parameters such as delivery windows, destinations, products, notes, and sourcing strategies. The system validates business rules, enforces order lifecycle constraints, and handles supply option re-sourcing when necessary.
order: OrderKey
Identifies the order to update using one of three methods.
Show Child Attributes
At least one of the three identifying keys is required. The order will be matched in the following hierarchy: order_id, order_number, order_reference_number.
order_number: int | None = None
The order number to update.
order_id: str | None = None
The unique ObjectId of the order to update.
order_reference_number: str | None = None
External reference number used to identify the order.
sourcing_strategy: UpdateSourcingStrategy = USE_BEST
Defines the strategy for how the order is re-sourced when changes require new supply options.
Update Sourcing Strategy
Use Best
Will resolve supply options using the updated parameters and choose the best supply option from available choices.
This strategy optimizes for cost and availability when specific supply is not required.
Specific Supply
Will only update the order if the requested changes resolve to a single supply option.
This is ideal for updates requiring a specific type of supply without alternatives.
Tank Supply Default
Will only update the order if the requested drops have a default supply option configured in the system.
This strategy ensures orders are fulfilled using pre-defined supply preferences.
Maintain
Will preserve the existing supply option characteristics (terminal, supplier, price type) when re-sourcing.
This strategy maintains supply consistency when only delivery details change.
delivery_window: DeliveryWindow | None = None
Optional new delivery window for the order. If provided, replaces the existing delivery window.
Show Child Attributes
start: datetime
Start of the delivery window.
end: datetime
End of the delivery window.
timezone: str = "UTC"
Timezone for the delivery window. Defaults to UTC.
note: str | None = None
An optional note to update on the order. If provided, replaces the existing note.
drops: list[Drop] = []
The list of drops to update on this order. If provided, replaces all existing drops.
Each drop corresponds to a specific product being dropped into a tank at a site.
Show Child Attributes
site: Site
The site identifier for the drop request, specifying the location of the drop.
Show Child Attributes
In order to match a site one of the identifying keys are required. The site will be matched in the following hierarchy: (source_system and source_id), id, number. Source system and source_id are set as extra_data on sites in order to create an external reference to the site.
id: str | None = None
Unique identifier for the site.
number: str | None = None
Site number.
source_system: str | None = None
The name of the external system this Site is integrated from.
source_id: str | None = None
The unique identifier for this Site in the source_system.
product: Product
The product to be dropped at this site.
Show Child Attributes
In order to match a product one of the identifying keys are required. The product will be matched in the following hierarchy: (source_system and source_id), id, name. Source system and source_id are set as extra_data on products in order to create an external reference to the product.
id: str | None = None
Unique identifier for the product.
name: str | None = None
Product name.
source_system: str | None = None
The name of the external system this Product is integrated from.
source_id: str | None = None
The unique identifier for this Product in the source_system.
tank_id: str
The tank identifier at the site where the product will be dropped.
volume: float
The volume of product to be dropped into the tank.
loads: list[Load] = []
Optional list of load specifications for this drop.
extra_data: dict | None = {}
Additional metadata to merge with the existing order's extra_data. New keys will be added, existing keys will be updated.
Responses
- 200
- 422
Successful Response
Validation Error
- application/json
- Example (from schema)
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}