This is more of best practice question.
Use case : When an account is changed to a particular status, the account record and its contact record is to be integrated into an external system via REST.
I am thinking of issuing two separate callouts (one for account and one for contact) in my Account "after update" trigger.
This is what I plan to do :
a) Send Account JSON from source.
b) Get Success response JSON from the destination system for a).
c) Upon getting success response, update the External Id on Account record in Source.
d) In the account update trigger whenever External Id is populated, package all the Contact records under the Account and send it as Contact JSON.
e) ...and so on.
Am I on the right path ?.
Is there a better approach to do this i.e account & contact sync ?