Get Estimate Groups

πŸš€

Try our GraphQL Playground

We've included some static documentation below, however GraphQL APIs are traditionally represented through interactive playgrounds. HOVER GraphQL Playground

Introduction

An estimate group gets generated as a result of the sales rep completing the estimation process. An estimate is generated for each selected trade template in the estimation process. This collection of estimates is called an Estimate Group.

Each Estimate Group can have one or more estimates associated with multiple templates and trades.

Queries

estimationEstimateGroups

This query will return all the estimate groups associated with a job. You can determine this by passing the jobId variable into the query. If the response is empty, there are no estimates associated with the job.

{  
  estimationEstimateGroups(jobId: job_id) {  
    nodes {  
      id  ## id of an estimate group
      updatedAt ## date last updated
    }  
  }  
  "data": {  
    "estimationEstimateGroups": {  
      "nodes": [  
        {  
          "id": 228456,  
          "updatedAt": "2020-06-25T08:52:04Z"  
        },  
        {  
          "id": 228457,  
          "updatedAt": "2020-06-25T08:52:45Z"  
        }  
      ]  
    }  
  }  
}
curl -X POST "https://graph.hover.to/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{"query": "{ estimationEstimateGroups(jobId: \"job_id\") { nodes { id updatedAt } } }"}'

Request:
  Method: POST
  URL: https://graph.hover.to/graphql
  Headers:
    Content-Type: application/json
    Authorization: Bearer YOUR_ACCESS_TOKEN
  Body:
    Type: Raw (JSON)
    Content:
      {
        "query": "{ estimationEstimateGroups(jobId: \"job_id\") { nodes { id updatedAt } } }"
      }

Arguments

Additional arguments can be supplied within the query to return a specific subset of estimate groups, for example:

estimationEstimateGroups(last: 30, jobId: 123456)

ArgumentsDescriptionAccepts
afterReturns the elements in the list that come after the specified cursor.int
beforeReturns the elements in the list that come before the specified cursor.int
firstReturns the first n elements from the list.int
lastReturns the last n elements from the list.int
jobIdOnly return records for this jobint

In addition to top level arguments, you can specify an argument for active estimates. An active estimate is one that has been marked as sold and is being used in production.

estimates(active: true)

ArgumentDescriptionAccepts
activeWhether or not the estimate is active within an estimate groupboolean

Get All Estimate Groups Detailed

Job information and sales opportunity information can be retrieved alongside estimate groups.

{
  estimationEstimateGroups(jobId: #{job_id}) {
    nodes {
      id ## query for active estimate group id
      createdAt ## query for creation date
      updatedAt ## query for last updated date
      salesOpportunity {  ## include sales opportunity info 
        soldEstimateGroupId ## query for estimate group marked as sold in opportunity
        productionList {
          id ## query for production list id
          ## production list can be expanded here: see Material List
        }
        soldEstimateGroup { ## include sold estimate group info
          estimates { ## specify properties for each estimate
            id ## query for estimate id
            userId ## query for id of creating user
            createdAt ## query for creation date
            updatedAt ## query for last updated date
            name ## query for name of estimate
            active ## query if estimate is active
            tradeType ## query for type of trade
          }
        }
      }
    }
  }
{
  "data": {
    "estimationEstimateGroups": {
      "nodes": [
        {
          "id": 228456,
          "createdAt": "2020-06-25T08:52:02Z",
          "updatedAt": "2020-06-25T08:52:04Z",
          "salesOpportunity": {
            "soldEstimateGroupId": "228457",
            "productionList": {
              "id": 6943
            },
            "soldEstimateGroup": {
              "estimates": [
                {
                  "id": 278122,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:44Z",
                  "updatedAt": "2020-06-25T08:52:44Z",
                  "name": "GAF Timberline American Harvest (Roof)",
                  "active": false,
                  "tradeType": "ROOF"
                },
                {
                  "id": 278123,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:44Z",
                  "updatedAt": "2020-06-25T08:52:44Z",
                  "name": "GAF - Grand Sequoia (Roof)",
                  "active": false,
                  "tradeType": "ROOF"
                },
                {
                  "id": 278126,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Standard (Skylights)",
                  "active": false,
                  "tradeType": "SKYLIGHTS"
                },
                {
                  "id": 278127,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Custom (Skylights)",
                  "active": false,
                  "tradeType": "SKYLIGHTS"
                },
                {
                  "id": 278128,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Vinyl (Windows)",
                  "active": false,
                  "tradeType": "WINDOWS"
                },
                {
                  "id": 278129,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Custom (Windows)",
                  "active": false,
                  "tradeType": "WINDOWS"
                },
                {
                  "id": 278130,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Wood & Plastic (Door)",
                  "active": false,
                  "tradeType": "DOOR"
                },
                {
                  "id": 278131,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Specialty (Door)",
                  "active": false,
                  "tradeType": "DOOR"
                },
                {
                  "id": 278132,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Gutters (With Roof Discount)",
                  "active": false,
                  "tradeType": "GUTTERS"
                },
                {
                  "id": 278133,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Gutters + Toppers (with discount)",
                  "active": false,
                  "tradeType": "GUTTERS"
                },
                {
                  "id": 278125,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T09:01:15Z",
                  "name": "Standard (Fascia)",
                  "active": true,
                  "tradeType": "FASCIA"
                },
                {
                  "id": 278121,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:44Z",
                  "updatedAt": "2020-06-25T09:01:15Z",
                  "name": "GAF Timberline HD (Roof)",
                  "active": true,
                  "tradeType": "ROOF"
                },
                {
                  "id": 278124,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T09:01:44Z",
                  "name": "Gutters",
                  "active": true,
                  "tradeType": "GUTTERS"
                }
              ]
            }
          }
        },
        {
          "id": 228457,
          "createdAt": "2020-06-25T08:52:43Z",
          "updatedAt": "2020-06-25T08:52:45Z",
          "salesOpportunity": {
            "soldEstimateGroupId": "228457",
            "productionList": {
              "id": 6943
            },
            "soldEstimateGroup": {
              "estimates": [
                {
                  "id": 278122,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:44Z",
                  "updatedAt": "2020-06-25T08:52:44Z",
                  "name": "GAF Timberline American Harvest (Roof)",
                  "active": false,
                  "tradeType": "ROOF"
                },
                {
                  "id": 278123,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:44Z",
                  "updatedAt": "2020-06-25T08:52:44Z",
                  "name": "GAF - Grand Sequoia (Roof)",
                  "active": false,
                  "tradeType": "ROOF"
                },
                {
                  "id": 278126,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Standard (Skylights)",
                  "active": false,
                  "tradeType": "SKYLIGHTS"
                },
                {
                  "id": 278127,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Custom (Skylights)",
                  "active": false,
                  "tradeType": "SKYLIGHTS"
                },
                {
                  "id": 278128,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Vinyl (Windows)",
                  "active": false,
                  "tradeType": "WINDOWS"
                },
                {
                  "id": 278129,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Custom (Windows)",
                  "active": false,
                  "tradeType": "WINDOWS"
                },
                {
                  "id": 278130,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Wood & Plastic (Door)",
                  "active": false,
                  "tradeType": "DOOR"
                },
                {
                  "id": 278131,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Specialty (Door)",
                  "active": false,
                  "tradeType": "DOOR"
                },
                {
                  "id": 278132,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Gutters (With Roof Discount)",
                  "active": false,
                  "tradeType": "GUTTERS"
                },
                {
                  "id": 278133,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T08:52:45Z",
                  "name": "Gutters + Toppers (with discount)",
                  "active": false,
                  "tradeType": "GUTTERS"
                },
                {
                  "id": 278125,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T09:01:15Z",
                  "name": "Standard (Fascia)",
                  "active": true,
                  "tradeType": "FASCIA"
                },
                {
                  "id": 278121,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:44Z",
                  "updatedAt": "2020-06-25T09:01:15Z",
                  "name": "GAF Timberline HD (Roof)",
                  "active": true,
                  "tradeType": "ROOF"
                },
                {
                  "id": 278124,
                  "userId": 549941,
                  "createdAt": "2020-06-25T08:52:45Z",
                  "updatedAt": "2020-06-25T09:01:44Z",
                  "name": "Gutters",
                  "active": true,
                  "tradeType": "GUTTERS"
                }
              ]
            }
          }
        }
      ]
    }
  }
}
curl -X POST "https://graph.hover.to/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{"query": "{ estimationEstimateGroups(jobId: \"job_id\") { nodes { id createdAt updatedAt salesOpportunity { soldEstimateGroupId productionList { id } soldEstimateGroup { estimates { id userId createdAt updatedAt name active tradeType } } } } } }"}'

Request:
  Method: POST
  URL: https://graph.hover.to/graphql
  Headers:
    Content-Type: application/json
    Authorization: Bearer YOUR_ACCESS_TOKEN
  Body:
    Type: Raw (JSON)
    Content:
      {
        "query": "{ estimationEstimateGroups(jobId: \"job_id\") { nodes { id createdAt updatedAt salesOpportunity { soldEstimateGroupId productionList { id } soldEstimateGroup { estimates { id userId createdAt updatedAt name active tradeType } } } } } }"
      }