Previews how an existing bill would look in EnergyCAP after a script, or all of its rules, ran, without saving anything
Use this endpoint to see the bill as Bill View would show it after the changes: its header values, its meters
with their line items, its account-level line items, and its totals. The bill is mapped the way a reprocess maps
it - meters are matched, header charges such as amount due become account lines, and each line’s observation
type and units are resolved - but it is built in memory and nothing is written. When the changed bill could not
be mapped (for example it names an observation type that doesn’t exist), the reasons an import would reject it
are returned instead. Restricted to ENC staff.
Request Headers
| Header | Value | Required | Description |
|---|---|---|---|
| ECI-ApiKey | string | Yes | Your API key. See Authentication. |
| Content-Type | application/json | Yes | All requests must specify JSON content type, including the request body. |
Path Parameters
| Name | Description | Type | Required |
|---|---|---|---|
| billId | Unique numeric identifier of the existing bill to preview | integer (int32) | Required |
Request Body
WorkbenchBillPreviewRequestV202609
| Property | Description | Type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| allRules | When true, every active rule that applies to the bill runs, in import order, along with EnergyCap.DTO.V202609.Workbench.WorkbenchBillPreviewRequestDTO.Script when one is sent. When false, only EnergyCap.DTO.V202609.Workbench.WorkbenchBillPreviewRequestDTO.Script runs. | boolean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bill | BillDescriptorJson | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
BillDescriptorJson properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| replacesBillImportRuleId | With EnergyCap.DTO.V202609.Workbench.WorkbenchBillPreviewRequestDTO.AllRules, the saved rule that EnergyCap.DTO.V202609.Workbench.WorkbenchBillPreviewRequestDTO.Script is an edited copy of; the script runs in its place. See EnergyCap.DTO.V202609.Workbench.WorkbenchRulesRequestDTO.ReplacesBillImportRuleId. | integer (int32) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| script | The JavaScript to run, written as the body of a bill processing rule. When EnergyCap.DTO.V202609.Workbench.WorkbenchBillPreviewRequestDTO.AllRules is true, it runs with the saved rules, as EnergyCap.DTO.V202609.Workbench.WorkbenchRulesRequestDTO.Script does. Maximum length: 100,000 characters. Max length of 100000 | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example Request Body
{ "allRules": false, "bill": { "confidence": { "confidenceScore": 1.0, "lowConfidenceReason": "string"
}, "controlCode": "string", "header": { "accountIdentifiers": [], "accountLevelCharges": [], "accountNumber": "string", "billEnd": "2026-10-07", "billStart": "2026-10-07", "currencyCode": "string", "currentCharges": 1.0, "customerAddress": "string", "daysOfService": 1, "deliveryDate": "2026-10-07", "deposit": 1.0, "dueDate": "2026-10-07", "estimated": false, "invoiceDate": "2026-10-07", "invoiceNumber": "string", "lateFee": 1.0, "mailingDate": "2026-10-07", "paymentReceived": 1.0, "priorBalance": 1.0, "rateSchedule": [], "refund": 1.0, "remitAddress": "string", "servicePeriodMonth": "string", "sourceLanguage": "string", "totalCost": 1.0, "vendorAddress": "string", "vendorEmail": "string", "vendorName": "string", "vendorPhoneNumber": "string", "vendorRole": "string", "vendorWebsite": "string"
}, "meters": [
{ "commodity": "string", "identifiers": [], "lines": [], "meterAddress": "string", "rateSchedule": [], "serialNumber": "string"
}
], "processingErrors": [
{ "errorMessage": "string", "errorReason": "string"
}
]
}, "replacesBillImportRuleId": 1, "script": "string"
}
Responses
200
OK
The request succeeded and the response body contains the requested data.
Response Body Parameters
WorkbenchBillPreviewResponseV202609
| Property | Description | Type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| bill | BillEntryResponse | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
BillEntryResponse properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| errors | Why the preview could not be built, e.g. an unknown observation type or a meter that can’t be matched. Empty when EnergyCap.DTO.V202609.Workbench.WorkbenchBillPreviewResponseDTO.Success is true | string[] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| success | True when the bill could be built. False when the script or a rule failed, or the bill could not be mapped (an import would reject it); see EnergyCap.DTO.V202609.Workbench.WorkbenchBillPreviewResponseDTO.Errors | boolean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| warnings | Things to be aware of that don’t stop the preview, e.g. the bill would move to a different account | string[] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example Response
{ "bill": { "accountBodyLines": [
{ "bodyLineId": 1, "caption": "string", "cost": {}, "observationType": {}, "value": {}
}
], "accountId": 1, "accountPeriodName": { "required": false, "value": "string"
}, "accountPeriodNumber": { "required": false, "value": "string"
}, "accountPeriodYear": { "required": false, "value": "string"
}, "accrual": false, "apExported": false, "approved": false, "batch": { "batchCode": "string", "batchId": 1
}, "beginDate": "2026-10-07", "billId": 1, "billImageUrl": "string", "billNote": "string", "billingPeriod": 1, "checkDate": "2026-10-07", "checkNumber": "string", "clearedDate": "2026-10-07", "controlCode": { "required": false, "value": "string"
}, "costConversion": { "conversionDate": "2026-10-07", "sourceToSystemConversionValue": 1.0, "sourceUnit": {}, "systemUnit": {}
}, "days": 1, "dueDate": { "required": false, "value": "string"
}, "endDate": "2026-10-07", "estimated": { "required": false, "value": "string"
}, "exportHold": false, "fromVendor": false, "fundsWithdrawnDate": "2026-10-07", "generalLedgerCode": "string", "glExported": false, "hasBeenSplit": false, "invoiceNumber": { "required": false, "value": "string"
}, "meters": [
{ "bodyLines": [], "fromTemplate": false, "generalLedgerCode": "string", "meterCode": "string", "meterId": 1, "meterInfo": "string"
}
], "needsToOpenBatch": false, "nextReading": { "required": false, "value": "string"
}, "numberOfOpenBatches": 1, "observationMethod": { "observationMethodCode": "string", "observationMethodId": 1, "observationMethodInfo": "string"
}, "payStatus": "string", "paymentExported": false, "statementDate": { "required": false, "value": "string"
}, "totalCost": 1.0, "totalSourceCost": 1.0, "vendorBodyLines": [
{ "bodyLineId": 1, "caption": "string", "cost": {}, "observationType": {}, "value": {}
}
], "vendorId": 1, "void": false
}, "errors": [
"string"
], "success": false, "warnings": [
"string"
]
}
404
Not Found
The requested resource was not found. Verify the ID or path is correct.