Location Upsert Many
POST/v1/location/upsert_many
Create/Update Location Information
Creates a new location or updates an existing one based on the provided identification fields and attributes. This endpoint allows for detailed management of location data, including address, type, operational hours, and related market information.
Request
id: str | None = None
The internal identifier of the location. If provided, the request will be treated as an update.
source_id: str | None = None
Identifier from an external system if the data is received through integration.
source_system_id: str | None = None
Identifier for the source system if the data is received through integration.
name: str
The unique name of the location.
short_name: str
The abbreviated name of the location.
address: str
The location’s street address, e.g., 111 Example St.
type: str
The type of location.
Types
Biodiesel Terminal
A terminal that stores biodiesel.
Ethanol Terminal
A terminal that stores ethanol.
Terminal
Regular terminal. Default in most cases.
city: str | None = None
The location’s city.
state: str | None = None
The location’s state (formatted as a two-letter abbreviation).
market_id: str | None = None
The internal market identifier of the location’s market.
market: str
The market name of the location’s market.
lat: float
The latitude of the location.
lon: float
The longitude of the location.
hours: str | None = None
Hours the location is available.
contact: str | None = None
Contact name for the location.
contact_phone: str | None = None
The location’s phone number.
active: bool = True
Indicates whether the location is active or inactive.
include_in_backhaul: bool = False
Indicates whether this location is considered for backhaul options.
requires_card: bool = False
Indicates whether the location requires a card for access.
split_load_terminals: list[str] = []
List of terminal names where split loads are allowed after this terminal.
authorized_carriers: list[str] = []
List of authorized carriers for the location.
geofence: list[Coordinate] = None
List of latitude and longitude coordinates that define the geofence for the location.
These can be generated using a tool like https://geojson.io and copying in the coordinate list.
If a polygon geofence is not specified a radius based geofence will be used by default.
Details
Show Coordinate Attributes
latitude: floatLatitude of the coordinate.
longitude: float
Longitude of the coordinate.
supply_map: list[SourceMap] = None
List of source_system and source_id mappings.
Used for eBOL process.
Details
Show SourceMap Attributes
source_system: strSystem name.
source_id: str
ID in the source system.
extra_data: dict | None = None
Any additional data provided or managed through integration endpoints.
Response
created: int
The number of locations created.
updated: int
The number of locations updated.
errors: list
List of any errors encountered for locations that could not be processed.
This format ensures that users are informed of the outcomes of the create or update operations, including success counts and details on any issues.
Responses
- 200
- 422
Successful Response
Validation Error
- application/json
- Example (from schema)
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}