Skip to main content
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

id
integer
Unique identifier for the location
name
string
Location name
country
string
Country name
region
string
Region or state
location_type
string
Always “origen” for this endpoint
is_active
boolean
Whether the location is active

Request Example

cURL
curl -X GET https://api.iclcotizaciones.com/api/origenes \
  -H "Cookie: session=your_session_token"

Response Example

200
[
  {
    "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
  }
]
401
{
  "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

name
string
required
Location name
country
string
required
Country name
region
string
Region or state
is_active
boolean
default:true
Whether the location is active

Request Example

cURL
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

201
{
  "id": 15,
  "name": "Shenzhen",
  "country": "China",
  "region": "Guangdong",
  "location_type": "origen",
  "is_active": true
}
403
{
  "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

id
integer
required
The unique identifier of the origin location to update

Request Body

name
string
required
Location name
country
string
required
Country name
region
string
Region or state
is_active
boolean
Whether the location is active

Request Example

cURL
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

200
{
  "id": 15,
  "name": "Shenzhen Port",
  "country": "China",
  "region": "Guangdong",
  "location_type": "origen",
  "is_active": true
}
403
{
  "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

id
integer
required
The unique identifier of the origin location to delete

Request Example

cURL
curl -X DELETE https://api.iclcotizaciones.com/api/origenes/15 \
  -H "Cookie: session=your_session_token"

Response Example

200
{
  "ok": true
}
403
{
  "error": "No autorizado"
}

Build docs developers (and LLMs) love