Deals
A deal is a sales opportunity that moves through the stages of a deal pipeline. Each deal belongs to a contact, can be linked to a company, has an amount in a currency, and is open, won or lost.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /deals | List deals |
GET | /deals/:id | Get a deal |
POST | /deals | Create a deal |
PATCH | /deals/:id | Update a deal |
DELETE | /deals/:id | Delete a deal |
Reads are limited to your API key's organization. Pass organization_id as a filter to work with one organization. Creating a deal in, or moving it to, a private pipeline requires the key's user to have access to that pipeline.
The deal object
json
amount and exchange_rate are decimal columns and are returned as strings.
Fields
| Field | Type | Description |
|---|---|---|
id | integer | Read-only. Unique ID. |
name | string | Deal name. Required on create. |
amount | number | Deal value. Default 0. Recalculated automatically as the sum of total_amount_with_tax of the deal's deal products whenever one is added, changed or removed. |
currency_id | integer | Currency of the deal (a system currency ID). |
exchange_rate | number | null | Rate from the deal currency to the organization's base currency. Calculated when currency_id is set or changed, unless you send it. 1 when the currency is the base currency. |
currency_symbol | string | null | Display symbol, copied from the currency when currency_id is set. |
currency_format | string | null | Display format, e.g. {symbol}{amount}. Copied from the currency. |
decimal_places | number | null | Display decimals. Default 2. Copied from the currency. |
thousand_separator | string | null | Display thousands separator. Default ,. |
decimal_separator | string | null | Display decimal separator. Default .. |
status | string | open, won or lost. |
expected_close_date | string (date-time) | null | Expected close date. |
won_date | string (date-time) | null | Read-only. Set to now when status changes to won; cleared otherwise. |
lost_date | string (date-time) | null | Read-only. Set to now when status changes to lost; cleared otherwise. |
deal_lost_reason_id | integer | null | Lost reason from the organization's list of lost reasons. Cleared when status goes back to open. |
deal_lost_reason | string | null | Lost reason text. Filled from deal_lost_reason_id when you send it. |
organization_id | integer | Organization that owns the deal. Required on create. |
pipeline_id | integer | Deal pipeline (type: deal). Required on create. |
pipeline_stage_id | integer | Current stage of the pipeline. Required on create. |
contact_id | integer | null | Contact of the deal. Required on create. |
company_id | integer | null | Linked company. |
created_by_user_id | integer | null | Read-only. User who created the deal (the API key's user). |
owned_by_user_id | integer | null | User who owns the deal. |
custom_fields_by_key | object | Custom field values keyed by the field key (see Custom fields, entity_type=deal). This is the field you write. |
custom_fields_by_name | object | Read-only. Same values keyed by the field name. |
custom_fields_meta_data | array | Read-only. One entry per value: custom_field_id, custom_field_key, custom_field_name, custom_field_value. |
tags | array | Deal tags as { id, name, color }. Only id matters on write: tags are matched against the organization's deal tags and unknown IDs are dropped. |
created_at | string (date-time) | Read-only. Creation time. |
updated_at | string (date-time) | Read-only. Last update time. |
deleted_at | string (date-time) | null | Read-only. Set when the deal is deleted. |
Embedded data
Pass fastJoinForDealsList=true on list or get (update responses always include it) to embed: company, contact, owner, createdBy, pipeline, pipelineStage, currency, dealProducts, stageHistory, conversation (the contact's most recent conversation), activities (pending activities) and watchers. includeDealActivities=false and includeDealWatchers=false leave out activities and watchers; includeDealActivitySummary=true adds activitySummary.
Related
Report an issue with this documentation
Please log in to report issues with our documentation.