Batch Locations
POST /v2/tms-api/batch/locations
Create, update, or upsert multiple locations in a single request.
Analytics Optimization
Batch operations trigger analytics once for the entire batch, not per item.
Request Body
itemsarrayrequired Array of location items. Each item must have: - `operation`: `create`, `update`, or `upsert` - `external_reference_id`: Location external reference ID - `location`: Location data object
Request Example
bash
curl -X POST "https://api.mentium.io/v2/tms-api/batch/locations" \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"operation": "create",
"external_reference_id": "LOC-CHICAGO-001",
"location": {
"external_reference_id": "LOC-CHICAGO-001",
"name": "Chicago Distribution Center",
"city": "Chicago",
"state": "IL",
"postal_code": "60601",
"country": "US"
}
}
]
}'Response
json
{
"success_count": 1,
"error_count": 0,
"results": [
{
"external_reference_id": "LOC-CHICAGO-001",
"operation": "create",
"success": true,
"id": "loc_abc123"
}
]
}