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

MethodPathDescription
GET/dealsList deals
GET/deals/:idGet a deal
POST/dealsCreate a deal
PATCH/deals/:idUpdate a deal
DELETE/deals/:idDelete 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

FieldTypeDescription
idintegerRead-only. Unique ID.
namestringDeal name. Required on create.
amountnumberDeal 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_idintegerCurrency of the deal (a system currency ID).
exchange_ratenumber | nullRate 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_symbolstring | nullDisplay symbol, copied from the currency when currency_id is set.
currency_formatstring | nullDisplay format, e.g. {symbol}{amount}. Copied from the currency.
decimal_placesnumber | nullDisplay decimals. Default 2. Copied from the currency.
thousand_separatorstring | nullDisplay thousands separator. Default ,.
decimal_separatorstring | nullDisplay decimal separator. Default ..
statusstringopen, won or lost.
expected_close_datestring (date-time) | nullExpected close date.
won_datestring (date-time) | nullRead-only. Set to now when status changes to won; cleared otherwise.
lost_datestring (date-time) | nullRead-only. Set to now when status changes to lost; cleared otherwise.
deal_lost_reason_idinteger | nullLost reason from the organization's list of lost reasons. Cleared when status goes back to open.
deal_lost_reasonstring | nullLost reason text. Filled from deal_lost_reason_id when you send it.
organization_idintegerOrganization that owns the deal. Required on create.
pipeline_idintegerDeal pipeline (type: deal). Required on create.
pipeline_stage_idintegerCurrent stage of the pipeline. Required on create.
contact_idinteger | nullContact of the deal. Required on create.
company_idinteger | nullLinked company.
created_by_user_idinteger | nullRead-only. User who created the deal (the API key's user).
owned_by_user_idinteger | nullUser who owns the deal.
custom_fields_by_keyobjectCustom field values keyed by the field key (see Custom fields, entity_type=deal). This is the field you write.
custom_fields_by_nameobjectRead-only. Same values keyed by the field name.
custom_fields_meta_dataarrayRead-only. One entry per value: custom_field_id, custom_field_key, custom_field_name, custom_field_value.
tagsarrayDeal 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_atstring (date-time)Read-only. Creation time.
updated_atstring (date-time)Read-only. Last update time.
deleted_atstring (date-time) | nullRead-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.