View Quotes and Opportunities

This tutorial explains how to use the DealHub API to provide users with access to key dashboards within the CPQ interface: the list of all quotes for a single opportunity and the user's main list of all their opportunities.Unlike the "Create" or "Open" calls that go to a specific quote, these endpoints direct the user to high-level list views, acting as primary entry points from your CRM into DealHub.

Before You Begin

To follow this tutorial, make sure you have:

  • An authenticated dealhub_user_id and a valid one-time access_token. See our Authentication Guide for details.
  • The external_opportunity_id from your CRM (required only for viewing a single opportunity's quotes).

View All Quotes for an Opportunity

Use this process to direct a user from an opportunity record in your CRM to the Opportunity View page in DealHub. This page acts as a dashboard for that specific opportunity, displaying a list of all its related quotes (Draft, Published, Won, etc.) and allowing the user to select any of them to open.

Step 1: Send the API Request

Send a POST request to the /api/v2/quotes endpoint. The payload must contain the dealhub_user_id and the external_opportunity_id of the opportunity you want to view. You can also optionally include the opportunity_info object to sync data updates from your CRM to any Draft quotes.

  • Request Body:
    {
      "dealhub_user_id": "387483488378",
      "external_opportunity_id": "opp_123",
      "opportunity_info": {
        "external_opportunity_name": "Q2 Enterprise Deal - Updated"
      }
    }
    

Step 2: Handle the Response and Redirect

A successful request returns a 200 OK status and a JSON response with a unique url. Redirect the user's browser to this URL to land them on the Opportunity View page.

{
  "url": "[https://service-eu1.dealhub.io/..../](https://service-eu1.dealhub.io/..../)",
  "errors": []
}

View the User's Opportunity List

Use this process to provide a general entry point from your CRM (like a main dashboard or menu) to the user's personal My Opportunities page in DealHub. This page serves as the user's primary dashboard, listing all opportunities they have access to.

Step 1: Send the API Request

Send a POST request to the /api/v1/opportunities endpoint. The payload is simple, only requiring the dealhub_user_id of the user making the request.

  • Request Body:
    {
      "dealhub_user_id": "387483488378"
    }
    

Step 2: Handle the Response and Redirect

Similar to the previous call, a successful request returns a 200 OK status and a JSON response with a unique url. Redirect the user's browser to this URL to take them to their "My Opportunities" list.

{
  "url": "[https://service-eu1.dealhub.io/..../](https://service-eu1.dealhub.io/..../)",
  "errors": []
}

Next Steps

Want to customize your quotes further? Learn how to Work with Custom Fields to add specialized data to your quotes.