CMS Development

RyanBlack
Member

How do I only show open Deals in a search ?

I would like to only return all deals that are open for an account.

How would I accomplish this using v3 of the deals search ?

0 Upvotes
4 Replies 4
btsp
Contributor

How do I only show open Deals in a search ?

Generally speaking, you need something like this:

    params = { 'hapikey': ... }

    data = {
        'filterGroups': [
            {
                'filters': [
                    { 'propertyName': 'dealstage', 'operator': 'NEQ', 'value': <<<internal ID of closed stage from Deal Properties edit screen>>> },
                ]
            }
        ],
        'properties': <<<your list of property names>>>,
        'limit': 100,
        'after': 0,
    }

    response = requests.post('https://api.hubapi.com/crm/v3/objects/deals/search', params=params, data=json.dumps(data))

    ... pagination loop here ...
dennisedson
HubSpot Product Team
HubSpot Product Team

How do I only show open Deals in a search ?

Hey @RyanBlack ,

You can see all deals with the crm associations endpoint

This endpoint does not give the deal stage, though.  I can see how that would be useful information on this endpoint.  Would be worthy of submitting an idea

If you do submit an idea, add link here so we can upvote!

@btsp , how would you approach this problem?

0 Upvotes
RyanBlack
Member

How do I only show open Deals in a search ?

Any updates on this ?

0 Upvotes
natsumimori
Community Manager
Community Manager

How do I only show open Deals in a search ?

Hi @RyanBlack ,

Thank you for sharing your query in the HubSpot Community.

I wanted to tag in some subject matter experts here: @HenryCipolla and @DanielSanchez , woud you mind sharing your advice for @RyanBlack ?

0 Upvotes