---
title: "using-zoho-api-to-save-quote"
description: "Step-by-step guide to creating a Contact, Opportunity, and saving a quote using Zoho CRM and the itsmygroup comparator API."
url: "https://docs.itsmydev.com.au/guides/img-comparator-api/using-zoho-api-to-save-quote"
image: "https://docs.itsmydev.com.au/_og/d/c_Ocean.takumi,title_using-zoho-api-to-save-quote,description_~U3RlcC1ieS1zdGVwIGd1aWRlIHRvIGNyZWF0aW5nIGEgQ29udGFjdCwgT3Bwb3J0dW5pdHksIGFuZCBzYXZpbmcgYSBxdW90ZSB1c2luZyBab2hvIENSTSBhbmQgdGhlIGl0c215Z3JvdXAgY29tcGFyYXRvciBBUEku,props_eyJ0aGVtZSI6eyJtb2RlIjoibGlnaHQiLCJjb2xvcnMiOnsicHJpbWFyeSI6IiM2M0MyOUUifX19,p_Ii9ndWlkZXMvaW1nLWNvbXBhcmF0b3ItYXBpL3VzaW5nLXpvaG8tYXBpLXRvLXNhdmUtcXVvdGUi,s_LpJ-CYXQvMt2zugJ.png"
---

**Important:** The IMG Opportunity ID (CMN\_ID) and Zoho Opportunity ID use different formats.

| ID                  | Format                     | Example            |
| :------------------ | :------------------------- | :----------------- |
| Zoho Opportunity ID | Numeric string             | 109844000013846003 |
| CMN_ID              | Corporate prefix + numeric | MNY32868           |

# Save Quote via Zoho & IMG API

A successful quote save requires four sequential API calls. Each step depends on identifiers returned by the previous one.

| #   | Step                 | Purpose                                                 |
| :-- | :------------------- | :------------------------------------------------------ |
| 1   | Create Contact       | POST to Zoho Contacts — returns a Contact ID            |
| 2   | Create Opportunity   | POST to Zoho Potentials — returns a Zoho Opportunity ID |
| 3   | Retrieve Opportunity | GET the Deal — extracts the CMN_ID                      |
| 4   | Save Quote           | POST to IMG API — saves the selected product quote      |

---

## [Step 1 — Create Contact](#step-1-create-contact)

Create a contact record in Zoho CRM. The `id` returned in the response is the **Contact ID** required for Step 2.

**POST** `https://www.zohoapis.com.au/crm/v8/Contacts`

### [Request Body](#request-body)

```json
{
  "data": [
    {
      "First_Name": "Phurich",
      "Last_Name": "Pusapanich",
      "Email": "phurich@testingmoney.com.au",
      "Mobile": "0412345678",
      "Mailing_State": "VIC"
    }
  ],
  "trigger": ["workflow"]
}
```

### [Response](#response)

```json
{
  "data": [
    {
      "code": "SUCCESS",
      "details": {
        "id": "109844000013872002",
        "Modified_Time": "2026-06-16T11:07:13+10:00",
        "Created_Time": "2026-06-16T11:07:13+10:00"
      },
      "message": "record added",
      "status": "success"
    }
  ]
}
```

> **Note:** Save `details.id` — this is your **Contact ID**. You'll pass it as `Contact_Name.id` in Step 2.

---

## [Step 2 — Create Opportunity](#step-2-create-opportunity)

Create a deal/opportunity in Zoho CRM linked to the contact from Step 1.

**POST** `https://www.zohoapis.com.au/crm/v8/Potentials`

### [Request Body](#request-body-1)

```json
{
  "data": [
    {
      "Deal_Name": "Phurich Pusapanich",
      "Stage": "New",
      "Closing_Date": "2026-12-31",
      "Account_Name": { "name": "Some Account Name" },
      "Contact_Name": { "id": "109844000013872002" },
      "Type": "Single",
      "Has_Health_Insurance": "Y",
      "Product_Type": "Combined",
      "Lead_Status": "New",
      "Channel": "Website"
    }
  ],
  "trigger": ["workflow"]
}
```

### [Response](#response-1)

```json
{
  "data": [
    {
      "code": "SUCCESS",
      "details": {
        "id": "109844000013846003",
        "Modified_Time": "2026-06-16T11:10:39+10:00",
        "Created_Time": "2026-06-16T11:10:39+10:00",
        "$approval_state": "approved"
      },
      "message": "record added",
      "status": "success"
    }
  ]
}
```

> **Note:** Save `details.id` — this is your **Zoho Opportunity ID**. Used in Step 3 (URL path) and Step 4 (`applicant.zoho_id`).

---

## [Step 3 — Retrieve Opportunity (Get CMN\_ID)](#step-3-retrieve-opportunity-get-cmn_id)

Fetch the deal record to extract the **CMN\_ID** (`Opportunity_ID` field), which is required by the Save Quote API.

**GET** `https://www.zohoapis.com.au/crm/v8/Deals/{zoho_opportunity_id}`

### [Example](#example)

```text
GET https://www.zohoapis.com.au/crm/v8/Deals/109844000013846003
```

### [Key Fields in Response](#key-fields-in-response)

| Field           | Example Value      | Notes                  |
| :-------------- | :----------------- | :--------------------- |
| id              | 109844000013846003 | Zoho Opportunity ID    |
| Opportunity_ID  | MNY32868           | CMN_ID ← save this     |
| Deal_Name       | Phurich Pusapanich |                        |
| Stage           | New                |                        |
| Product_Type    | Combined           |                        |
| Contact_Name.id | 109844000013872002 | Contact ID from Step 1 |

> **Note:** `Opportunity_ID` (e.g. `MNY32868`) is your **CMN\_ID**. Store this alongside the Zoho Opportunity ID — both are required for Step 4.

---

## [Step 4 — Save Quote](#step-4-save-quote)

Submit the selected product quote to the itsmygroup comparator API.

**POST** `https://api.itsmydev.com.au/zoho/{zoho_opportunity_id}`

### [Example](#example-1)

```text
POST https://api.itsmydev.com.au/zoho/109844000013846003
```

### [Request Body](#request-body-2)

```json
{
  "applicant": {
    "zoho_id": "109844000013846003",
    "cmn_id": "MNY32868",
    "zoho": {
      "send_email": true,
      "send_sms": true
    },
    "personal": {
      "dob": "1959-04-17"
    },
    "partner": {
      "dob": "1968-04-20"
    },
    "policy": {
      "federal_rebate": true,
      "rebate_tier": 2,
      "membership_type": 1,
      "cover_type": 2
    },
    "payment": {
      "frequency": 2
    },
    "number_of_dependants": 0
  },
  "type": "send_to_zoho",
  "is_quote": true,
  "direct_debit_discount": false,
  "product": {
    "id": "4462317"
  }
}
```

### [Field Reference](#field-reference)

| Field                  | Source             | Description                                                  |
| :--------------------- | :----------------- | :----------------------------------------------------------- |
| applicant.zoho_id      | Step 2             | Zoho Opportunity ID from Potentials response                 |
| applicant.cmn_id       | Step 3             | CMN_ID (Opportunity_ID field from Deals response)            |
| personal.dob           | User input         | Applicant date of birth — format YYYY-MM-DD                  |
| partner.dob            | User input         | Partner date of birth — omit if single policy                |
| policy.rebate_tier     | User input         | Government rebate tier 0–3                                   |
| policy.membership_type | User input         | 1 Single · 2 Family · 3 Couple · 4 Single Parent             |
| policy.cover_type      | User input         | 1 Hospital · 2 Combined · 3 Extras                           |
| payment.frequency      | User input         | 1 Annual · 2 Monthly · 3 Fortnightly · 4 Weekly              |
| product.id             | Package Search API | Product ID — must match a product assigned to your corporate |

> **Note:** `product.id` must be the ID of a product assigned to your corporate in the itsmygroup system. Use the Package Search API to compare products and retrieve valid IDs before calling this endpoint.

---

## [Save Quote — Response & Links](#save-quote-response-links)

A successful call returns a `quote_details` object with three links and an `application_domains` map.

### [Response](#response-2)

```json
{
  "quote_details": {
    "quote_link": "https://money-quote-staging.itsmydev.com.au/Hf3ivt6zLMLxc2VPuOC/4462317",
    "application_link": "https://hif-application-staging.itsmydev.com.au/Hf3ivt6zLMLxc2VPuOC/4462317",
    "public_application_link": "https://hif-public-application-staging.itsmydev.com.au/Hf3ivt6zLMLxc2VPuOC/4462317"
  },
  "application_domains": {
    "public": "https://hif-public-application-staging.itsmydev.com.au",
    "agent": "https://hif-application-staging.itsmydev.com.au"
  }
}
```

### [Link Reference](#link-reference)

| Field                   | Audience | Description                                                                      |
| :---------------------- | :------- | :------------------------------------------------------------------------------- |
| quote_link              | Agent    | Shareable quote summary with product details and pricing. Send to the customer to review their quote. |
| application_link        | Agent    | Internal agent-facing application URL. Use when an agent is completing the application on behalf of the customer. |
| public_application_link | Customer | Public-facing application URL. Use this when directing a customer to complete the application themselves. |

> **Important:** Always use `public_application_link` when sending a customer directly to apply. This is the public-facing domain designed for end customers — not the internal agent portal.

---

## [Key IDs — Quick Reference](#key-ids-quick-reference)

| ID                  | Example Value      | Obtained From                                   |
| :------------------ | :----------------- | :---------------------------------------------- |
| Contact ID          | 109844000013872002 | Step 1 — POST /Contacts response                |
| Zoho Opportunity ID | 109844000013846003 | Step 2 — POST /Potentials response              |
| CMN_ID              | MNY32868           | Step 3 — GET /Deals/{id} → Opportunity_ID field |
| Product ID          | 4462317            | Package Search API                              |