Manage origin locations for shipments. Origins are filtered from the unified locations table where location_type = "origen".
GET - List Origin Locations
Retrieves all origin locations.
Response
Unique identifier for the location
Always “origen” for this endpoint
Whether the location is active
Request Example
curl -X GET https://api.iclcotizaciones.com/api/origenes \
-H "Cookie: session=your_session_token"
Response Example
[
{
"id": 1,
"name": "Shanghai",
"country": "China",
"region": "Shanghai",
"location_type": "origen",
"is_active": true
},
{
"id": 2,
"name": "Hong Kong",
"country": "China",
"region": "Hong Kong SAR",
"location_type": "origen",
"is_active": true
}
]
{
"error": "No autorizado"
}
POST - Create Origin Location
Creates a new origin location. This endpoint requires admin permissions.
Admin Only: Only users with admin roles (DIRECTOR, GERENTE) can create origin locations.
Request Body
Whether the location is active
Request Example
curl -X POST https://api.iclcotizaciones.com/api/origenes \
-H "Cookie: session=your_session_token" \
-H "Content-Type: application/json" \
-d '{
"name": "Shenzhen",
"country": "China",
"region": "Guangdong",
"is_active": true
}'
Response Example
{
"id": 15,
"name": "Shenzhen",
"country": "China",
"region": "Guangdong",
"location_type": "origen",
"is_active": true
}
{
"error": "No autorizado"
}
PUT - Update Origin Location
Updates an existing origin location by ID. This endpoint requires admin permissions.
Admin Only: Only users with admin roles (DIRECTOR, GERENTE, ADMINISTRACION) can update origin locations.
Path Parameters
The unique identifier of the origin location to update
Request Body
Whether the location is active
Request Example
curl -X PUT https://api.iclcotizaciones.com/api/origenes/15 \
-H "Cookie: session=your_session_token" \
-H "Content-Type: application/json" \
-d '{
"name": "Shenzhen Port",
"country": "China",
"region": "Guangdong",
"is_active": true
}'
Response Example
{
"id": 15,
"name": "Shenzhen Port",
"country": "China",
"region": "Guangdong",
"location_type": "origen",
"is_active": true
}
{
"error": "No autorizado"
}
DELETE - Delete Origin Location
Deletes an origin location by ID. This endpoint requires admin permissions.
Admin Only: Only users with admin roles (DIRECTOR, GERENTE, ADMINISTRACION) can delete origin locations. This is a hard delete and cannot be undone.
Path Parameters
The unique identifier of the origin location to delete
Request Example
curl -X DELETE https://api.iclcotizaciones.com/api/origenes/15 \
-H "Cookie: session=your_session_token"
Response Example
{
"error": "No autorizado"
}