Deals

In Quartz, deals represent the same object than in the CRM, also known as opportunities.

Deals

Get All Deals

Retrieves all open deals belonging to pipeline , or a subset of open deals based on sub-pipeline segmentation.

GET /deals
request
{
    "pipeline_id" : "p-53fJK-ervon-65ezc-hgEtE",
}
response
{
    "snapshot_id": "4af7c8d0-20c7-11ef-acef-1568cab95b54",
    "created_at": "2024-06-02 10:00:48",
    "deals": [
        {
            "deal_id": "57295c19-20c7-11ef-abc3-1568cab95b54"
        },
        {
            "deal_id": "57295cf1-20c7-11ef-846f-1568cab95b54"
        },
        {
            "deal_id": "57295d3c-20c7-11ef-b47c-1568cab95b54"
        },
       ...
    ]
}

Get Deal Details

GET /deals
request
{
    "deal_id" : "o-2342f-TfkzV-9hr5c" 
}
response
{
    "deal_id" : "o-2342f-TfkzV-9hr5c"
    "data" : {
         ...
        }
    "message" : "Opportunity found and retrieved.",
    "success" : true,
    "statusCode" : 200,
    
}

Deal Metrics

Get Deals Metrics

Retrieves deal metrics as documented in Metrics Reference.

GET /deals/metrics
{
    "deal_id" : "o-2342f-TfkzV-9hr5c" 
}
{
    "deal_id": "ba02670f-1da2-11ef-ba63-ab11d6dd9cee",
    "created_at": "2024-05-29 10:03:41",
    "metrics": [
        {
            "metric_definition": {
                "id": "d6079818-1da2-11ef-ac7f-d900fcecd4c6",
                "api_codename": "aging"
            },
            "scope": {
                "deals": "ba02670f-1da2-11ef-ba63-ab11d6dd9cee"
            },
            "metric_value": {
                "value": "n/a",
                "unit": "days"
            }
        }
    ],
    "status" : {
        ...
    }
}

Get Deals Timeseries

Retrieves deal metrics as time-series.

GET /deals/timeseries
request
{
    "deal_id" : "o-2342f-TfkzV-9hr5c",
    "duration" : 30,
    "metrics" : {
        "metric" : "aging",
    }
}
response
{
        "metric_definition": {
            "id": "cb8b7dfb-2259-11ef-99af-e3398e059768",
            "api_codename": "aging"
        },
        "scope": {
            "deals": "af8a30ce-2259-11ef-b6ed-034147278f7f"
        },
        "metric_value": {
            "value": 223,
            "unit": "days"
        },
        "snapshot": {
            "id": "a0f83f1e-2259-11ef-9227-034147278f7f",
            "created_at": "2024-06-04 10:00:48"
        }
    },
    {
        "metric_definition": {
            "id": "a3947236-2190-11ef-9506-35712cbc2ac5",
            "api_codename": "aging"
        },
        "scope": {
            "deals": "876f4416-2190-11ef-8270-0d0fe1d9c69d"
        },
        "metric_value": {
            "value": 222,
            "unit": "days"
        },
        "snapshot": {
            "id": "78192aed-2190-11ef-92a4-0d0fe1d9c69d",
            "created_at": "2024-06-03 10:00:48"
        }
    },
```

Last updated