Skip to main content

Update service station

PUT 

/api/oil/:id

Endpoint to modify data of an existing service station.

Modifiable fields:

  • All fields of the OilStation schema can be updated
  • The ID cannot be modified
  • Required fields must remain present

Validations performed:

  • Verifies that the station exists
  • Checks that the name is not duplicated in the same city
  • Validates the geographic coordinates format
  • Ensures that mandatory fields remain

Use cases:

  • Data update due to physical changes at the station
  • Correction of erroneous information
  • Update of available fuel types

Request example:

{
name: Estación Norte Renovada,
address: Avenida Principal 456,
city: Barcelona,
country: ES,
latitude: 41.3851,
longitude: 2.1734,
fuels: [diesel, gasoline95, gasoline98, LPG],
isActive: true
}

Request

Responses

Station updated successfully. Returns the updated data.