CRM

Create a deal

Opens a trattativa on an existing customer: a title, the anagrafica, a figure and the date it is expected to close — both party_id and expected_close_date are required, because an opportunity without either is one the forecast cannot add up. It refuses to file an unqualified enquiry (that is crm_create_lead) and it cannot move or close the deal it creates (that is crm_advance_deal). It appears in the pipeline immediately, so confirm the details with the user first.

post/api/v1/rest/crm/deals

Request

  • Base URL: https://api.custodo.ai
  • URL: https://api.custodo.ai/api/v1/rest/crm/deals
  • Auth: HTTP bearer

Headers

X-Tenant-Idstring uuid

The organisation to act in. An API key is bound to exactly one, so this is optional for a key and must match the one it was minted for.

Request body

titlestring required

What the trattativa is about, as it should read in the pipeline.

party_idstring uuid required

The customer. Required — an opportunity always hangs off an anagrafica. From anagrafiche_search_parties, or anagrafiche_create_party when the customer is new. A deleted anagrafica is refused.

contact_idstring uuid

The person at that customer — an anagrafica of kind person, from anagrafiche_search_parties.

pipeline_idstring uuid

Which pipeline. Omit for the organisation’s default one.

stage_idstring uuid

Where it starts. Omit for the pipeline’s first non-terminal stage; the ids come from crm_list_lookups or crm_deals_board.

amountnumber

Expected value in currency. 0 when nobody has said a figure yet.

currencystring

ISO-4217, three uppercase letters — EUR, USD, CHF.

probabilitynumber

0–100, never 0–1. Omit to inherit the landing stage’s own default.

expected_close_datestring required

When it is expected to close, YYYY-MM-DD. Required: an open opportunity with no date is one the forecast cannot add up.

owner_user_idstring uuid

Whose deal it is. Omit and it becomes yours.

sourcestring

Where it came from — «sito», «passaparola», «fiera». Free text.

Response

Done. data is the tool’s own answer.

oktrue required
dataunknown required

Changes

No recorded changes to this operation across all 1 revision of this API.