Add new business trip

Request

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

This endpoint allows you to create a single trip for an employee.

curl --location --request POST 'https://backend.net0.com/v1/travels' \
--header 'x-api-key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "movementDto": {
        "fromAddress": {
            "startAddress": "New providence Gardens",
            "startPoint": "[6.457823703894839, 3.553948217590948]"
        },
        "toAddress": {
            "endAddress": "Just Basics Bakery",
            "endPoint": "[6.464483144521335, 3.6299068753288988]"
        },
        "weight": 20,
        "name": "Opman Trip",
        "referenceNumber": "3fr566f-3dsfhajs",
        "isReturnMoving": true,
        "startDate": "2021-11-28T15:29:56.471Z",
        "endDate": "2021-11-28T16:29:56.471Z",
        "transportType": "TRUCK",
        "vendorId": "8df19e8c-5acf-4d3c-92af-6b1870a8a7ed",
        "transportWeightTon": 40
    },
    "comment": "Example Travel",
    "startDateUtc": "2022-11-28T16:29:56.471Z",
    "endDateUtc": "2022-12-28T16:29:56.471Z",
    "bookingReference": 0,
    "hotelNights": 2,
    "flightClass": "ECONOMY"
}'
Field Parameters
{
  "movementDto": {
    "fromAddress": {
      "startAddress": "string",
      "startPoint": "string"
    },
    "toAddress": {
      "endAddress": "string",
      "endPoint": "string"
    },
    "weight": 0,
    "name": "string",
    "referenceNumber": "string",
    "customOptions": {},
    "isReturnMoving": true,
    "startDate": "2021-11-24T12:57:59.763Z",
    "endDate": "2021-11-24T12:57:59.763Z",
    "transportType": "TRUCK",
    "vendorId": "string",
    "transportWeightTon": 0,
    "comment": "string"
  },
  "comment": "string",
  "startDateUtc": "string",
  "endDateUtc": "string",
  "bookingReference": 0,
  "hotelNights": 0,
  "flightClass": "ECONOMY"
}
AttributeTypeDescription
movementDtoObjectThis is a data transfer object that contains the fromAddress and toAddress object destinations of a particular trip and other parameters.
weightNumberDescribes the weight in Kilograms in the movementDto.
nameStringThis is the name of the travel in the movementDto.
referenceNumberStringDescribes the associated reference number in the movementDto.
customOptionsObjectThis describes customizable values of a travel in the movementDto.
isReturnMovingBooleanSpecifies if a travel would be return-enabled in the movementDto.
startDateStringThis is the start date of the travel in the movementDto in the movementDto.
endDateStringThis is the end date of the travel in the movementDto in the movementDto.
transportTypeStringDescribes the mode of transportation in the movementDto.
vendorIdStringThis is the id of the vendor in the movementDto.
transportWeightTonNumberThe weight of the transport mode in the movementDto. It has a maximum of 59.
commentStringA comment on the movementDto.
startDateUtcStringDescribes the start date of the travel in UTC value.
endDateUtcStringDescribes the end date of the travel in UTC value.
bookingReferenceStringThis is a booking reference for the travel.
hotelNightsNumberDescribes the number of nights to be spent in an hotel.
flightClassStringDescribes the class of the flight. Enum values are: [ ECONOMY, PREMIUM_ECONOMY, BUSINESS, FIRST_CLASS ].

Response

The response is a JSON response of the created travel.

{
  "id": "string",
  "emissionKind": {
    "id": "string",
    "scope": "SCOPE_1",
    "underScope": "Sites",
    "activityTypeUnderScope": "COMPANY_VEHICLE",
    "name": "string",
    "companyId": 0,
    "siteElectricitys": [
      {
        "id": "string",
        "totalEmission": 0,
        "value": 0,
        "percentageOfCleanEnergy": 0,
        "comment": "string",
        "startDate": "2021-11-24T12:57:59.819Z",
        "endDate": "2021-11-24T12:57:59.819Z",
        "createdAt": "2021-11-24T12:57:59.819Z",
        "updatedAt": "2021-11-24T12:57:59.819Z",
        "emission": {
          "id": "string",
          "co2": 0,
          "ch4": 0,
          "n2o": 0,
          "co2e": 0,
          "createdAt": "2021-11-24T12:57:59.819Z",
          "updatedAt": "2021-11-24T12:57:59.819Z",
          "unit": {
            "id": 0,
            "name": "string",
            "short_name": "string",
            "multiplier": 0,
            "parent_id": 0,
            "typeUnit": "WEIGHT",
            "emissionFactorsDenominators": [
              null
            ],
            "emissionFactorsNumerators": [
              null
            ],
            "sitesElectricitys": [
              null
            ],
            "sitesFuels": [
              null
            ],
            "emissions": [
              null
            ],
            "vehiclesActivityUnits": [
              null
            ],
            "vehiclesFuelConsumptionUnit": [
              null
            ],
            "createdAt": "2021-11-24T12:57:59.819Z",
            "updatedAt": "2021-11-24T12:57:59.819Z"
          }
        }
      }
   ]