CRM · Utility Field Service
Utility Settings
The company's own numbers: grace and notice days, the late fee, the reconnect fee, deposits, read checks, the ledger accounts, and whether the public forms are open. One row; the shipped defaults apply until it is saved.
/api/crm/util-settingsPublished as /api/v1/util-settingsDownload specification (OpenAPI 3.1) Screen: Utility Settings
Overview
| Package | CRM |
|---|---|
| Authentication | Bearer token: a service account's token (POST /api/auth/service-token) or, for the published path, an API key |
| Authorization | The caller's roles must hold CRM › Utility Settings on the Roles screen: display for GET, add for POST, change for PUT, delete for DELETE; an action needs the grant of the button that runs it on the screen. |
| Table | crm.util_settings · kept per company (and organisational unit where it has one) |
| Record | Created, changed and (where the screen allows) deleted; key id |
| Rules | The same as the screen: validation, numbering, approvals, posting, the company the caller belongs to, and the audit trail. |
API reference
8 operations. Open one for its parameters, bodies, responses and a sample request.
GET/api/crm/util-settingsList utility settings
Query parameters
| Name | Description | Example |
|---|---|---|
limit | Rows per page (50 by default, at most 200) | limit=100 |
offset | Rows to skip | offset=200 |
q | Free-text search over the search columns | q=acme |
sort | column:asc or column:desc, several separated by commas | sort=created_at:desc |
filter | A JSON condition or group (see the filter language), URL-encoded; any field below can be filtered and sorted | filter={"col":"status","op":"eq","value":"open"} |
<field>=<value> | Shorthand for "field is value" |
Response 200
{
"rows": [
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"grace_days": 10,
"notice_days": 10,
"final_notice_days": 10,
"disconnect_days": 10,
"late_fee_flat": "1250.00",
"late_fee_pct": "1250.00",
"late_fee_min_balance": "1250.00",
"reconnect_fee": "1250.00",
"deposit_residential": "1250.00",
"deposit_commercial": "1250.00",
"high_usage_pct": 10,
"low_usage_pct": 10
}
],
"count": 1
}Sample request
curl "https://demo.tranxact.ai/api/crm/util-settings?limit=20" \
-H "Authorization: Bearer $TOKEN"GET/api/crm/util-settings/{id}Read one utility settings
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Response 200
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"grace_days": 10,
"notice_days": 10,
"final_notice_days": 10,
"disconnect_days": 10,
"late_fee_flat": "1250.00",
"late_fee_pct": "1250.00",
"late_fee_min_balance": "1250.00",
"reconnect_fee": "1250.00",
"deposit_residential": "1250.00",
"deposit_commercial": "1250.00",
"high_usage_pct": 10,
"low_usage_pct": 10
}404 when no record with that id is visible to the caller.
Sample request
curl "https://demo.tranxact.ai/api/crm/util-settings/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN"POST/api/crm/util-settingsCreate a utility settings
Request body
The record as JSON. Fields marked Yes are required.
| Field | Type | Required | Description |
|---|---|---|---|
grace_days | integer | No | Grace days before a late fee |
notice_days | integer | No | Past-due notice after (days) |
final_notice_days | integer | No | Final notice after (days) |
disconnect_days | integer | No | Propose disconnection after (days) |
late_fee_flat | numeric | No | Late fee (flat) |
late_fee_pct | numeric | No | Late fee (% of past due) — The greater of the two is charged. |
late_fee_min_balance | numeric | No | No late fee below |
reconnect_fee | numeric | No | Reconnect fee |
deposit_residential | numeric | No | Deposit, residential |
deposit_commercial | numeric | No | Deposit, commercial |
high_usage_pct | integer | No | High-use exception above (% of average) |
low_usage_pct | integer | No | Low-use exception below (% of average) |
bill_due_days | integer | No | Bills due in (days) |
revenue_account_no | text | No | Utility revenue account |
deposit_account_no | text | No | Customer deposits account |
credit_account_no | text | No | Customer credit balances account |
bad_debt_account_no | text | No | Bad debt account |
public_forms_enabled | boolean | No | Take start-service and problem reports from the public |
portal_link_factor | text | No | Portal sign-up proves the bill by Allowed: either last_bill_amount postal_code |
receivable_account_no | text | No | Utility receivable account — e.g. 1170 Utility Billings Receivable. Blank: the company's accounts receivable. |
cash_account_no | text | No | Utility cash / lockbox account — Where payments, deposits and refunds go, e.g. 1040. Blank: the company's cash account. |
service_charge_account_no | text | No | Service (customer) charge account — e.g. 4410. Blank: the customer charge posts with the usage, to the revenue account. |
late_fee_account_no | text | No | Late fee account — Blank: the utility revenue account. |
reconnect_fee_account_no | text | No | Connection and reconnection fee account — e.g. 4450. Blank: the utility revenue account. |
leak_adjustment_account_no | text | No | Leak adjustment account — Blank: the leak credit reduces the revenue account the use was billed to. |
cost_center_id | uuid | No | Utility cost center — What payments, deposits and fees post under, and any plan with none of its own -- so a fund-accounting company derives the fund. |
leak_max_per_year | integer | No | Leak adjustments per account in 12 months — 0: none are made. |
leak_method | text | No | Leak credit method — excess_lowest_tier: use above normal at the lowest block rate. excess_waived: use above normal not billed. Allowed: excess_lowest_tier excess_waived |
leak_requires_approval | boolean | No | A second person approves each leak adjustment |
leak_history_bills | integer | No | Normal use: average of the last (bills) |
Sample body
{
"grace_days": 10,
"notice_days": 10,
"final_notice_days": 10,
"disconnect_days": 10
}Response 201
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"grace_days": 10,
"notice_days": 10,
"final_notice_days": 10,
"disconnect_days": 10,
"late_fee_flat": "1250.00",
"late_fee_pct": "1250.00",
"late_fee_min_balance": "1250.00",
"reconnect_fee": "1250.00",
"deposit_residential": "1250.00",
"deposit_commercial": "1250.00",
"high_usage_pct": 10,
"low_usage_pct": 10
}Sample request
curl -X POST "https://demo.tranxact.ai/api/crm/util-settings" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"grace_days":10,"notice_days":10,"final_notice_days":10,"disconnect_days":10}'PUT/api/crm/util-settings/{id}Change a utility settings
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Request body
Only the fields to change; fields left out keep their value.
| Field | Type | Required | Description |
|---|---|---|---|
grace_days | integer | No | Grace days before a late fee |
notice_days | integer | No | Past-due notice after (days) |
final_notice_days | integer | No | Final notice after (days) |
disconnect_days | integer | No | Propose disconnection after (days) |
late_fee_flat | numeric | No | Late fee (flat) |
late_fee_pct | numeric | No | Late fee (% of past due) — The greater of the two is charged. |
late_fee_min_balance | numeric | No | No late fee below |
reconnect_fee | numeric | No | Reconnect fee |
deposit_residential | numeric | No | Deposit, residential |
deposit_commercial | numeric | No | Deposit, commercial |
high_usage_pct | integer | No | High-use exception above (% of average) |
low_usage_pct | integer | No | Low-use exception below (% of average) |
bill_due_days | integer | No | Bills due in (days) |
revenue_account_no | text | No | Utility revenue account |
deposit_account_no | text | No | Customer deposits account |
credit_account_no | text | No | Customer credit balances account |
bad_debt_account_no | text | No | Bad debt account |
public_forms_enabled | boolean | No | Take start-service and problem reports from the public |
portal_link_factor | text | No | Portal sign-up proves the bill by Allowed: either last_bill_amount postal_code |
receivable_account_no | text | No | Utility receivable account — e.g. 1170 Utility Billings Receivable. Blank: the company's accounts receivable. |
cash_account_no | text | No | Utility cash / lockbox account — Where payments, deposits and refunds go, e.g. 1040. Blank: the company's cash account. |
service_charge_account_no | text | No | Service (customer) charge account — e.g. 4410. Blank: the customer charge posts with the usage, to the revenue account. |
late_fee_account_no | text | No | Late fee account — Blank: the utility revenue account. |
reconnect_fee_account_no | text | No | Connection and reconnection fee account — e.g. 4450. Blank: the utility revenue account. |
leak_adjustment_account_no | text | No | Leak adjustment account — Blank: the leak credit reduces the revenue account the use was billed to. |
cost_center_id | uuid | No | Utility cost center — What payments, deposits and fees post under, and any plan with none of its own -- so a fund-accounting company derives the fund. |
leak_max_per_year | integer | No | Leak adjustments per account in 12 months — 0: none are made. |
leak_method | text | No | Leak credit method — excess_lowest_tier: use above normal at the lowest block rate. excess_waived: use above normal not billed. Allowed: excess_lowest_tier excess_waived |
leak_requires_approval | boolean | No | A second person approves each leak adjustment |
leak_history_bills | integer | No | Normal use: average of the last (bills) |
Sample body
{
"grace_days": 10,
"notice_days": 10
}Response 200
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"grace_days": 10,
"notice_days": 10,
"final_notice_days": 10,
"disconnect_days": 10,
"late_fee_flat": "1250.00",
"late_fee_pct": "1250.00",
"late_fee_min_balance": "1250.00",
"reconnect_fee": "1250.00",
"deposit_residential": "1250.00",
"deposit_commercial": "1250.00",
"high_usage_pct": 10,
"low_usage_pct": 10
}Sample request
curl -X PUT "https://demo.tranxact.ai/api/crm/util-settings/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"grace_days":10,"notice_days":10}'DELETE/api/crm/util-settings/{id}Delete a utility settings
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Response 200
{ "deleted": true }Many documents are cancelled or reversed instead; the API refuses a delete the screen would refuse.
Sample request
curl -X DELETE "https://demo.tranxact.ai/api/crm/util-settings/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN"GET/api/crm/util-settings/{id}/ledger-changesLedger changes
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Response
200 with the data as JSON.
Sample request
curl "https://demo.tranxact.ai/api/crm/util-settings/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/ledger-changes" \
-H "Authorization: Bearer $TOKEN"POST/api/crm/util-settings/{id}/ledger-changeLedger change
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Request body
The keys this action reads (* = required; "one of" lists the only values):
changeId, decisionResponse
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X POST "https://demo.tranxact.ai/api/crm/util-settings/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/ledger-change" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"changeId":"value","decision":"value"}'POST/api/crm/util-settings/{id}/copyCopy
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Request body
The keys this action reads (* = required; "one of" lists the only values):
overrides, preview, withLinesResponse
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X POST "https://demo.tranxact.ai/api/crm/util-settings/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/copy" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"overrides":"value","preview":"value","withLines":"value"}'Data model
Every field of a utility settings, as the API returns it. Field names are the JSON keys; any of them can be filtered and sorted on a list.
| Field | Type | Access | Description |
|---|---|---|---|
id | uuid | read only | Id |
org_id | uuid | read only | Org id |
org_unit_id | uuid | read only | Org unit id |
grace_days | integer | read, write | Grace days before a late fee |
notice_days | integer | read, write | Past-due notice after (days) |
final_notice_days | integer | read, write | Final notice after (days) |
disconnect_days | integer | read, write | Propose disconnection after (days) |
late_fee_flat | numeric | read, write | Late fee (flat) |
late_fee_pct | numeric | read, write | Late fee (% of past due) — The greater of the two is charged. |
late_fee_min_balance | numeric | read, write | No late fee below |
reconnect_fee | numeric | read, write | Reconnect fee |
deposit_residential | numeric | read, write | Deposit, residential |
deposit_commercial | numeric | read, write | Deposit, commercial |
high_usage_pct | integer | read, write | High-use exception above (% of average) |
low_usage_pct | integer | read, write | Low-use exception below (% of average) |
bill_due_days | integer | read, write | Bills due in (days) |
revenue_account_no | text | read, write | Utility revenue account |
deposit_account_no | text | read, write | Customer deposits account |
credit_account_no | text | read, write | Customer credit balances account |
bad_debt_account_no | text | read, write | Bad debt account |
public_forms_enabled | boolean | read, write | Take start-service and problem reports from the public |
portal_link_factor | text | read, write | Portal sign-up proves the bill by Allowed: either last_bill_amount postal_code |
created_at | timestamp with time zone | read only | Created at |
created_by | uuid | read only | Created by |
updated_at | timestamp with time zone | read only | Updated at |
updated_by | uuid | read only | Updated by |
receivable_account_no | text | read, write | Utility receivable account — e.g. 1170 Utility Billings Receivable. Blank: the company's accounts receivable. |
cash_account_no | text | read, write | Utility cash / lockbox account — Where payments, deposits and refunds go, e.g. 1040. Blank: the company's cash account. |
service_charge_account_no | text | read, write | Service (customer) charge account — e.g. 4410. Blank: the customer charge posts with the usage, to the revenue account. |
late_fee_account_no | text | read, write | Late fee account — Blank: the utility revenue account. |
reconnect_fee_account_no | text | read, write | Connection and reconnection fee account — e.g. 4450. Blank: the utility revenue account. |
leak_adjustment_account_no | text | read, write | Leak adjustment account — Blank: the leak credit reduces the revenue account the use was billed to. |
cost_center_id | uuid | read, write | Utility cost center — What payments, deposits and fees post under, and any plan with none of its own -- so a fund-accounting company derives the fund. |
leak_max_per_year | integer | read, write | Leak adjustments per account in 12 months — 0: none are made. |
leak_method | text | read, write | Leak credit method — excess_lowest_tier: use above normal at the lowest block rate. excess_waived: use above normal not billed. Allowed: excess_lowest_tier excess_waived |
leak_requires_approval | boolean | read, write | A second person approves each leak adjustment |
leak_history_bills | integer | read, write | Normal use: average of the last (bills) |
xf_text_1 | text | read only | Xf text 1 |
xf_text_2 | text | read only | Xf text 2 |
xf_text_3 | text | read only | Xf text 3 |
xf_text_4 | text | read only | Xf text 4 |
xf_text_5 | text | read only | Xf text 5 |
xf_num_1 | numeric | read only | Xf num 1 |
xf_num_2 | numeric | read only | Xf num 2 |
xf_num_3 | numeric | read only | Xf num 3 |
xf_date_1 | date | read only | Xf date 1 |
xf_date_2 | date | read only | Xf date 2 |
Errors
| Status | Meaning |
|---|---|
| 400 | The request could not be read: a filter that is not JSON, a bad parameter |
| 401 | No credential, or it is wrong, revoked or expired |
| 403 | The caller's roles do not hold CRM › Utility Settings for this verb, or the address or origin is not allowed |
| 404 | No record with that id is visible to the caller |
| 409 | A conflict: a duplicate number, a document in a state that does not allow it, or a record changed or locked by someone else |
| 422 | Refused by the same validation as the screen; the error names the field and why |
Every error is JSON: {"error": "a sentence saying what was wrong"}, with field where it applies.