Create A Single Vehicle

Request

POST https://backend.net0.com/v1/vehicles

This endpoint allows you to create a new vehicle.

curl --location --request POST 'https://backend.net0.com/v1/vehicles' \
--header 'x-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Ope'\''s Vehicle",
  "imageUrl": "https://picsum.photos/200/300.webp",
  "fuelConsumption": 0,
  "fuelConsumptionUnitId": 0,
  "activityUnitId": 0,
  "emissionKindId": "738764ca-7d66-4bfb-8629-fe2a2fc4602e",
  "emissionFactorId": "4ac0c09f-bc0d-47c6-af37-95770a1c6cbf",
  "activityType": "DISTANCE",
  "fuelSource": "MOTOR_GASOLINE"
}'

Response

{
	"tableName": "vehicles",
        "id": "948bde0e-e8b9-4e9e-af74-d605b48d1f57",
        "name": "Test Vehicle",
        "imageUrl": null,
        "activityType": "FUEL",
        "fuelSource": "MOTOR_GASOLINE",
        "fuelConsumption": null,
        "fuelConsumptionUnitId": null,
        "emissionKindId": "738764ca-7d66-4bfb-8629-fe2a2fc4602e",
        "emissionFactorId": "4ac0c09f-bc0d-47c6-af37-95770a1c6cbf",
        "activityUnitId": 13,
        "companyId": 2,
        "totalEmission": 15.51,
        "createdAt": "2021-11-22T19:01:03.174Z",
        "updatedAt": "2021-11-25T15:36:03.393Z",
        "emissionKind": {
            "id": "738764ca-7d66-4bfb-8629-fe2a2fc4602e",
            "scope": "SCOPE_1",
            "underScope": "Vehicles",
            "activityTypeUnderScope": "COMPANY_VEHICLE",
            "name": "Company Vehicle",
            "companyId": null,
            "createdAt": "2021-11-19T13:19:25.410Z",
            "updatedAt": "2021-11-19T13:19:25.410Z"
        },
        "emissionFactor": {
            "id": "4ac0c09f-bc0d-47c6-af37-95770a1c6cbf",
            "name": "Motor Gasoline - Gasoline Passenger Cars",
            "source": null,
            "co2": 8.78,
            "ch4": 0.00038925,
            "n2o": 0.000081,
            "co2e": 0,
            "denominatorUnitId": 15,
            "numeratorUnitId": 2,
            "isCustom": false,
            "companyId": null,
            "createdAt": "2021-11-19T13:19:25.410Z",
            "updatedAt": "2021-11-19T13:19:25.410Z",
            "deletedAt": null
        },
        "activityUnit": {
            "id": 13,
            "name": "Liter",
            "short_name": "l",
            "multiplier": 1,
            "parent_id": null,
            "typeUnit": "VOLUME",
            "createdAt": "2021-11-19T13:19:25.410Z",
            "updatedAt": "2021-11-19T13:19:25.410Z"
        },
        "fuelConsumptionUnit": null
    }