POST api/servicecharge
The purpose of this API is to add a Service Charge to a site.
Error Messages
- 400/Bad Request - Description is required unless a chargeId provided
- 400/Bad Request - You cannot assign a Service Charge to a hidden Bill Run
- 400/Bad Request - Only customers can have a Bill Run assigned to them
- 400/Bad Request - The First Payment is mandatory
- 400/Bad Request - The Last Payment can't be set before the First Payment
- 400/Bad Request - Attempted to set a one-off charge as a rental, or vice-versa
- 400/Bad Request - You cannot set a quantity of 0
- 401/Unauthorized - You do not have permission to change BillRunId
- 404/Not Found - Bill Run not found
- 404/Not Found - Either ChargeId or FrequencyTypeID should be provided
- 404/Not Found - Site with id x not found
- 404/Not Found - Contract with id x not found
- 404/Not Found - Contract with id x does not belong to the company this Service Charge allocated to
- 404/Not Found - The CLI not found for the site provided
- 404/Not Found - No frequency types found in aBILLity
- 404/Not Found - Invalid FrequencyTypeId
- 404/Not Found - No ChargeIds found in aBILLity
Request Information
URI Parameters
None.
Body Parameters
ServiceChargePostRequest| Name | Description | Type | Additional information |
|---|---|---|---|
| SiteId | The Site ID of the site to which the Service Charge belongs | integer |
None. |
| Description | A unique description for the Service Charge | string |
String length: inclusive between 0 and 100 |
| ContractId | The ID of the contract the Service Charge is on | integer |
None. |
| CLI | The CLI on this Service Charge | string |
String length: inclusive between 0 and 17 |
| ChargeId | The ID of the Service Charge Type | integer |
None. |
| FrequencyTypeId | The ID that corresponds to the desired frequency to which the Service Charge will be billed. ID 1 = Annual ID 2 = Monthly ID 3 = One off ID 4 = Quarterly | integer |
None. |
| SalesPrice | The Sales price of the Service Charge | decimal number |
None. |
| CostPrice | The cost of the Service Charge | decimal number |
None. |
| BaselineCost | The baseline cost of the Service Charge | decimal number |
None. |
| Quantity | The number of times this charge valid i.e a Service Charge could be valid for 8 quarterly periods | integer |
None. |
| FirstPayment | The date the Service Charge is first billed | date |
None. |
| LastPayment | The date that the Service Charge is last billed | date |
None. |
| SerialNo | The serial number of the Service Charge | string |
String length: inclusive between 0 and 40 |
| Rental | Indicates whether the Service Charge Type is a rental | boolean |
None. |
| Import | Indiates whether the Service Charge is imported into the system | boolean |
None. |
| Suppress | Indicates whether the customer bill will display the Service Charge if the value is 0 | boolean |
None. |
| BillNow | Indicates whether the charge is billed in the current month | boolean |
None. |
| Notes | Displays any notes for the Service Charge | string |
None. |
| BackDatable | boolean |
None. |
|
| RefundRental | boolean |
None. |
|
| BillRunId | The ID of the Bill Run | integer |
None. |
Request Formats
application/json, text/json
Sample:
{
"SiteId": 1,
"SkipCLIValidation": true,
"Description": "sample string 3",
"ContractId": 1,
"CLI": "sample string 4",
"ChargeId": 1,
"FrequencyTypeId": 1,
"SalesPrice": 1.0,
"CostPrice": 1.0,
"BaselineCost": 1.0,
"Quantity": 1,
"FirstPayment": "2025-11-01T12:33:08.103",
"LastPayment": "2025-11-01T12:33:08.103",
"SerialNo": "sample string 5",
"Rental": true,
"Import": true,
"Suppress": true,
"BillNow": true,
"Notes": "sample string 9",
"BackDatable": true,
"RefundRental": true,
"BillRunId": 1
}
application/xml, text/xml
Sample:
<ServiceChargePostRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/aBILLity.WebAPI.Models.Company"> <BackDatable>true</BackDatable> <BaselineCost>1</BaselineCost> <BillNow>true</BillNow> <BillRunId>1</BillRunId> <CLI>sample string 4</CLI> <ChargeId>1</ChargeId> <ContractId>1</ContractId> <CostPrice>1</CostPrice> <Description>sample string 3</Description> <FirstPayment>2025-11-01T12:33:08.103</FirstPayment> <FrequencyTypeId>1</FrequencyTypeId> <Import>true</Import> <LastPayment>2025-11-01T12:33:08.103</LastPayment> <Notes>sample string 9</Notes> <Quantity>1</Quantity> <RefundRental>true</RefundRental> <Rental>true</Rental> <SalesPrice>1</SalesPrice> <SerialNo>sample string 5</SerialNo> <Suppress>true</Suppress> <SiteId>1</SiteId> <SkipCLIValidation>true</SkipCLIValidation> </ServiceChargePostRequest>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
HttpResponseMessage| Name | Description | Type | Additional information |
|---|---|---|---|
| Version | Version |
None. |
|
| Content | HttpContent |
None. |
|
| StatusCode | HttpStatusCode |
None. |
|
| ReasonPhrase | string |
None. |
|
| Headers | Collection of Object |
None. |
|
| RequestMessage | HttpRequestMessage |
None. |
|
| IsSuccessStatusCode | boolean |
None. |