Im not sure about api and message server as an out from samba route/trigger.
You could easily trigger from automation as said before.
From your example there you simplest solution would be a script on ticket closing event with remain balance=0 (ie finnished ticket) to generate the json or whatever and post to your api.
Not sure why you want a middleman for this scenario unless looking to create SAS.
Again I sugest you look at my PMS intergration.
It directly syncs sales with the hotel booking system.
Been 3 years and probably 2mil of transactions with only few minor issues usually relating to user errors.