[POST] .../v1/targetsetting/addsingle
Adds a target setting. Use this method to add one setting to an existing unfinished target. ReceiptCount and AverageReceipt targets do not accept settings. CrmDealWonAmount targets accept Pipeline and DealType settings; other target types accept Item and ItemGroup settings. The caller must have edit permission for the target owner scope; missing body, invalid target_id, invalid type, empty value, finished targets, denied permissions, unsupported setting type and storage errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| include | Boolean | Required | Setting state. true enables the setting; false disables it. |
| target_id | Int64 | Required | Target ID. The target must exist, be unfinished and be editable by the current user. |
| type | String | Required | Target setting type: Item and ItemGroup are allowed for sales/item targets; Pipeline and DealType are allowed for CrmDealWonAmount targets. Allowed values: Default, Item, ItemGroup, Pipeline, DealType. |
| value | String | Required | Setting value stored as an entity identifier string. Required and limited to 30 characters. |
Request Example
{
"target_id": 12,
"type": "Item",
"value": "145",
"include": true
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 31
}
}