# Generating records linked with data in another system

**URL:** <https://community.hubspot.com/t/generating-records-linked-with-data-in-another-system/120793>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [November 19, 2024, 3:58am UTC](https://community.hubspot.com/t/generating-records-linked-with-data-in-another-system/120793 "2024-11-19T03:58:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ELove](https://avatars.discourse-cdn.com/v4/letter/e/3da27b/32.png) [@ELove](https://community.hubspot.com/u/ELove)\
**Post date:** [November 19, 2024, 3:58am UTC](https://community.hubspot.com/t/generating-records-linked-with-data-in-another-system/120793/1 "2024-11-19T03:58:04Z")

</div>

I’m working on a large software system (“Teems”) that has basic CRM functionality. One of our clients is going to use HubSpot alongside our system, so we need to create Contacts and Companies corresponding to Teems contact records, have Contacts and Companies associated with each other, and for HubSpot records to be updated when Teems records change (not the other way, because they will only add/edit contacts in Teems). I’ve tried a few different approaches with this and been stuck at a few points.

Has anyone else does this kind of thing? How to link the records together - HubSpot record stores the Teems ID, Teems records store HubSpot ID, or both?

When I used batch create (without sending Teems IDs and intending to save the returned HubSpot IDs ion Teems records), the IDs returned did not reflect the order of the data I sent in, so it made an extra step to match the records up.

When instead I used Teems ID as a unique custom field and created Contacts using batch upsert, which returns object data rather than just IDs, the objects sometimes included the Teems ID (along with the ordinary properties) and sometimes not!

I’ve been able to use idProperty to update a Company/Contact record, but not to create an association. Can you use idProperty when creating associations between objects?

I’m using PHP, but using apiRequest() rather than the PHP wrapper classes. I’m not at a dead end and could probably keep muddling through, but thought I’d see if anyone has advice of any of these things.

---

<div class="post-metadata">

**Author:** ![Bhupendra\_Kumar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bhupendra_kumar/32/67536_2.png) [@Bhupendra\_Kumar](https://community.hubspot.com/u/Bhupendra_Kumar)\
**Post date:** [November 19, 2024, 5:08am UTC](https://community.hubspot.com/t/generating-records-linked-with-data-in-another-system/120793/2 "2024-11-19T05:08:16Z")

</div>

Hi @ELove ,

I already done something like that , what i did is first create the contact and company using the create api’s from my third party CRM and then link them using the associations api .

**To create contact :**

[Create Contact](https://developers.hubspot.com/beta-docs/reference/api/crm/objects/contacts#post-%2Fcrm%2Fv3%2Fobjects%2Fcontacts)

**To create company :**

[Create Company](https://developers.hubspot.com/beta-docs/reference/api/crm/objects/companies#post-%2Fcrm%2Fv3%2Fobjects%2Fcompanies)

**Associate or Link company and contact :**

[Associate Company With Contact](https://developers.hubspot.com/beta-docs/reference/api/crm/associations/association-details#put-%2Fcrm%2Fv4%2Fobjects%2F%7Bobjecttype%7D%2F%7Bobjectid%7D%2Fassociations%2F%7Btoobjecttype%7D%2F%7Btoobjectid%7D)

✔ Hope my answer helped you . If yes help community by markting it as a solution

---

<div class="post-metadata">

**Author:** ![DaceWills](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@DaceWills](https://community.hubspot.com/u/DaceWills)\
**Post date:** [November 19, 2024, 7:47am UTC](https://community.hubspot.com/t/generating-records-linked-with-data-in-another-system/120793/3 "2024-11-19T07:47:28Z")

</div>

[**DDD**](https://dddcodigo.com.br/) @Right Now Use HubSpot’s API to sync Teems contact and company changes, creating or updating records in HubSpot as needed.
