GreenPlaces Integrations
HomeDashboard
  • 👋Welcome to GreenPlaces
  • Overview
    • Adding your Team
    • Available Integrations
      • 👥HRIS
      • ⚡Utilities
      • 📖Accounting
    • Configuring SSO
  • Integrations
    • HRIS
    • Accounting
    • Utilities
  • GreenPlaces API
    • 🌏API Overview
    • 🔐Authentication
    • 🧭API Reference
      • Air travel
        • Bulk
        • Segments
      • Appliances
        • File
      • Expenses
      • Locations
      • Vehicles
      • Vendors
    • Specification
  • Page
Powered by GitBook
On this page
  1. GreenPlaces API
  2. API Reference

Air travel

PreviousAPI ReferenceNextBulk

Last updated 1 year ago

🧭

Get air-travel

get

obtain information about a air-travel

Path parameters
idstringRequired

ID of The AirTravel

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Responses
200
Successful operation
application/json
400
Bad Request
application/json
403
Unauthenticated
application/json
404
Not Found
application/json
500
Internal Server
application/json
get
GET /api/air-travel/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "traveler_name": "test name",
    "traveler_email": "test@gmail.com",
    "spend_amount": "2000.32",
    "distance_mi": "9164",
    "distance_km": "14745",
    "currency": "USD",
    "segments": [
      {
        "id": "99b80a01-fd16-4c8a-9716-db37407bdc67",
        "departure": {
          "id": "36616115-61ba-4890-a6ce-ddb4e4e68ec4",
          "iata_code": "ATD",
          "icao_code": "AGAT",
          "airport_name": "Atoifi"
        },
        "arrival": {
          "id": "300a8ec20-ad3b-4377-a003-0baa23deae3e",
          "iata_code": "ERM",
          "icao_code": "SSER",
          "airport_name": "Comandante Kraemer"
        },
        "started_at": "2023-06-12 17:30:21",
        "ended_at": "2023-06-12 17:30:21",
        "flight_date": "2023-06-12",
        "flight_status": "Completed",
        "flight_number": "A121312",
        "distance_mi": "9164",
        "distance_km": "14745",
        "airline": {
          "id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
          "iata_code": "7P",
          "icao_code": "PST",
          "airline_name": "Air Panama dba Parsa, S.A."
        },
        "emission": {
          "scope": "3",
          "carbon_equivalent": "6573.6700",
          "carbon_dioxide": "2641.0894",
          "methane": "0.1460",
          "nitrous_oxide": "13.1397"
        }
      }
    ]
  },
  "meta": {}
}

Delete air-travel

delete

remove air-travel

Path parameters
idstringRequired

ID of The AirTravel

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Responses
200
Successful operation
application/json
400
Bad Request
application/json
403
Unauthenticated
application/json
404
Not Found
application/json
500
Internal Server
application/json
delete
DELETE /api/air-travel/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": null,
  "meta": {}
}
  • GETRetrieve all AirTravelSegment
  • POSTStore an AirTravel
  • GETGet air-travel
  • PUTUpdate AirTravel
  • DELETEDelete air-travel

Retrieve all AirTravelSegment

get

Retrieve all AirTravelSegment that belong to a company

Query parameters
per_pageintegerOptional

limit of records per page

Example: 10
pageintegerOptional

page number

Example: 2
traveler_namestringOptional

This field is used to filter by air-travel name. (LIKE)

Example: test name
currencystringOptional

This field is used to filter by air-travel currency.

Example: USD
sort_bystringOptional

This parameter is used to sort the records by a specific field (created_at,traveler_name)

Example: traveler_name
sort_dirstringOptional

Order type(asc or desc)

Example: asc
Responses
200
Successful operation
application/json
400
Bad Request
application/json
403
Unauthenticated
application/json
404
Not Found
application/json
500
Internal Server
application/json
get
GET /api/air-travel HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": [
    {
      "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
      "traveler_name": "test name",
      "traveler_email": "test@gmail.com",
      "spend_amount": "2000.32",
      "distance_mi": "9164",
      "distance_km": "14745",
      "currency": "USD",
      "segments": [
        {
          "id": "99b80a01-fd16-4c8a-9716-db37407bdc67",
          "departure": {
            "id": "36616115-61ba-4890-a6ce-ddb4e4e68ec4",
            "iata_code": "ATD",
            "icao_code": "AGAT",
            "airport_name": "Atoifi"
          },
          "arrival": {
            "id": "300a8ec20-ad3b-4377-a003-0baa23deae3e",
            "iata_code": "ERM",
            "icao_code": "SSER",
            "airport_name": "Comandante Kraemer"
          },
          "started_at": "2023-06-12 17:30:21",
          "ended_at": "2023-06-12 17:30:21",
          "flight_date": "2023-06-12",
          "flight_status": "Completed",
          "flight_number": "A121312",
          "distance_mi": "9164",
          "distance_km": "14745",
          "airline": {
            "id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
            "iata_code": "7P",
            "icao_code": "PST",
            "airline_name": "Air Panama dba Parsa, S.A."
          },
          "emission": {
            "scope": "3",
            "carbon_equivalent": "6573.6700",
            "carbon_dioxide": "2641.0894",
            "methane": "0.1460",
            "nitrous_oxide": "13.1397"
          }
        }
      ]
    }
  ],
  "meta": {
    "pagination": {
      "current": "1",
      "last_page": "1",
      "per_page": "10",
      "total": "6"
    }
  }
}

Store an AirTravel

post

Store an AirTravel for a particular compny.

Body

create AirTravel request body data

traveler_namestringOptional

name of the air-travel

Example: test name
traveler_emailstringOptional

traveler_email of the air-travel

Example: test@gmail.com
spend_amountnumberOptional

spend_amount of the air-travel

Example: 2000.32
currencystringOptional

currency of the air-travel, by default is USD

Example: USD
Responses
200
Successful operation
application/json
400
Bad Request
application/json
403
Unauthenticated
application/json
404
Not Found
application/json
500
Internal Server
application/json
post
POST /api/air-travel HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 393

{
  "traveler_name": "test name",
  "traveler_email": "test@gmail.com",
  "spend_amount": "2000.32",
  "currency": "USD",
  "segments": [
    {
      "airline_id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
      "flight_date": "2023-03-17",
      "flight_number": "A1212",
      "flight_status": "completed",
      "departure_id": "AGAT",
      "arrival_id": "730fcf91-1d3c-44e7-b4ef-7c9dbb7d8aee",
      "started_at": "2023-03-17 12:34:56",
      "ended_at": "2023-03-17 13:45:30"
    }
  ]
}
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "traveler_name": "test name",
    "traveler_email": "test@gmail.com",
    "spend_amount": "2000.32",
    "distance_mi": "9164",
    "distance_km": "14745",
    "currency": "USD",
    "segments": [
      {
        "id": "99b80a01-fd16-4c8a-9716-db37407bdc67",
        "departure": {
          "id": "36616115-61ba-4890-a6ce-ddb4e4e68ec4",
          "iata_code": "ATD",
          "icao_code": "AGAT",
          "airport_name": "Atoifi"
        },
        "arrival": {
          "id": "300a8ec20-ad3b-4377-a003-0baa23deae3e",
          "iata_code": "ERM",
          "icao_code": "SSER",
          "airport_name": "Comandante Kraemer"
        },
        "started_at": "2023-06-12 17:30:21",
        "ended_at": "2023-06-12 17:30:21",
        "flight_date": "2023-06-12",
        "flight_status": "Completed",
        "flight_number": "A121312",
        "distance_mi": "9164",
        "distance_km": "14745",
        "airline": {
          "id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
          "iata_code": "7P",
          "icao_code": "PST",
          "airline_name": "Air Panama dba Parsa, S.A."
        },
        "emission": {
          "scope": "3",
          "carbon_equivalent": "6573.6700",
          "carbon_dioxide": "2641.0894",
          "methane": "0.1460",
          "nitrous_oxide": "13.1397"
        }
      }
    ]
  },
  "meta": {}
}

Update AirTravel

put

Update an AirTravel for a company

Path parameters
idstringRequired

ID of The AirTravel

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Body

update AirTravel request body data

traveler_namestringOptional

name of the air-travel

Example: test name
traveler_emailstringOptional

traveler_email of the air-travel

Example: test@gmail.com
spend_amountnumberOptional

spend_amount of the air-travel

Example: 2000.32
currencystringOptional

currency of the air-travel, by default is USD

Example: USD
Responses
200
Successful operation
application/json
400
Bad Request
application/json
403
Unauthenticated
application/json
404
Not Found
application/json
500
Internal Server
application/json
put
PUT /api/air-travel/{id} HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 393

{
  "traveler_name": "test name",
  "traveler_email": "test@gmail.com",
  "spend_amount": "2000.32",
  "currency": "USD",
  "segments": [
    {
      "airline_id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
      "flight_date": "2023-03-17",
      "flight_number": "A1212",
      "flight_status": "completed",
      "departure_id": "AGAT",
      "arrival_id": "730fcf91-1d3c-44e7-b4ef-7c9dbb7d8aee",
      "started_at": "2023-03-17 12:34:56",
      "ended_at": "2023-03-17 13:45:30"
    }
  ]
}
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "traveler_name": "test name",
    "traveler_email": "test@gmail.com",
    "spend_amount": "2000.32",
    "distance_mi": "9164",
    "distance_km": "14745",
    "currency": "USD",
    "segments": [
      {
        "id": "99b80a01-fd16-4c8a-9716-db37407bdc67",
        "departure": {
          "id": "36616115-61ba-4890-a6ce-ddb4e4e68ec4",
          "iata_code": "ATD",
          "icao_code": "AGAT",
          "airport_name": "Atoifi"
        },
        "arrival": {
          "id": "300a8ec20-ad3b-4377-a003-0baa23deae3e",
          "iata_code": "ERM",
          "icao_code": "SSER",
          "airport_name": "Comandante Kraemer"
        },
        "started_at": "2023-06-12 17:30:21",
        "ended_at": "2023-06-12 17:30:21",
        "flight_date": "2023-06-12",
        "flight_status": "Completed",
        "flight_number": "A121312",
        "distance_mi": "9164",
        "distance_km": "14745",
        "airline": {
          "id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
          "iata_code": "7P",
          "icao_code": "PST",
          "airline_name": "Air Panama dba Parsa, S.A."
        },
        "emission": {
          "scope": "3",
          "carbon_equivalent": "6573.6700",
          "carbon_dioxide": "2641.0894",
          "methane": "0.1460",
          "nitrous_oxide": "13.1397"
        }
      }
    ]
  },
  "meta": {}
}