# Create deal by id

You can create a deal using a deal deal_id.

POST /deals-by-id/

Attributes Type Required Description
deal_id string yes The unique identifier for the deal which is provided by the client.
activities_status string no A status of an activity assigned to the user.
assigned_to integer no A unique identifier for the agent which is given by User.com automatically.
company integer no A unique identifier for the company which is given by User.com automatically.
currency string no A currency of a deal.
expected_close_date string no A date when the deal is expected to be closed.
loss_reason integer no A reason for a lost deal.
lost_at string no A date when the deal has been marked as lost.
name string yes A deal name.
participants integer no A list of persons assigned to a deal.
pipeline integer no An id of a pipeline where the deal is assigned to.
products integer(list) no A list of products' ids.
stage integer no An id of a stage of the pipeline the deal is currently at.
status integer no A status of your deal (0 - abandoned, 1 - in progress, 2 - won, 3 - lost, 4 - archived)
tags string no A list of tags.
person integer no A unique identifier for the user which is given by User.com automatically.
value string no A value of a deal.
won_at string no A date when the deal has been marked as won.

# Request

  • CURL
  • JavaScript
  • PHP
  • Python
curl -X POST -H "Authorization: Token <your_64_char_api_key> " -H "Content-Type: application/json" -d '{
  "name": "Created name",
  "description": "updated description",
}' "https://<your_app_subdomain>.user.com/api/public/deals-by-id/"

# Response

{
    "id": 3300,
    "name": "Updated deal name",
    "value": "525.00",
    "currency": "USD",
    "deal_id": " /<:deal_id>",
    "stage": 25898,
    "pipeline": 4338,
    "assigned_to": null,
    "restricted_to": null,
    "agent": 5567,
    "products": [1, 2],
    "products_deal_id": ["custom_1", "custom_2"],
    "company": 123,
    "company_deal_id": "my_id",
    "person": 22266722,
    "person_id": "my_person_id",
    "status": "1",
    "scope": "2",
    "created_by": 5567,
    "created_at": "2017-06-27T14:51:04.331287Z",
    "updated_at": "2017-07-10T12:01:58.617681Z",
    "activities_status": "3",
    "activities_status_updated_at": "2017-07-10T12:01:58.617406Z",
    "expected_close_date": null
}