Create a facility

POST /api/facilities

Allows you to create a new facility. Only available to Garmat administrators.

Body

The parameters to create a facility

  • account_id string Required

    id of the account to associate the facility to

  • First line of the facility address

  • Second line of the facility address

  • city string

    City where the facility is located

  • The type of climate control the facility has. Can be one of 'both', 'heated_only', 'cooled_only', or 'none'

  • id of the distributor associated to the facility

  • name string Required

    name of the facility to create

  • ID of the region the facility belongs to

  • The square footage of the facility

  • state string

    State where the facility is located

  • status string

    status of the facility to create.

  • Identifier of the facility

  • type string

    The type of facility. One of auto_body_shop, manufacturing_plant, or auto_dealership

  • tz string Required

    The timezone of the facility as a IANA TZ identifier string

  • working_hours array[object]

    List of facility schedules for the week

    Hide working_hours attributes Show working_hours attributes object
    • day string

      The day of the week. Should be all lowercase

    • enabled string

      Boolean indicating whether the facility operates on this day of the week

    • start string

      The ISO8601 formatted time when the facility starts operating on this day of the week

    • stop string

      The ISO8601 formatted time when the facility stops operating on this day of the week

  • zipcode string

    Zip code of the facility

Responses

  • OK

    Hide response attributes Show response attributes object
    • Id of the account the facility belongs to

    • Name of the account the facility belongs to

    • First line of the facility address

    • Second line of the facility address

    • city string

      City where the facility is located

    • The type of climate control the facility has. Can be one of 'both', 'heated_only', 'cooled_only', or 'none'

    • Id of the distributor the facility belongs to

    • Name of the distributor the facility belongs to

    • id string

      ID of the facility in the system

    • name string

      Name of the facility

    • ID of the region the facility belongs to

    • Name of the region the facility belongs to

    • The square footage of the facility

    • state string

      State where the facility is located

    • status string

      Status of the facility.

    • Identifier of the facility

    • type string

      The type of facility. One of auto_body_shop, manufacturing_plant, or auto_dealership

    • tz string

      The timezone of the facility as a IANA TZ identifier string

    • working_hours array[object]

      List of facility schedules for the week

      Hide working_hours attributes Show working_hours attributes object
      • day string

        The day of the week. Should be all lowercase

      • enabled string

        Boolean indicating whether the facility operates on this day of the week

      • start string

        The ISO8601 formatted time when the facility starts operating on this day of the week

      • stop string

        The ISO8601 formatted time when the facility stops operating on this day of the week

    • zipcode string

      Zip code of the facility

  • Unauthorized

    Hide response attribute Show response attribute object
    • error string

      Human readable version of the error status code

POST /api/facilities
curl \
 -X POST http://localhost:4000/api/facilities \
 -d '{"tz":"America/Denver","city":"Boulder","name":"Test Facility","type":"auto_body_shop","state":"CO","status":"active","zipcode":"12345","region_id":"392098bb-ac91-010c-aaa1-9032b19b8cf4","square_ft":12000.0,"account_id":"f260f115-f2e6-4dde-bcab-98b10fdb8cf6","store_number":"Test Facility 01","working_hours":[{"day":"monday","stop":"17:00:00","start":"09:00:00","enabled":true},{"day":"sunday","enabled":false}],"address_line_1":"Test Road 123","address_line_2":"Suite 1000","distributor_id":"e260f115-f2e6-4dde-bcab-98b10fdb8ce6","climate_control":"both"}'
Request examples
{
  "tz": "America/Denver",
  "city": "Boulder",
  "name": "Test Facility",
  "type": "auto_body_shop",
  "state": "CO",
  "status": "active",
  "zipcode": "12345",
  "region_id": "392098bb-ac91-010c-aaa1-9032b19b8cf4",
  "square_ft": 12000.0,
  "account_id": "f260f115-f2e6-4dde-bcab-98b10fdb8cf6",
  "store_number": "Test Facility 01",
  "working_hours": [
    {
      "day": "monday",
      "stop": "17:00:00",
      "start": "09:00:00",
      "enabled": true
    },
    {
      "day": "sunday",
      "enabled": false
    }
  ],
  "address_line_1": "Test Road 123",
  "address_line_2": "Suite 1000",
  "distributor_id": "e260f115-f2e6-4dde-bcab-98b10fdb8ce6",
  "climate_control": "both"
}
Response examples (200)
{
  "id": "293f191b-f2e6-4dde-bcab-00b10fdb8cf3",
  "tz": "America/Denver",
  "city": "Boulder",
  "name": "Test Facility",
  "type": "auto_body_shop",
  "state": "CO",
  "status": "active",
  "zipcode": "12345",
  "region_id": "392098bb-ac91-010c-aaa1-9032b19b8cf4",
  "square_ft": 12000.0,
  "account_id": "293f191b-f2e6-4dde-bcab-00b10fdb8cf4",
  "region_name": "Test Region",
  "account_name": "New account",
  "store_number": "Test Facility 01",
  "working_hours": [
    {
      "day": "monday",
      "stop": "17:00:00",
      "start": "09:00:00",
      "enabled": true
    },
    {
      "day": "sunday",
      "enabled": false
    }
  ],
  "address_line_1": "Test Road 123",
  "address_line_2": "Suite 1000",
  "distributor_id": "753f191b-f2e6-4dde-bcab-00b10fdb8cb0",
  "climate_control": "both",
  "distributor_name": "New distributor"
}
Response examples (200)
{
  "id": "293f191b-f2e6-4dde-bcab-00b10fdb8cf3",
  "tz": "America/Denver",
  "city": "Boulder",
  "name": "Test Facility",
  "type": "auto_body_shop",
  "state": "CO",
  "status": "active",
  "zipcode": "12345",
  "region_id": "392098bb-ac91-010c-aaa1-9032b19b8cf4",
  "square_ft": 12000.0,
  "account_id": "293f191b-f2e6-4dde-bcab-00b10fdb8cf4",
  "region_name": "Test Region",
  "account_name": "New account",
  "store_number": "Test Facility 01",
  "working_hours": [
    {
      "day": "monday",
      "stop": "17:00:00",
      "start": "09:00:00",
      "enabled": true
    },
    {
      "day": "sunday",
      "enabled": false
    }
  ],
  "address_line_1": "Test Road 123",
  "address_line_2": "Suite 1000",
  "distributor_id": "753f191b-f2e6-4dde-bcab-00b10fdb8cb0",
  "climate_control": "both",
  "distributor_name": "New distributor"
}
Response examples (401)
{
  "error": "Error Reason"
}
Response examples (401)
{
  "error": "Error Reason"
}