# Fetch Deals Custom Properties

**URL:** <https://community.hubspot.com/t/fetch-deals-custom-properties/52763>\
**Category:** APIs & Integrations\
**Tags:** php, object\
**Created:** [March 8, 2022, 8:48pm UTC](https://community.hubspot.com/t/fetch-deals-custom-properties/52763 "2022-03-08T20:48:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sylvain\_T](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sylvain\_T](https://community.hubspot.com/u/Sylvain_T)\
**Post date:** [March 8, 2022, 8:48pm UTC](https://community.hubspot.com/t/fetch-deals-custom-properties/52763/1 "2022-03-08T20:48:50Z")

</div>

Need to update date thru API but first I’m trying to LOCATE them !  
I managed to find Contacts from his email.  
Then use the associations.contact in Deals to find appropriate Deal, but I can only see/update the basic values : (Amount, name).  
But I need to reach fields our Customer created either by the Group or Properties, but can’t find the way…  
I’m just turning round into Doc…  
Any help would be appreciated.  
Here’s a dump of what I can get, but theres dozens of other fields.

 ![Capture d’écran, le 2022-03-08 à 15.47.10.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/b/be4ea5a86ac2a2b0fc6ff2b49371372b577c8a73.png)

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 9, 2022, 4:40pm UTC](https://community.hubspot.com/t/fetch-deals-custom-properties/52763/2 "2022-03-09T16:40:12Z")

</div>

[@Sylvain\_T](https://community.hubspot.com/t5/user/viewprofilepage/user-id/345098)

Two methods that you can employ to get additional properties.

1. use a query param to your request to specify properties to be returned **&properties=customprop,customprop2**

2. use the [search the crm api](https://developers.hubspot.com/docs/api/crm/search) and add the properties to the json payload. If you have many props that you need, option 2 is your best bet

---

<div class="post-metadata">

**Author:** ![Sylvain\_T](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Sylvain\_T](https://community.hubspot.com/u/Sylvain_T)\
**Post date:** [March 10, 2022, 1:34pm UTC](https://community.hubspot.com/t/fetch-deals-custom-properties/52763/3 "2022-03-10T13:34:18Z")

</div>

Dennis,  
Thank you for your input. It directed me it the right direction. Althought I wasn’t able to test it in PostMan, I’ve managed to figure it out in my code. So foro the benefit of anyone with this issue:

```lia-code-sample
/* Find related contact and custom fields related to a specific contact ID */
/* Using HubSpot PHP API */

public function findDeal($contactId){
 $hubSpot = \HubSpot\Factory::createWithApiKey(MY_API_KEY_HERE);
 $filter = new \HubSpot\Client\Crm\Deals\Model\Filter();
 $filter 
 ->setOperator('EQ')
 ->setPropertyName('associations.contact')
 ->setValue($contactId);

 $filterGroup = new \HubSpot\Client\Crm\Deals\Model\FilterGroup();
 $filterGroup->setFilters([$filter]);

 $searchRequest = new \HubSpot\Client\Crm\Deals\Model\PublicObjectSearchRequest();
 $searchRequest->setFilterGroups([$filterGroup]);
 $searchRequest->setProperties(["name", "amount_in_home_currency", "signature_date__c", "description", "pipeline",]);
 $t = $searchRequest->getProperties();
 return $hubSpot->crm()->deals()->searchApi()->doSearch($searchRequest);
}

```

Hope this piece of code will help other as your input helped me, I’m just paying forward !  
Have a great day.  
Sylvain

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 10, 2022, 9:03pm UTC](https://community.hubspot.com/t/fetch-deals-custom-properties/52763/4 "2022-03-10T21:03:13Z")

</div>

Thanks you for adding your solution. This is how we make the Community the wonderful place that it is!
