Skip to main content

Deal API

API Endpoints

OperationMethodEndpoint
Create DealPOSThttps://crm.twozo.io/rest/api/v1/deal
Get DealGEThttps://crm.twozo.io/rest/api/v1/deal/{id}
Update DealPUT / PATCHhttps://crm.twozo.io/rest/api/v1/deal/{id}
Delete DealDELETEhttps://crm.twozo.io/rest/api/v1/deal/{id}
List DealsGEThttps://crm.twozo.io/rest/api/v1/deal/view/list?filter=title:like(w)&sort=title:asc
Dropdown ValuesGEThttps://crm.twozo.io/rest/api/v1/field/dropdown?name={INTERNAL_NAME}
Field ListGEThttps://crm.twozo.io/rest/api/v1/field/list?source=deal

List API

GET

GET https://crm.twozo.io/rest/api/v1/deal/view/list?filter={internalname}:like(w)&sort={internalname}:asc

Example

GET https://crm.twozo.io/rest/api/v1/deal/view/list?filter=title:like(w)&sort=title:asc

Pagination Parameters

ParameterDescriptionExample
pagePage numberpage=1
pageSizeNumber of records per pagepageSize=25

Filter Parameters

Format

filter=<field>:<operator>(<value>)

Supported Filter Operators

OperatorMeaningExample RequestEquivalent Condition
eqEqualsfilter=status:eq(active)status = 'active'
neqNot Equalsfilter=status:neq(archived)status != 'archived'
inIn Listfilter=status:in(active,pending)status IN ('active','pending')
ninNot In Listfilter=status:nin(deleted,archived)status NOT IN ('deleted','archived')
ltLess Thanfilter=amount:lt(500)amount < 500
lteLess Than or Equalfilter=amount:lte(1000)amount <= 1000
gtGreater Thanfilter=amount:gt(100)amount > 100
gteGreater Than or Equalfilter=amount:gte(250)amount >= 250
betweenRangefilter=createdAt:between(1771936945416,1771936947532)createdAt BETWEEN value1 AND value2
likeContains Textfilter=name:like(john)name LIKE '%john%'

Filter Examples

&filter=status:eq(active)
&filter=status:neq(archived)
&filter=status:in(active,pending)
&filter=status:nin(deleted,archived)
&filter=amount:lt(500)
&filter=amount:lte(1000)
&filter=amount:gt(100)
&filter=amount:gte(250)
&filter=createdAt:between(1771936945416,1771936947532)
&filter=name:like(john)
&filter=deletedAt:isnull(true)
&filter=deletedAt:notnull(true)
&filter=metadata.notes:exists(true)

Sort Parameters

Format

sort=<field>:<direction>

Multiple sort fields can be separated by commas.

Supported Sort Directions

DirectionMeaning
ascAscending Order
descDescending Order

Sort Examples

RequestDescription
sort=createdAt:descSort by created date in descending order
sort=name:ascSort by name in ascending order
sort=createdAt:desc,name:ascSort by created date descending, then by name ascending

Example

&sort=createdAt:desc,name:asc

FieldList

GET: https://crm.twozo.io/rest/api/v1/field/list?source=deal

FieldList Response

{
  "code": 0,
  "data": {
    "source": {
      "is_enabled": true,
      "name": "Deal",
      "id": 103
    },
    "fields": [
      [
        {
          "internal_name": "title",
          "is_active": true,
          "source_id": 103,
          "id": 181,
          "type": "SINGLE_STRING",
          "config": {
            "min_length": 1,
            "max_length": 255
          },
          "field_name": "Title"
        }
      ],
      [
        {
          "internal_name": "pipeline",
          "is_active": true,
          "source_id": 103,
          "id": 182,
          "type": "DROPDOWN",
          "config": {},
          "field_name": "Pipeline"
        },
        {
          "internal_name": "pipeline_stage",
          "is_active": true,
          "source_id": 103,
          "id": 183,
          "type": "DROPDOWN",
          "config": {},
          "field_name": "Stage"
        },
        {
          "internal_name": "won_reason",
          "is_active": true,
          "options": [
            {
              "name": "Product feature",
              "id": 9218960
            },
            {
              "name": "Price",
              "id": 9218961
            },
            {
              "name": "Timing",
              "id": 9218962
            },
            {
              "name": "Others",
              "id": 9218963
            }
          ],
          "source_id": 103,
          "id": 184,
          "type": "DROPDOWN",
          "config": {},
          "field_name": "Won Reason"
        },
        {
          "internal_name": "lost_reason",
          "is_active": true,
          "options": [
            {
              "name": "Opted our rival",
              "id": 9218948
            },
            {
              "name": "Price is too high",
              "id": 9218949
            },
            {
              "name": "Junk Lead",
              "id": 9218950
            },
            {
              "name": "Not interested",
              "id": 9218951
            },
            {
              "name": "No Requirement",
              "id": 9218952
            },
            {
              "name": "Need only in future",
              "id": 9218953
            },
            {
              "name": "Product not satisfying",
              "id": 9218954
            },
            {
              "name": "No proper follow-up",
              "id": 9218955
            },
            {
              "name": "Appointment Missed",
              "id": 9218956
            }
          ],
          "source_id": 103,
          "id": 185,
          "type": "DROPDOWN",
          "config": {},
          "field_name": "Lost Reason"
        },
        {
          "internal_name": "deal_closed_on",
          "is_active": true,
          "source_id": 103,
          "id": 186,
          "type": "DATE",
          "config": {},
          "field_name": "Deal Closed On"
        }
      ],
      [
        {
          "internal_name": "primary_contact",
          "is_active": true,
          "related_field": {
            "id": 101,
            "source": "Contact"
          },
          "source_id": 103,
          "id": 187,
          "type": "CONTACT_ONBOARD",
          "config": {},
          "field_name": "Primary Contact"
        }
      ],
      [
        {
          "internal_name": "related_contacts",
          "is_active": true,
          "related_field": {
            "id": 101,
            "source": "Contact"
          },
          "source_id": 103,
          "id": 188,
          "type": "CONTACTS_ONBOARD",
          "config": {},
          "field_name": "Related Contacts"
        }
      ],
      [
        {
          "internal_name": "company",
          "is_active": true,
          "related_field": {
            "id": 144,
            "source": "Company"
          },
          "source_id": 103,
          "id": 189,
          "type": "COMPANY_ONBOARD",
          "config": {},
          "field_name": "Company"
        }
      ],
      [
        {
          "internal_name": "deal_value",
          "is_active": true,
          "sub_fields": [
            {
              "name": "CURRENCY",
              "input_type": "DROPDOWN",
              "id": 26,
              "type": "DEAL_VALUE",
              "display_name": "Currency",
              "config": {
                "dropdown": "currencyList"
              }
            },
            {
              "name": "VALUE",
              "input_type": "SINGLE_NUMBER",
              "id": 27,
              "type": "DEAL_VALUE",
              "display_name": "Price",
              "config": {
                "isWholeNumber": false
              }
            },
            {
              "name": "PRODUCT",
              "input_type": "PRODUCT",
              "id": 28,
              "type": "DEAL_VALUE",
              "display_name": "Products"
            }
          ],
          "related_field": {
            "id": 228,
            "source": "Product"
          },
          "source_id": 103,
          "id": 190,
          "type": "DEAL_VALUE",
          "config": {
            "min": 0,
            "max": 9999999999999
          },
          "field_name": "Deal Value"
        }
      ],
      [
        {
          "internal_name": "sales_owner",
          "is_active": true,
          "source_id": 103,
          "id": 191,
          "type": "OWNER",
          "config": {},
          "field_name": "Sales Owner"
        }
      ],
      [
        {
          "internal_name": "product_quantity",
          "is_active": true,
          "source_id": 103,
          "id": 192,
          "type": "PRODUCT",
          "config": {},
          "field_name": "Product Quantity"
        }
      ],
      [
        {
          "internal_name": "expected_close_date",
          "is_active": true,
          "source_id": 103,
          "id": 193,
          "type": "DATE",
          "config": {},
          "field_name": "Expected Close Date"
        }
      ],
      [
        {
          "internal_name": "source",
          "is_active": true,
          "options": [
            {
              "name": "Web",
              "id": 9218964
            },
            {
              "name": "Organic Search",
              "id": 9218965
            },
            {
              "name": "Email",
              "id": 9218966
            },
            {
              "name": "Phone",
              "id": 9218967
            },
            {
              "name": "Chat",
              "id": 9218968
            },
            {
              "name": "Web Form",
              "id": 9218969
            },
            {
              "name": "Referral",
              "id": 9218970
            },
            {
              "name": "Direct",
              "id": 9218971
            },
            {
              "name": "Paid Search",
              "id": 9218972
            },
            {
              "name": "Blogs",
              "id": 9218973
            },
            {
              "name": "Social Media",
              "id": 9218974
            },
            {
              "name": "Display Ads",
              "id": 9218975
            },
            {
              "name": "Events",
              "id": 9218976
            },
            {
              "name": "Webinar",
              "id": 9218977
            }
          ],
          "source_id": 103,
          "id": 194,
          "type": "DROPDOWN",
          "config": {},
          "field_name": "Source"
        }
      ],
      [
        {
          "internal_name": "tags",
          "is_active": true,
          "source_id": 103,
          "id": 195,
          "type": "TAGS",
          "config": {
            "max_limit": 10,
            "max_length": 255
          },
          "field_name": "Tags"
        }
      ],
      [
        {
          "internal_name": "territory",
          "is_active": true,
          "source_id": 103,
          "id": 196,
          "type": "TERRITORY",
          "config": {},
          "field_name": "Territory"
        }
      ],
      [
        {
          "internal_name": "id",
          "is_active": true,
          "source_id": 103,
          "id": 197,
          "type": "SINGLE_NUMBER",
          "config": {},
          "field_name": "ID"
        }
      ],
      [
        {
          "internal_name": "rotting_days",
          "is_active": true,
          "source_id": 103,
          "id": 198,
          "type": "SINGLE_NUMBER",
          "config": {},
          "field_name": "Rotting Days"
        }
      ],
      [
        {
          "internal_name": "age",
          "is_active": true,
          "source_id": 103,
          "id": 199,
          "type": "SINGLE_NUMBER",
          "config": {},
          "field_name": "Age"
        }
      ],
      [
        {
          "internal_name": "won_time",
          "is_active": true,
          "source_id": 103,
          "id": 200,
          "type": "DATE_TIME",
          "config": {},
          "field_name": "Won Time"
        }
      ],
      [
        {
          "internal_name": "lost_time",
          "is_active": true,
          "source_id": 103,
          "id": 201,
          "type": "DATE_TIME",
          "config": {},
          "field_name": "Lost Time"
        }
      ],
      [
        {
          "internal_name": "stage_probability",
          "is_active": true,
          "source_id": 103,
          "id": 202,
          "type": "SINGLE_NUMBER",
          "config": {},
          "field_name": "Stage Probability"
        }
      ],
      [
        {
          "internal_name": "weighted_value",
          "is_active": true,
          "sub_fields": [
            {
              "name": "CURRENCY",
              "input_type": "DROPDOWN",
              "id": 6,
              "type": "MONETARY",
              "display_name": "Currency",
              "config": {
                "dropdown": "currencyList"
              }
            },
            {
              "name": "VALUE",
              "input_type": "SINGLE_NUMBER",
              "id": 7,
              "type": "MONETARY",
              "display_name": "Price",
              "config": {
                "isWholeNumber": false,
                "default": 0.0
              }
            }
          ],
          "source_id": 103,
          "id": 203,
          "type": "MONETARY",
          "config": {},
          "field_name": "Weighted value"
        }
      ],
      [
        {
          "internal_name": "expected_deal_value",
          "is_active": true,
          "sub_fields": [
            {
              "name": "CURRENCY",
              "input_type": "DROPDOWN",
              "id": 6,
              "type": "MONETARY",
              "display_name": "Currency",
              "config": {
                "dropdown": "currencyList"
              }
            },
            {
              "name": "VALUE",
              "input_type": "SINGLE_NUMBER",
              "id": 7,
              "type": "MONETARY",
              "display_name": "Price",
              "config": {
                "isWholeNumber": false,
                "default": 0.0
              }
            }
          ],
          "source_id": 103,
          "id": 204,
          "type": "MONETARY",
          "config": {},
          "field_name": "Expected Deal Value"
        }
      ],
      [
        {
          "internal_name": "product_amount",
          "is_active": true,
          "sub_fields": [
            {
              "name": "CURRENCY",
              "input_type": "DROPDOWN",
              "id": 6,
              "type": "MONETARY",
              "display_name": "Currency",
              "config": {
                "dropdown": "currencyList"
              }
            },
            {
              "name": "VALUE",
              "input_type": "SINGLE_NUMBER",
              "id": 7,
              "type": "MONETARY",
              "display_name": "Price",
              "config": {
                "isWholeNumber": false,
                "default": 0.0
              }
            }
          ],
          "source_id": 103,
          "id": 227,
          "type": "MONETARY",
          "config": {},
          "field_name": "Product Amount"
        }
      ],
      [
        {
          "internal_name": "description",
          "is_active": true,
          "source_id": 103,
          "id": 205,
          "type": "SINGLE_STRING",
          "config": {
            "min_length": 1,
            "max_length": 255
          },
          "field_name": "Description"
        }
      ],
      [
        {
          "internal_name": "type",
          "is_active": true,
          "options": [
            {
              "name": "New Business",
              "id": 9218957
            },
            {
              "name": "Existing Business - Renewal",
              "id": 9218958
            },
            {
              "name": "Existing Business - Upgrade",
              "id": 9218959
            }
          ],
          "source_id": 103,
          "id": 206,
          "type": "DROPDOWN",
          "config": {},
          "field_name": "Type"
        }
      ],
      [
        {
          "internal_name": "payment_status",
          "is_active": true,
          "options": [
            {
              "name": "Online",
              "id": 9218978
            },
            {
              "name": "Offline",
              "id": 9218979
            }
          ],
          "source_id": 103,
          "id": 207,
          "type": "DROPDOWN",
          "config": {},
          "field_name": "Payment Status"
        }
      ],
      [
        {
          "internal_name": "status",
          "is_active": true,
          "source_id": 103,
          "id": 208,
          "type": "DROPDOWN",
          "config": {
            "max_length": 255
          },
          "field_name": "Status"
        }
      ],
      [
        {
          "internal_name": "deal_stage_updated_at",
          "is_active": true,
          "source_id": 103,
          "id": 209,
          "type": "DATE_TIME",
          "config": {},
          "field_name": "Deal Stage Updated At"
        }
      ],
      [
        {
          "internal_name": "web_forms",
          "is_active": true,
          "source_id": 103,
          "id": 210,
          "type": "SINGLE_STRING",
          "config": {
            "max_length": 255
          },
          "field_name": "Web Form"
        }
      ],
      [
        {
          "internal_name": "created_by",
          "is_active": true,
          "source_id": 103,
          "id": 211,
          "type": "OWNER",
          "config": {},
          "field_name": "Created By"
        }
      ],
      [
        {
          "internal_name": "created_at",
          "is_active": true,
          "source_id": 103,
          "id": 212,
          "type": "DATE_TIME",
          "config": {},
          "field_name": "Created At"
        }
      ],
      [
        {
          "internal_name": "updated_by",
          "is_active": true,
          "source_id": 103,
          "id": 213,
          "type": "OWNER",
          "config": {},
          "field_name": "Updated By"
        }
      ],
      [
        {
          "internal_name": "updated_at",
          "is_active": true,
          "source_id": 103,
          "id": 214,
          "type": "DATE_TIME",
          "config": {},
          "field_name": "Updated At"
        }
      ],
      [
        {
          "internal_name": "recent_note",
          "is_active": true,
          "source_id": 103,
          "id": 225,
          "type": "TEXT",
          "config": {},
          "field_name": "Recent Note"
        }
      ],
      [
        {
          "internal_name": "last_assigned_at",
          "is_active": true,
          "source_id": 103,
          "id": 226,
          "type": "DATE_TIME",
          "config": {},
          "field_name": "Last Assigned At"
        }
      ],
      [
        {
          "internal_name": "last_activity_date",
          "is_active": true,
          "source_id": 103,
          "id": 215,
          "type": "DATE",
          "config": {},
          "field_name": "Last Activity Date"
        }
      ],
      [
        {
          "internal_name": "next_activity_date",
          "is_active": true,
          "source_id": 103,
          "id": 216,
          "type": "DATE",
          "config": {},
          "field_name": "Next Activity Date"
        }
      ],
      [
        {
          "internal_name": "last_activity_type",
          "is_active": true,
          "source_id": 103,
          "id": 217,
          "type": "SINGLE_STRING",
          "config": {},
          "field_name": "Last Activity Type"
        }
      ],
      [
        {
          "internal_name": "done_activities",
          "is_active": true,
          "source_id": 103,
          "id": 218,
          "type": "SINGLE_NUMBER",
          "config": {},
          "field_name": "Done Activities"
        }
      ],
      [
        {
          "internal_name": "upcoming_activities",
          "is_active": true,
          "source_id": 103,
          "id": 219,
          "type": "SINGLE_NUMBER",
          "config": {},
          "field_name": "Upcoming Activities"
        }
      ],
      [
        {
          "internal_name": "total_activities",
          "is_active": true,
          "source_id": 103,
          "id": 220,
          "type": "SINGLE_NUMBER",
          "config": {},
          "field_name": "Total Activities"
        }
      ],
      [
        {
          "internal_name": "deal_value_in_base_currency",
          "is_active": true,
          "sub_fields": [
            {
              "name": "CURRENCY",
              "input_type": "DROPDOWN",
              "id": 6,
              "type": "MONETARY",
              "display_name": "Currency",
              "config": {
                "dropdown": "currencyList"
              }
            },
            {
              "name": "VALUE",
              "input_type": "SINGLE_NUMBER",
              "id": 7,
              "type": "MONETARY",
              "display_name": "Price",
              "config": {
                "isWholeNumber": false,
                "default": 0.0
              }
            }
          ],
          "source_id": 103,
          "id": 224,
          "type": "MONETARY",
          "config": {},
          "field_name": "Deal Value In Base Currency"
        }
      ],
      [
        {
          "internal_name": "last_email_received",
          "is_active": true,
          "source_id": 103,
          "id": 221,
          "type": "DATE_TIME",
          "config": {},
          "field_name": "Last Email Received"
        }
      ],
      [
        {
          "internal_name": "email_message_count",
          "is_active": true,
          "source_id": 103,
          "id": 222,
          "type": "SINGLE_NUMBER",
          "config": {},
          "field_name": "Email Messages Count"
        }
      ],
      [
        {
          "internal_name": "last_email_sent",
          "is_active": true,
          "source_id": 103,
          "id": 223,
          "type": "DATE_TIME",
          "config": {},
          "field_name": "Last Email Sent"
        }
      ],
      [
        {
          "internal_name": "forecast_category",
          "is_active": true,
          "source_id": 103,
          "id": 93001,
          "type": "DROPDOWN",
          "config": {},
          "field_name": "Forecast Category"
        }
      ],
      [
        {
          "internal_name": "cf_custom_date_field",
          "is_active": true,
          "source_id": 103,
          "id": 119769,
          "type": "DATE",
          "config": {},
          "field_name": "custom date field"
        }
      ]
    ]
  }
}

Deal Fields

FieldTypeRequiredDescription
titlestringRequiredName/title of the deal.

Example: "demo purpose10"
pipelinenumberRequiredID of the pipeline the deal belongs to.

Example: 70401General
pipeline_stagenumberRequiredID of the current stage within the pipeline.

Example: 109753New
primary_contactnumber / objectRequiredExisting Contact: Provide the Contact ID to associate an existing contact with the deal.

Example: 1174909

New Contact: If the contact does not already exist, provide the Create Contact API request payload. The system will create the contact and automatically associate it with the deal.
related_contactsnumber / objectOptionalExisting Contact: Provide the Contact ID.

Example: 1174909

New Contact: Provide the Create Contact API request payload. The system will create the contact and associate it with the deal.
sales_ownernumberRequiredID of the user assigned as the deal owner.

Example: 71201
companynumber / objectOptionalExisting Company: Provide the Company ID.

Example: 120783

New Company: Provide the Create Company API request payload. The system will create the company and associate it with the deal.
deal_valueobjectOptionalMonetary value of the deal.
weighted_valueobjectRead-onlyDeal value weighted by the pipeline stage probability.
expected_deal_valueobjectOptionalForecasted value of the deal.
product_amountobjectRead-onlyTotal value contributed by attached products.
sourcenumber or stringOptionalID or name representing the deal source.

Example: 10321825, Web
territorynumberOptionalID of the sales territory.

Example: 63064
tagsarray<number>OptionalList of tag IDs assigned to the deal.

Example: [65316]
descriptionstringOptionalFree-text notes about the deal.

Example: "demo purpose"
typenumber or stringOptionalID or name representing the deal type.

Example: 10322557, New Business
payment_statusnumber or stringOptionalID or name representing the payment status.

Example: 10322558, Online

Nested Object — deal_value / weighted_value / expected_deal_value / product_amount

All four monetary fields share the same shape on write.

FieldTypeRequiredDescription
currencynumber / code / nameRequiredID, code, or name of the currency.

Example: 3, US, United States.
See Dropdown Option List - Overview.

Mandatory Fields

The following fields are required when creating a deal:

  • Deal Title
  • Primary Contact
  • Pipeline
  • Stage
  • Sales Owner

Dependent Fields

Pipeline Stage → Won/Lost Reason and Closed On

  • When the Deal Stage is set to Won, the corresponding Won Reason and Closed On fields must be provided.

  • When the Deal Stage is set to Lost, the corresponding Lost Reason and Closed On fields must be provided.

  • The deal cannot be saved or updated until the required reason and Closed On value are provided.

Forecast Category → Expected Close Date

  • When a Forecast Category is selected, the Expected Close Date must be provided. Any system or custom field marked as Required in Modules & Fields must be included in the request. Any field configured with a Default Value under Modules & Fields will be automatically populated if it is not included in the request.

Additional Notes

Dropdown field types - All the deal dropdown field options should be fetched from the API call as it is dynamic dropdown.

Custom Field Data Structure

{  
"cf_custom_text_field": "custom text",
"cf_custom_large_txt_field": "sdkfj",
"cf_custom_number_field": 10,
"cf_custom_dropdown_field": 10413746,
"cf_custom_multiselect_field": [
10413746,
10413747
],
"cf_custom_owner_field": 71591,
"cf_custom_company_field": 121728,
"cf_custom_contact_field": 1186422,
"cf_custom_monetory_field": {
"currency": 1,
"value": 1.2345678901234568E12
},
"cf_custom_phone_field": [
{
"phone_type": 1,
"phone_number": "10101010101010101"
}
],
"cf_custom_email_field": [
{
"email_type": 2,
"email_value": "sss@hvu.in"
}
],
"cf_custom_time_field": "2025-05-15T10:15:30",
"cf_custom_date_field": "2026-07-01T12:55:00",
"cf_custom_date_range_field": {
"range": {
"from": "2026-07-01T12:55:00+05:30",
"to": "2026-07-02T12:50:00+05:30"
}
},
"cf_custom_date_time_range_field": {
"range": {
"from": "2026-07-01T12:55:00Z",
"to": "2026-07-02T12:50:00Z"
}
}
}