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

Locations

PreviousExpensesNextVehicles
🧭

Retrieve a location

get

Retrieve a location for a company

Path parameters
locationstringRequired

Id of the location

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/locations/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "company_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "quantity": "100",
    "sku": "028868",
    "source": "factory",
    "provider_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "line1": "77120 Keara Mission",
    "line2": "77120 Keara Mission",
    "city": "Metairie",
    "state": "New Hampshire",
    "postal_code": "20426-6006",
    "country": "Mali",
    "formatted_address": "New Hampshire, USA",
    "latitude": "43.19385160000000",
    "longitude": "-71.5723952999999",
    "place_id": "123456",
    "data_status": "active",
    "retrieved_at": "2023-07-04T00:00:00.000000Z",
    "category": "office",
    "nickname": "Beverly Hills Office",
    "sqft": 11960,
    "has_commute": true,
    "integration_response": [
      "text"
    ],
    "geocode_response": {},
    "ownership": "Owned",
    "type": "Warehouse",
    "population": "Warehouse",
    "has_solar": true,
    "walkability": {},
    "bikeability": {},
    "rideability": {},
    "energy_grid_factor": 11960,
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}

Delete a location

delete

Delete a location for a company

Path parameters
idstringRequired

Id of the location

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/locations/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": null,
  "meta": {}
}
  • GETRetrieve all locations
  • POSTStore a location
  • GETRetrieve a location
  • PUTUpdate a location
  • DELETEDelete a location

Retrieve all locations

get

Retrieve all locations for a company

Query parameters
per_pageintegerOptional

limit of records per page

Example: 10
pageintegerOptional

page number

Example: 2
citystringOptional

This field is used to filter by city model. (LIKE)

Example: Athens
statestringOptional

This field is used to filter by state model. (LIKE)

Example: Georgia
countrystringOptional

This field is used to filter by country model. (LIKE)

Example: United States
categorystringOptional

This field is used to filter by category model. (LIKE)

Example: office
typestringOptional

This field is used to filter by type model. (LIKE)

Example: Warehouse
sort_bystringOptional

This parameter is used to sort the records by a specific field (city,state,country,place_id,category,has_commute,ownership,type,has_solar,created_at)

Example: type
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/locations HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": [
    {
      "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
      "company_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
      "quantity": "100",
      "sku": "028868",
      "source": "factory",
      "provider_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
      "line1": "77120 Keara Mission",
      "line2": "77120 Keara Mission",
      "city": "Metairie",
      "state": "New Hampshire",
      "postal_code": "20426-6006",
      "country": "Mali",
      "formatted_address": "New Hampshire, USA",
      "latitude": "43.19385160000000",
      "longitude": "-71.5723952999999",
      "place_id": "123456",
      "data_status": "active",
      "retrieved_at": "2023-07-04T00:00:00.000000Z",
      "category": "office",
      "nickname": "Beverly Hills Office",
      "sqft": 11960,
      "has_commute": true,
      "integration_response": [
        "text"
      ],
      "geocode_response": {},
      "ownership": "Owned",
      "type": "Warehouse",
      "population": "Warehouse",
      "has_solar": true,
      "walkability": {},
      "bikeability": {},
      "rideability": {},
      "energy_grid_factor": 11960,
      "updated_at": "2023-06-12T17:30:21.000000Z",
      "created_at": "2023-06-12T17:30:21.000000Z"
    }
  ],
  "meta": {
    "pagination": {
      "current": "1",
      "last_page": "1",
      "per_page": "10",
      "total": "6"
    }
  }
}

Store a location

post

Store a location for a company

Body

Creates locations request body data

quantityanyOptional

Quantity for the Location

Example: 100
skuanyOptional

SKU for the Location

Example: 35015
sourceanyOptional

Source for the Location

Example: factory
line1anyRequired

Line 1 for the Location

Example: 175 Atlantic St
line2anyOptional

Line 2 for the Location

Example: 175 Atlantic St
cityanyOptional

City for the Location

Example: Georgia
stateanyOptional

State for the Location

Example: Georgia
postal_codeanyOptional

Postal Code for the Location

Example: 77024-1503
countryanyOptional

Country for the Location

Example: United States
categoryanyOptional

Category for the Location

Example: Office
nicknameanyRequired

Nickname for the Location

Example: Office A/C
sqftanyOptional

The square foot for the Location

Example: 20
has_commuteanyOptional

Has commute for the Location

Example: true
ownershipanyOptional

Ownership for the Location

Example: Owned
typeanyRequired

Type for the Location

Example: Warehouse
populationanyOptional

Population for the Location

Example: 10
has_solaranyOptional

Has solar for the Location

Example: true
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/locations HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 344

{
  "quantity": "100",
  "sku": "35015",
  "source": "factory",
  "line1": "175 Atlantic St",
  "line2": "175 Atlantic St",
  "city": "Georgia",
  "state": "Georgia",
  "postal_code": "77024-1503",
  "country": "United States",
  "category": "Office",
  "nickname": "Office A/C",
  "sqft": "20",
  "has_commute": "true",
  "ownership": "Owned",
  "type": "Warehouse",
  "population": "10",
  "has_solar": "true"
}
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "company_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "quantity": "100",
    "sku": "028868",
    "source": "factory",
    "provider_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "line1": "77120 Keara Mission",
    "line2": "77120 Keara Mission",
    "city": "Metairie",
    "state": "New Hampshire",
    "postal_code": "20426-6006",
    "country": "Mali",
    "formatted_address": "New Hampshire, USA",
    "latitude": "43.19385160000000",
    "longitude": "-71.5723952999999",
    "place_id": "123456",
    "data_status": "active",
    "retrieved_at": "2023-07-04T00:00:00.000000Z",
    "category": "office",
    "nickname": "Beverly Hills Office",
    "sqft": 11960,
    "has_commute": true,
    "integration_response": [
      "text"
    ],
    "geocode_response": {},
    "ownership": "Owned",
    "type": "Warehouse",
    "population": "Warehouse",
    "has_solar": true,
    "walkability": {},
    "bikeability": {},
    "rideability": {},
    "energy_grid_factor": 11960,
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}

Update a location

put

Update a location for a company

Path parameters
idstringRequired

Id of the location

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

Update Location request body data

quantityanyOptional

Quantity for the Location

Example: 100
skuanyOptional

SKU for the Location

Example: 35015
sourceanyOptional

Source for the Location

Example: factory
line1anyRequired

Line 1 for the Location

Example: 175 Atlantic St
line2anyOptional

Line 2 for the Location

Example: 175 Atlantic St
cityanyOptional

City for the Location

Example: Georgia
stateanyOptional

State for the Location

Example: Georgia
postal_codeanyOptional

Postal Code for the Location

Example: 77024-1503
countryanyOptional

Country for the Location

Example: United States
categoryanyOptional

Category for the Location

Example: Office
nicknameanyRequired

Nickname for the Location

Example: Office A/C
sqftanyOptional

The square foot for the Location

Example: 20
has_commuteanyOptional

Has commute for the Location

Example: true
ownershipanyOptional

Ownership for the Location

Example: Owned
typeanyRequired

Type for the Location

Example: Warehouse
populationanyOptional

Population for the Location

Example: 10
has_solaranyOptional

Has solar for the Location

Example: true
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/locations/{id} HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 344

{
  "quantity": "100",
  "sku": "35015",
  "source": "factory",
  "line1": "175 Atlantic St",
  "line2": "175 Atlantic St",
  "city": "Georgia",
  "state": "Georgia",
  "postal_code": "77024-1503",
  "country": "United States",
  "category": "Office",
  "nickname": "Office A/C",
  "sqft": "20",
  "has_commute": "true",
  "ownership": "Owned",
  "type": "Warehouse",
  "population": "10",
  "has_solar": "true"
}
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "company_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "quantity": "100",
    "sku": "028868",
    "source": "factory",
    "provider_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "line1": "77120 Keara Mission",
    "line2": "77120 Keara Mission",
    "city": "Metairie",
    "state": "New Hampshire",
    "postal_code": "20426-6006",
    "country": "Mali",
    "formatted_address": "New Hampshire, USA",
    "latitude": "43.19385160000000",
    "longitude": "-71.5723952999999",
    "place_id": "123456",
    "data_status": "active",
    "retrieved_at": "2023-07-04T00:00:00.000000Z",
    "category": "office",
    "nickname": "Beverly Hills Office",
    "sqft": 11960,
    "has_commute": true,
    "integration_response": [
      "text"
    ],
    "geocode_response": {},
    "ownership": "Owned",
    "type": "Warehouse",
    "population": "Warehouse",
    "has_solar": true,
    "walkability": {},
    "bikeability": {},
    "rideability": {},
    "energy_grid_factor": 11960,
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}