Create an opportunity

Create an opportunity.

 

Request Path Parameters
Parameter Type Required Description
org_id number Yes The unique identifier of your organization

 

Request Body Parameter
Attribute Type Required Description
status number Yes Id of the pipeline status
estimated_close Date Yes
value number Yes Amount
lead number Yes The id of the lead
assigned_user number Yes Id of the user the opportunity is assigned to
contact number No Id of the contact
notes string No
confidence number No

Example Request & Response


$ curl https://api.custerem.com/<org_id>/opportunities/ \
-X POST \
-H 'Authorization: X-API-KEY <Your API Key>' \
-H 'Content-Type: application/json' \
-d '{
    "status": 16,
    "estimated_close": "2022-02-22",
    "value": 200,
    "lead": 8,
    "assigned_user": 2,
    "contact": 5,
    "notes": "This is notes field",
    "confidence": 22
}'

 

201 Created

{
    "status": 16,
    "estimated_close": "2022-02-22T00:00:00Z",
    "value": "200.00",
    "contact": 5,
    "value_cycle": "A",
    "lead": 8,
    "notes": "This is notes field",
    "assigned_user": 2,
    "confidence": 50
}

 

400 Bad Request

{
    "status": [
        "This field is required."
    ],
    "estimated_close": [
        "This field is required."
    ],
    "value": [
        "This field is required."
    ],
    "lead": [
        "This field is required."
    ],
    "assigned_user": [
        "This field is required."
    ]
}