POST /api/v202609/workbench/bill/{billId}/preview

Previews how an existing bill would look in EnergyCAP after a script, or all of its rules, ran, without saving anything

PreviewWorkbenchBillV202609 Permissions: BillProcessingRules (Manage)BillsAndBatches (View)
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
Property Description Type
confidence BillDescriptorJson+BillDescriptorConfidence
BillDescriptorJson+BillDescriptorConfidence properties
Property Description Type
confidenceScore A number between 0 and 1 representing percentage confident in extraction results. 100% is “totally confident”. number (double)
lowConfidenceReason A plain text explanation of why confidence is low if available. Can be blank if no confidence impacting issues detected. string
controlCode The name of the input file, without file extension, for linking results to document source for extraction string
header BillDescriptorJson+BillDescriptorHeaderJson
BillDescriptorJson+BillDescriptorHeaderJson properties
Property Description Type
accountIdentifiers A list of label-value pairs that may be used to identify the account. For example Customer ID, Supplier Agreement ID, Site ID, Metering Location ID, Service Point ID, Agreement ID, etc. Labels and values should appear as they do on the bill. BillDescriptorJson+BillDescriptorIdentifier[]
BillDescriptorJson+BillDescriptorIdentifier properties
Property Description Type
label The label of the identifier string
value The value of the identifier string
accountLevelCharges A list of charge line items that are not related to any meter on the bill. Any charges that are derived from the amount of metered usage should be attached to the relevant meter instead. This is often empty BillDescriptorJson+BillDescriptorChargeLineItem[]
BillDescriptorJson+BillDescriptorChargeLineItem properties
Property Description Type
caption Caption / Description of the line item string
cost Cost of the line item. Unlike meter line items, may not be NULL as a charge line has no other countable value. number (double)
observationType The observation type code classifying this line item (e.g., CHARGE, TAX, CUSTOMERCHARGE, LATEFEE). Must be a valid EnergyCap.DTO.Base.BillDescriptor.BillDescriptorJson.BillDescriptorChargeLineItem.ObservationType value. string
accountNumber Primary account number on the bill. Other items that may identify the account can be added to EnergyCap.DTO.Base.BillDescriptor.BillDescriptorJson.BillDescriptorHeaderJson.AccountIdentifiers. This will generally appear there as well and may be the only entry. string
billEnd The end date of the bill, if available. Must be in ISO-8601 format. string (date-time)
billStart The start date of the bill, if available. Must be in ISO-8601 format. string (date-time)
currencyCode The currency of all cost line items on the bill. Use the ISO-4217 3-character list () string
currentCharges The total amount of charges incurred only by this bill. Does not include late fees, balance carried forward from prior bills, etc. number (double)
customerAddress The customer address. Entire address - not broken into segments. string
daysOfService The number of days in the service period, if available. Also known as “Billing Days”, “Days in Period”, etc integer (int32)
deliveryDate For bills that have only a single date like fuel oil or propane deliveries, use this rather than EnergyCap.DTO.Base.BillDescriptor.BillDescriptorJson.BillDescriptorHeaderJson.BillStart and EnergyCap.DTO.Base.BillDescriptor.BillDescriptorJson.BillDescriptorHeaderJson.BillEnd. Must be in ISO-8601 format. string (date-time)
deposit REMOVED in BD v1.4 - retained in EUM for backwards compatibility. Any deposit amount held by the vendor that is applied to this bill. number (double)
dueDate When the bill payment is due. Also called Remit Date, Pay By, Expiration Date, Penalty if not paid before, etc. Must be in ISO-8601 format. string (date-time)
estimated true if any meter readings used to calculate the bill were estimated or the bill indicates that it was estimated boolean
invoiceDate Also called statement date, issue date. The effective date on which the bill amounts were calculated. Must be in ISO-8601 format. string (date-time)
invoiceNumber Also known as “bill number”, “Bill ID”, “Document Number” string
lateFee REMOVED in BD v1.4 - retained in EUM for backwards compatibility. Any late fees applied to this bill. number (double)
mailingDate When the bill was sent by the utility provider. Must be in ISO-8601 format. string (date-time)
paymentReceived REMOVED in BD v1.4 - retained in EUM for backwards compatibility. Amount of any payment received against the prior bill, typically the same as the amount of the prior bill. number (double)
priorBalance REMOVED in BD v1.4 - retained in EUM for backwards compatibility. The UNPAID amount owed prior to this bill. Also known as “Past Due Balance”, “Outstanding Balance”, “Past Due Amount”. number (double)
rateSchedule Label-value pairs representing information about the rate defining the bill. Often only one present. BillDescriptorJson+BillDescriptorIdentifier[]
BillDescriptorJson+BillDescriptorIdentifier properties
Property Description Type
label The label of the identifier string
value The value of the identifier string
refund REMOVED in BD v1.4 - retained in EUM for backwards compatibility. Any refund amount applied to this bill. number (double)
remitAddress Address where payments should be sent. Does not include vendor name. Entire address - not broken into segments. string
servicePeriodMonth Abbreviated US English month name, e.g. “Jan”, “Feb”, “Mar”, etc string
sourceLanguage The source language of the bill, in ISO-639 Set 2 () string
totalCost The total amount due on the bill, also known as “Total Amount Due”, “Total Due”, “Amount Due”, “Net Amount”. Includes prior balance and late fee. number (double)
vendorAddress The vendor’s address. Does not include vendor name. Entire address - not broken into segments. string
vendorEmail The website of the vendor, if available string
vendorName The name of the Utility Vendor issuing the bill string
vendorPhoneNumber The main phone number of the vendor, if available string
vendorRole If available, one of ‘Supply’, ‘Distribution’ string
vendorWebsite The website of the vendor, if available string
meters Meters represented on the bill, including line items associated with each meter BillDescriptorJson+BillDescriptorMeterJson[]
BillDescriptorJson+BillDescriptorMeterJson properties
Property Description Type
commodity See commodity list provided separately. string
identifiers A list of label-value pairs that may be used to identify the meter. For example Meter Number, Serial Number, Tank Number, Site Name, Point of Delivery, Service Point, EZID, etc. Labels and values should appear as they do on the bill. BillDescriptorJson+BillDescriptorIdentifier[]
BillDescriptorJson+BillDescriptorIdentifier properties
Property Description Type
label The label of the identifier string
value The value of the identifier string
lines A list of charges and usage values associated with this meter. Each line may have a caption, a cost, a unit rate, a value and a unit. Value and Unit may indicate consumption, demand, etc. Not all fields will be present on every line. For example a fixed monthly charge will not have a usage value or unit. A value may be present without a cost if the bill shows the usage but does not charge for it. Lines should appear in the order they appear on the bill whenever possible. BillDescriptorJson+BillDescriptorMeterLineItem[]
BillDescriptorJson+BillDescriptorMeterLineItem properties
Property Description Type
caption Caption / Description of the line item string
cost Cost of the line item. Should be NULL if the line does not have a cost associated with it. Should be zero if the line has a cost, but it is 0. number (double)
lineGroupHeader string
observationType The observation type code classifying this line item (e.g., USE, DEMAND, CHARGE, TAX). Must be a valid EnergyCap.DTO.Base.BillDescriptor.BillDescriptorJson.BillDescriptorMeterLineItem.ObservationType value. string
summaryLine string
unit Value unit (e.g. kWh, Therms, Gallons, CCF, etc). Units should be the unit code from the list of standard units provided separately (see unit-list.csv) string
unitRate Unit Rate should represent what is printed on the bill if present (it may differ based on rounding from a computed value). number (double)
value Value of the line item (e.g. quantity of energy, demand, or volume). Should be NULL if the line does not have a value associated with it. Should be zero if the line has a value, but it is 0. number (double)
meterAddress Entire address - not broken into segments string
rateSchedule label-value pairs representing information about the rate defining the bill. Often only one present. BillDescriptorJson+BillDescriptorIdentifier[]
BillDescriptorJson+BillDescriptorIdentifier properties
Property Description Type
label The label of the identifier string
value The value of the identifier string
serialNumber The serial number of the meter, if available string
processingErrors List of any problems that prevented extraction of bill data BillDescriptorJson+BillDescriptorProcessingError[]
BillDescriptorJson+BillDescriptorProcessingError properties
Property Description Type
errorMessage Whatever context will help to understand the problem. Free form text. string
errorReason A category for the error. “Invalid Scan”, “Encrypted File”, “Corrupt File”, “Unknown”, others as appropriate. string
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 application/json
{  "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
Property Description Type
accountBodyLines The bill’s account-level details BillEntryBodyLine[]
BillEntryBodyLine properties
Property Description Type
bodyLineId The body line identifier integer (int32)
caption The body line’s caption string
cost BillEntryBodyLineChild
BillEntryBodyLineChild properties
Property Description Type
type The body line’s observation type string
unit UnitChild
UnitChild properties
Property Description Type
unitCode The unit code string
unitId The unit identifier integer (int32)
unitInfo The unit info string
value The body line’s numeric value number (double)
observationType BillEntryObservationTypeChild
BillEntryObservationTypeChild properties
Property Description Type
observationTypeCode The observation type code string
observationTypeId The observation type identifier integer (int32)
observationTypeInfo The observation type name string
value BillEntryBodyLineWithNounChild
BillEntryBodyLineWithNounChild properties
Property Description Type
noun The body line’s noun string
type The body line’s observation type string
unit UnitChild
UnitChild properties
Property Description Type
unitCode The unit code string
unitId The unit identifier integer (int32)
unitInfo The unit info string
value The body line’s numeric value number (double)
accountId The account identifier integer (int32)
accountPeriodName BillHeaderChild
BillHeaderChild properties
Property Description Type
required Indicates if the bill header is required during bill entry boolean
value The bill header value string
accountPeriodNumber BillHeaderChild
BillHeaderChild properties
Property Description Type
required Indicates if the bill header is required during bill entry boolean
value The bill header value string
accountPeriodYear BillHeaderChild
BillHeaderChild properties
Property Description Type
required Indicates if the bill header is required during bill entry boolean
value The bill header value string
accrual Indicates if the bill is an accrual bill boolean
apExported Indicates if the bill has been ap exported boolean
approved Indicates if the bill has been approved boolean
batch BatchChild
BatchChild properties
Property Description Type
batchCode The batch code. string
batchId The batch id. integer (int32)
beginDate The bill’s begin date string (date-time)
billId The bill identifier integer (int32)
billImageUrl The fully qualified url to the bill image string
billNote The bill’s note string
billingPeriod The bill’s billing period integer (int32)
checkDate The date and time of the check string (date-time)
checkNumber The number of the check that the bill was paid with string
clearedDate The date and time that the check cleared string (date-time)
controlCode BillHeaderChild
BillHeaderChild properties
Property Description Type
required Indicates if the bill header is required during bill entry boolean
value The bill header value string
costConversion CostConversion
CostConversion properties
Property Description Type
conversionDate The date used to look up the currency conversion string (date-time)
sourceToSystemConversionValue The conversion factor used to convert from the source cost unit to the system cost unit number (double)
sourceUnit UnitChild
UnitChild properties
Property Description Type
unitCode The unit code string
unitId The unit identifier integer (int32)
unitInfo The unit info string
systemUnit UnitChild
UnitChild properties
Property Description Type
unitCode The unit code string
unitId The unit identifier integer (int32)
unitInfo The unit info string
days The bill’s number of days integer (int32)
dueDate BillHeaderChild
BillHeaderChild properties
Property Description Type
required Indicates if the bill header is required during bill entry boolean
value The bill header value string
endDate The bill’s end date string (date-time)
estimated BillHeaderChild
BillHeaderChild properties
Property Description Type
required Indicates if the bill header is required during bill entry boolean
value The bill header value string
exportHold Indicates if the bill is being withheld from bill exports boolean
fromVendor Indicates if the bill is from a vendor boolean
fundsWithdrawnDate The date when funds were withdrawn string (date-time)
generalLedgerCode The general ledger code of the bill’s account-level details (“Mixed” if there is more than one) string
glExported Indicates if the bill has been gl exported boolean
hasBeenSplit Indicates if the bill has been split boolean
invoiceNumber BillHeaderChild
BillHeaderChild properties
Property Description Type
required Indicates if the bill header is required during bill entry boolean
value The bill header value string
meters The billing account’s meters BillEntryMeterChild[]
BillEntryMeterChild properties
Property Description Type
bodyLines The bill’s meter-level details BillEntryBodyLine[]
BillEntryBodyLine properties
Property Description Type
bodyLineId The body line identifier integer (int32)
caption The body line’s caption string
cost BillEntryBodyLineChild
BillEntryBodyLineChild properties
Property Description Type
type The body line’s observation type string
unit UnitChild
UnitChild properties
Property Description Type
unitCode The unit code string
unitId The unit identifier integer (int32)
unitInfo The unit info string
value The body line’s numeric value number (double)
observationType BillEntryObservationTypeChild
BillEntryObservationTypeChild properties
Property Description Type
observationTypeCode The observation type code string
observationTypeId The observation type identifier integer (int32)
observationTypeInfo The observation type name string
value BillEntryBodyLineWithNounChild
BillEntryBodyLineWithNounChild properties
Property Description Type
noun The body line’s noun string
type The body line’s observation type string
unit UnitChild
UnitChild properties
Property Description Type
unitCode The unit code string
unitId The unit identifier integer (int32)
unitInfo The unit info string
value The body line’s numeric value number (double)
fromTemplate True means a “template” was used to generate the bodylines False means an existing bill was used to generate the bodylines boolean
generalLedgerCode The meter gl code string
meterCode The meter code string
meterId The meter identifier integer (int32)
meterInfo The meter name string
needsToOpenBatch Indicates if a new bill batch needs to be opened to place this bill in boolean
nextReading BillHeaderChild
BillHeaderChild properties
Property Description Type
required Indicates if the bill header is required during bill entry boolean
value The bill header value string
numberOfOpenBatches Indicates how many open batches the user has integer (int32)
observationMethod ObservationMethodChild
ObservationMethodChild properties
Property Description Type
observationMethodCode Observation method code string
observationMethodId Observation method identifier integer (int32)
observationMethodInfo Observation method name: Automatic, Manual, Estimated, Simulated, Accrual, or Adjustment string
payStatus The payment status of the bill string
paymentExported Indicates if the bill has been exported to bill payment boolean
statementDate BillHeaderChild
BillHeaderChild properties
Property Description Type
required Indicates if the bill header is required during bill entry boolean
value The bill header value string
totalCost The bill’s total cost in the system currency. The system currency is the reporting/global currency unit. number (double)
totalSourceCost The bill’s total cost in the source currency. The source currency is the native currency unit. number (double)
vendorBodyLines The bill’s vendor template details BillEntryBodyLine[]
BillEntryBodyLine properties
Property Description Type
bodyLineId The body line identifier integer (int32)
caption The body line’s caption string
cost BillEntryBodyLineChild
BillEntryBodyLineChild properties
Property Description Type
type The body line’s observation type string
unit UnitChild
UnitChild properties
Property Description Type
unitCode The unit code string
unitId The unit identifier integer (int32)
unitInfo The unit info string
value The body line’s numeric value number (double)
observationType BillEntryObservationTypeChild
BillEntryObservationTypeChild properties
Property Description Type
observationTypeCode The observation type code string
observationTypeId The observation type identifier integer (int32)
observationTypeInfo The observation type name string
value BillEntryBodyLineWithNounChild
BillEntryBodyLineWithNounChild properties
Property Description Type
noun The body line’s noun string
type The body line’s observation type string
unit UnitChild
UnitChild properties
Property Description Type
unitCode The unit code string
unitId The unit identifier integer (int32)
unitInfo The unit info string
value The body line’s numeric value number (double)
vendorId The vendor identifier integer (int32)
void Indicates if the bill has been voided boolean
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 application/json
{  "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.