- 15.5
Description
The EstimateLineItem endpoint provides the API consumer with access to methods pertaining to estimate line items and related data objects. The endpoint allows consumers to load estimate line items, add new estimate line items, and update estimate line items.
Methods
- Specification
- GetEstimateLineItem
- GetEstimateLineItemsByEstimate
- AddEstimateLineItem
- UpdateEstimateLineItem
- DeleteEstimateLineItem
| URL | base/CRM/EstimateLineItem/Specification |
|---|---|
| Action | GET |
| Description | Returns a data dictionary that details the available web service methods related to the EstimateLineItem endpoint. |
| Parameters | None |
| Returns | A JSON object with method descriptions |
| Sample Return Object | |
[
{
"HttpAction": "Get",
"MethodName": "GetEstimateLineItem",
"Description": "Returns the record for a single 'EstimateLineItem' given the passed in ID value (see Path).",
"Path": "/EstimateLineItem/GetEstimateLineItem/25032"
},
{
"HttpAction": "Get",
"MethodName": "GetEstimateLineItemsByEstimate",
"Description": "Returns all the records of 'EstimateLineItem' given the passed in Estimate ID value (see Path).",
"Path": "/EstimateLineItem/GetEstimateLineItemsByEstimate/25032"
},
{
"HttpAction": "Post",
"MethodName": "AddEstimateLineItem",
"Description": "Creates the record for a single 'EstimateLineItem' and returns the EstimateLineItem object",
"Format": {
"Name": "Pole 1",
"Description": "Pole for driveway",
"EstimateID": 187,
"ParentID": 724,
"NumberOfUnits": 368,
"EstimateLineItemTypeID": 497,
"CostPerUnit": 86.75,
"CreatedOn": "2018-06-13T14:13:45.7721119-04:00",
"CreatedBy": "mapcom"
}
},
{
"HttpAction": "Post",
"MethodName": "UpdateEstimateLineItem",
"Description": "Updates the record for a single 'EstimateLineItem' and returns the EstimateLineItem object",
"Format": {
"ID": 897,
"Name": "Pole 1",
"Description": "Pole for driveway",
"EstimateID": 781,
"ParentID": 302,
"NumberOfUnits": 204,
"EstimateLineItemTypeID": 964,
"CostPerUnit": 44.35,
"CreatedOn": "2018-06-13T14:13:45.7726313-04:00",
"CreatedBy": "mapcom"
}
},
{
"HttpAction": "Get",
"MethodName": "DeleteEstimateLineItem",
"Description": "Deletes the record for a single 'EstimateLineItem' given the passed in ID value (see Path).",
"Path": "/EstimateLineItem/DeleteEstimateLineItem/25032"
}
]
|
|
| URL | base/CRM/EstimateLineItem/GetEstimateLineItem/ID | ||
|---|---|---|---|
| Action | GET | ||
| Description | Returns an EstimateLineItem object when given an ID of a valid estimate line item in the M4 database. | ||
| Parameters | |||
| Name | Required? | Type | Description |
| ID | Yes | Integer | An integer value representing the ID of a estimate line item in the M4 database. |
| Returns | A JSON EstimateLineItem data object | ||
| Sample Return Object | |||
{
"ID": 897,
"Name": "Pole 1",
"Description": "Pole for driveway",
"EstimateID": 781,
"ParentID": 302,
"NumberOfUnits": 204,
"EstimateLineItemTypeID": 964,
"CostPerUnit": 44.35,
"CreatedOn": "2018-06-13T14:13:45.7726313-04:00",
"CreatedBy": "mapcom"
}
|
|||
| URL | base/CRM/EstimateLineItem/GetEstimateLineItemsByEstimate/ID | ||
|---|---|---|---|
| Action | GET | ||
| Description | Returns a collection EstimateLineItem objects when given an ID of a valid estimate in the M4 database. | ||
| Parameters | |||
| Name | Required? | Type | Description |
| ID | Yes | Integer | An integer value representing the ID of an estimate in the M4 database. |
| Returns | A list of JSON EstimateLineItem data objects | ||
| Sample Return Object | |||
[
{
"ID": 897,
"Name": "Pole 1",
"Description": "Pole for driveway",
"EstimateID": 781,
"ParentID": 302,
"NumberOfUnits": 204,
"EstimateLineItemTypeID": 964,
"CostPerUnit": 44.35,
"CreatedOn": "2018-06-13T14:13:45.7726313-04:00",
"CreatedBy": "mapcom"
},
{
"ID": 898,
"Name": "Pole 1",
"Description": "Pole for driveway",
"EstimateID": 781,
"ParentID": 724,
"NumberOfUnits": 368,
"EstimateLineItemTypeID": 497,
"CostPerUnit": 86.75,
"CreatedOn": "2018-06-13T14:13:45.7721119-04:00",
"CreatedBy": "mapcom"
}
]
|
|||
| URL | base/CRM/EstimateLineItem/AddEstimateLineItem | ||
|---|---|---|---|
| Action | POST | ||
| Description | Adds the specified EstimateLineItem object and returns a the newly created EstimateLineItem object. | ||
| Parameters | |||
| Name | Required? | Type | Description |
| Name | Yes | String | The name of the estimate line item. |
| Description | No | String | The description of the estimate line item. |
| EstimateID | Yes | Integer | The estimate ID of the estimate line item. |
| ParentID | No | Integer | The parent ID of the estimate line item. |
| NumberOfUnits | Yes | Decimal | The number of units of the estimate line item. |
| CostPerUnit | Yes | Decimal | The cost per unit of the estimate line item. |
| EstimateLineItemTypeID | Yes | Integer | The type ID of the estimate line item. |
| CreatedOn | Yes | DateTime | The time the estimate line item was created. |
| CreatedBy | Yes | String | The user who created the estimate line item. |
| Sample JSON Package | |||
{
"Name": "Pole 1",
"Description": "Pole for driveway",
"EstimateID": 781,
"ParentID": 302,
"NumberOfUnits": 204,
"EstimateLineItemTypeID": 964,
"CostPerUnit": 44.35,
"CreatedOn": "2018-06-13T14:13:45.7726313-04:00",
"CreatedBy": "mapcom"
}
|
|||
| Returns | A JSON EstimateLineItem data object | ||
| Sample Return Object | |||
{
"ID": 897,
"Name": "Pole 1",
"Description": "Pole for driveway",
"EstimateID": 781,
"ParentID": 302,
"NumberOfUnits": 204,
"EstimateLineItemTypeID": 964,
"CostPerUnit": 44.35,
"CreatedOn": "2018-06-13T14:13:45.7726313-04:00",
"CreatedBy": "mapcom"
}
|
|||
| Business Rules | |||
Any violations of these business rules result in an appropriate error message being returned to the API consumer.
|
|||
| URL | base/CRM/EstimateLineItem/UpdateEstimateLineItem | ||
|---|---|---|---|
| Action | POST | ||
| Description | Updates the specified EstimateLineItem object and returns the newly updated EstimateLineItem object. | ||
| Parameters | |||
| Name | Required? | Type | Description |
| ID | Yes | Integer | The ID of the estimate line item. |
| Name | Yes | String | The name of the estimate line item. |
| Description | No | String | The description of the estimate line item. |
| EstimateID | Yes | Integer | The estimate ID of the estimate line item. |
| ParentID | No | Integer | The parent ID of the estimate line item. |
| NumberOfUnits | Yes | Decimal | The number of units of the estimate line item. |
| CostPerUnit | Yes | Decimal | The cost per unit of the estimate line item. |
| EstimateLineItemTypeID | Yes | Integer | The type ID of the estimate line item. |
| CreatedOn | Yes | DateTime | The time the estimate line item was created. |
| CreatedBy | Yes | String | The user who created the estimate line item. |
| Sample JSON Package | |||
{
"ID": 897,
"Name": "Pole 1",
"Description": "Pole for driveway",
"EstimateID": 781,
"ParentID": 302,
"NumberOfUnits": 204,
"EstimateLineItemTypeID": 964,
"CostPerUnit": 44.35,
"CreatedOn": "2018-06-13T14:13:45.7726313-04:00",
"CreatedBy": "mapcom"
}
|
|||
| Returns | A JSON EstimateLineItem data object | ||
| Sample Return Object | |||
{
"ID": 897,
"Name": "Pole 1",
"Description": "Pole for driveway",
"EstimateID": 781,
"ParentID": 302,
"NumberOfUnits": 204,
"EstimateLineItemTypeID": 964,
"CostPerUnit": 44.35,
"CreatedOn": "2018-06-13T14:13:45.7726313-04:00",
"CreatedBy": "mapcom"
}
|
|||
| Business Rules | |||
Any violations of these business rules result in an appropriate error message being returned to the API consumer.
|
|||
| URL | base/CRM/EstimateLineItem/DeleteEstimateLineItem/ID | ||
|---|---|---|---|
| Action | GET | ||
| Description | Deletes an EstimateLineItem object when given an ID of a valid estimate line item in the M4 database. | ||
| Parameters | |||
| Name | Required? | Type | Description |
| ID | Yes | Integer | An integer value representing the ID of a estimate line item in the M4 database. |
| Returns | A JSON data object | ||
| Sample Return Object | |||
{
"Message": "The EstimateLineItem with ID [55] was deleted successfully."
}
|
|||