Create or update a consumption record
Creates a new consumption record or updates an existing one. For more information and see how to use this endpoint, see: https://manglai.notion.site/Consumptions-2af89a8b970b806e8359e8446b67f32e
Autorizaciones
Cuerpo
Consumption data to be inserted or updated
Foreign key reference to the source entity (UUID): - For invoices: invoice ID from GET /api/v1/invoices - For vehicles: vehicle ID from GET /api/v1/vehicles?companyId={companyId}. The vehicle must exist and be available during the consumption period. - For surveys: survey answer ID
"invoice-123-abc"
GHG Protocol category ID (UUID). Call GET /api/v1/categories?level=subcategory to obtain the list and send the selected id. - Vehicle categories: LAND_TRANSPORTATION, AIR_TRANSPORTATION, MARITIME_TRANSPORTATION, RAIL_TRANSPORTATION, FORESTRY_MACHINERY, FARM_MACHINERY, INDUSTRIAL_MACHINERY
"668f3fcb-7fb0-4b65-b77d-9303c551632f"
Building identifier (UUID). Call GET /api/v1/companies/{companyId}/buildings?companyId={companyId} and use the building id. For vehicle consumptions: If the vehicle has a buildingId assigned, you can use that value. Otherwise, use a building from the company.
"7fef7760-f9e7-4de9-ae35-8c37db65e4a3"
Provider/supplier code. For electricity consumptions call GET /api/v1/inputs/recommended?companyId={companyId}&types=provider&countryCode={countryCode} and send the code. Required for vehicle consumptions: If vehicle motorType is electric or hybrid, this field is mandatory.
"endesa"
Fuel code. For combustion consumptions call GET /api/v1/inputs/recommended?companyId={companyId}&types=fuel&countryCode={countryCode}. For gas leaks use types=gasLeak. Send the code. Required for vehicle consumptions: If vehicle motorType is combustion or hybrid, this field must be provided in extraData.fuelTypeId or extraData.fuelTypeCode.
"diesel"
Array of category IDs (UUID) for multi-category emissions. Retrieve IDs via GET /api/v1/categories?level=subcategory.
For general consumptions (optional): Used when a consumption should generate emissions in multiple categories (e.g., electricity + energy-related-activities).
For vehicle consumptions (required): Must always include two categories: - Primary category (same as categoryId) - Related activity category:
- Electric/Hybrid vehicles:
ENERGY_RELATED_ACTIVITIES(47cb52b3-02e6-446e-bd70-e46316aa876b) - Combustion vehicles:
FUEL_RELATED_ACTIVITIES(dd16800c-c79f-4717-9de6-07e15f4ceb64)

