in ZOHO CRM when an enquiry stage is moved to WON then I have created a rule to trigger POST URL to thrid party AP and then create a function for mapping with below code
void automation.kytesfunctions(String enquiryId)
{
// Fetch enquiry details
enquiryId = input.enquiryId.toLong();
enquiry = zoho.crm.getRecordById("Enquiries", enquiryId);
// Prepare data
data = map();
data.put("enquiryname", enquiry.get("enquiryname"));
data.put("projectno", enquiry.get("ProjectNo"));
data.put("closingdate", enquiry.get("Closing Date"));
data.put("stage", enquiry.get("stage"));
data.put("businesssegment", enquiry.get("Business Segment"));
data.put("region", enquiry.get("region"));
data.put("planner", enquiry.get("enquiryowner"));
data.put("description", enquiry.get("description"));
// API headers
headers = map();
headers.put("Authorization", "Bearer 1000.xxxxx526390xxxxxxxx00bec7a");
headers.put("Content-Type", "application/json");
// API call
jsonData = data.toString();