Configure Threshold Values

This API allows you to configure or update the segmentation thresholds for return rate, order frequency, and invoice value. These thresholds determine how customers are classified in segmentation analysis.


POST

/api/v1/return-exchange-intelligence/customer-segmentation/threshold-configuration


Method: POST
Content-Type: application/json
Authentication: Via username and key as query parameters
Body: JSON (see curl below)


Request curl

curl --location 'https://www.clickpost.in/api/v1/return-exchange-intelligence/customer-segmentation/threshold-configuration?username=<your-enterprise-username>&key=<your-enterprise-key>' \
--header 'Content-Type: application/json' \
--data '{
    "threshold_configuration": {
        "annual_return_rate": {
            "low_end": 0.08,
            "high_end": 1.0,
            "low_start": 0.0,
            "high_start": 0.38,
            "moderate_end": 0.37,
            "moderate_start": 0.09
        },
        "annual_order_frequency": {
            "low_end": 4,
            "high_end": 50,
            "low_start": 0,
            "high_start": 5
        },
        "annual_average_invoice_value": {
            "low_end": 78,
            "high_end": 500,
            "low_start": 0,
            "high_start": 79
        }
    }
}'

Success response

{
    "meta": {
        "status": 200,
        "message": "Success",
        "success": true
    }
}

Error response

Error response when any field validation fails: 400 BAD Request

{
    "meta": {
        "status": 400,
        "message": "Bad Request",
        "success": false
    },
    "error_detail": [
        {
            "message": "{'threshold_configuration': {'annual_return_rate': [ErrorDetail(string='This field is required.', code='required')], 'annual_order_frequency': [ErrorDetail(string='This field is required.', code='required')], 'annual_average_invoice_value': [ErrorDetail(string='This field is required.', code='required')]}}"
        }
    ]
}