Partner Zone

Associating a contact with a company/debtor

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
gwomacks
2 Posts
User

2Posts

0Kudos

0Solutions

Associating a contact with a company/debtor

Heya all,

 

Currently using the MYOB EXO API to create contacts using the api documentation here.
That's working fine.

 

However, I've yet to be able to find a way to associate the contact with a specific company (a debtor, in my case). I tried the fields to set their default company, but that seems to be a different concept.

 

The debtor api docs (here) mentions it's possible to delete an association between a contact and a debtor using a DELETE call. Is it possible to create this association using the EXO API?

Thanks.

4 REPLIES 4
Will_H
MYOB Moderator
2,570 Posts
MYOB Moderator
New Zealand
MYOB Moderator

2,570Posts

1,060Kudos

291Solutions

Re: Associating a contact with a company/debtor

Hi @gwomacks ,

I believe this should be possible by specifying the 

DefaultCompanyId
On an update/create request for a contact, as this _should_ swap the company the contact is assigned to the new one. 
 
Let me know how the above gets on.  I don't have a specific example of this in my postman collection currently.
 
Note: If you want to manage full multi-entity relationship mapping (Which Exo Business can do) then the API does not have that level of smarts, in that case you would need to either set up some kind of database trigger on an extra field, or a custom table with logic (trigger, or stored procedure called somehow) to create the relevant links for you.
 

Cheers,
Will

MYOB Enterprise Services Product Platform Liaison

Exo Education Centre| Forum Search

gwomacks
2 Posts
User

2Posts

0Kudos

0Solutions

Re: Associating a contact with a company/debtor

Thanks Will. As mentioned in the post, I've tried setting the default company, but this seems to be an entirely different concept. For example, after setting the default company, the contact won't show up when listing that debtor's contacts.

Sean_DC
MYOB Moderator
702 Posts
MYOB Moderator
MYOB Moderator

702Posts

44Kudos

48Solutions

Re: Associating a contact with a company/debtor

Hi @gwomacks 


If you still need further help with any API error/integration related queries, we also recommend raising a support request via the following link: https://apisupport.myob.com/hc/en-us/requests/new

 

 

Please feel free to post again. I'm happy to assist further.

 

If my response has answered your enquiry please click "Accept as Solution" to assist other users in finding this information.

 

Cheers,
Sean
Also known @Sean_DC

MYOB Community Forum

Online Help| Forum Search| my.MYOB| Download Page

Did my answer help?

Accept it as a Solution
Leave a to tell others

Will_H
MYOB Moderator
2,570 Posts
MYOB Moderator
New Zealand
MYOB Moderator

2,570Posts

1,060Kudos

291Solutions

Re: Associating a contact with a company/debtor

Hi @gwomacks ,


Please log a case via the link that @Sean_DC  replied with, that will make sure our API support team get you a full response.

 

That said, I was just able to achieve associating contacts by sending a new DefaultCompanyID through using the format:

    "defaultcompanyid": {
        "companytype": 1,
        "accno": 17
    },

Exact packet, using the Motopartz demo data:

{
    "jobtitle": "Sales",
    "firstname": "Phillip",
    "lastname": " Ball",
    "fullname": "Phillip  Ball",
    "directphonenumber": "02 8486 0620",
    "mobilephonenumber": "0405 271 460",
    "email": "digital@benefitz.example.com",
    "postaladdress": {
        "line1": "PO BOX 33-1630",
        "line2": "NORTH SYDNEY",
        "line3": "NSW 2009",
        "line4": null,
        "line5": null
    },
    "postalcode": "",
    "deliveryaddress": {
        "line1": "BENEFITZ ADVERTISING AND GRAPH",
        "line2": "46A ALFREDS RD",
        "line3": "NORTH SYDNEY",
        "line4": "NSW 2009",
        "line5": null,
        "line6": null
    },
    "advertsourceid": 0,
    "active": true,
    "optoutemarketing": false,
    "salespersonid": 0,
    "defaultcompanyid": {
        "companytype": 1,
        "accno": 17
    },
    "extrafields": [],
    "id": 100
}

I sent this to the endpoint: 
ENVIRONMENT/contact/100/

As a PUT request, and it reassociated the contact.  Note the important parts are:

companytype must be specified (1 Debtor, 2 Creditor, 3 Prospect)

accno must be specified.


When using this method, the existing association is removed, so it is not possible to use the API to register a contact simultaneously against multiple accounts at this time.  If this feature was needed I'd talk to the implementation partner about adding a custom endpoint with a trigger so you can add the logic required to suit your client.

Cheers,
Will

MYOB Enterprise Services Product Platform Liaison

Exo Education Centre| Forum Search

Didn't find your answer here?

Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post