getContractBilling & getContractBillings

getContractBilling & getContractBillings

Overview

Retrieve a Contract's posted Billing/Invoice line items (fm_billing) — the same invoice and batch reference data shown on the Billing/Re-Print screen. This covers what has actually been billed against a contract, rather than what's scheduled (that's covered separately by getContractBudgets).

Two methods are available:

  • getContractBilling — retrieve a single billing record by billing_id

  • getContractBillings — retrieve a filterable, paginated collection of billing records, optionally scoped to one contract

Both methods require the ContractBilling:Get permission to be associated with your role.

Permissions

The permission for these APIs is stored in [gb_api_permissions]permission as ContractBilling:Get.

Only roles with a stored link to this permission in [gb_role_api_permissions] can run these APIs.


getContractBilling

Retrieve a single Contract billing record.

HTTP Method

Use the HTTP Method GET for consuming this web service.

URL Examples

https://api.demo.catch-e.com/fm/contract/billings/{billing_id} 
https://api.{{environment}}.catch-e.com/fm/contract/billings/{billing_id} https://api.test.catch-e.com/fm/contract/billings/{billing_id} 

Path Parameters

Key

Format

Notes

Mandatory

billing_id

string

Positive integer, no leading zeros (e.g. 1, 2401). Must match fm_billing.billing_id.

Yes

Response Details

Success

200 OK

{ "_links": { "self": { "href": "https://api.catch-e.loc/fm/contract/billings/2401" } }, "billing_id": "2401", "invoice_type": "periodic lease", "invoice_no": "string", "invoice_item_no": 0, "contract_id": "string", "posting_class_id": "string", "vmrs_code_id": "string", "batch_no": "string", "item_no": 0, "gst_code_id": "string", "invoice_date": "2026-07-25", "invoice_from_date": "2026-07-25", "invoice_to_date": "2026-08-24", "amount_net": 0, "amount_gst": 0, "received_gross": 0, "posted_date": "2026-07-25", "credit_note_flag": "no", "status_flag": "posted", "client_id": "string", "cost_centre": "string", "reg_no": "string", "driver": "string", "description": "string", "contact_name": "string", "allocation_flag": "no" } 

Only fields defined by the ContractBilling schema are returned, with data types cast per Fm\Billing::$_explicitFieldDataTypes — monetary fields as numbers, identifiers and dates as strings. History-only, pending, and posted records are all returned; only deleted records are excluded.

Error Response Details

Validation Message

Comments

404 Not Found

billing_id is malformed — not a positive integer with no leading zeros (e.g. abc, 0, 01, -1, 1.5, empty). Requesting the endpoint with no ID routes instead to getContractBillings.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Not Found", "status": 404, "detail": "Not Found" } 

Validation Message

Comments

403 Forbidden

You do not have the ContractBilling:Get permission. The response does not reveal whether the record exists.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Forbidden", "status": 403, "detail": "Forbidden" } 

Validation Message

Comments

422 - Unprocessable Entity

The supplied billing_id is validly formatted but does not exist.

{ "validation_messages": { "billing_id": { "notExists": "Billing Id does not exist" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" } 

Validation Message

Comments

422 - Unprocessable Entity

The record has been soft-deleted. This message is distinct from "Billing Id does not exist" and deleted records are never returned.

{ "validation_messages": { "billing_id": { "deleted": "No matching billing record found" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" } 

getContractBillings

Retrieve billing records across one or all contracts, with optional filters and pagination.

HTTP Method

Use the HTTP Method GET for consuming this web service.

URL Examples

https://api.demo.catch-e.com/fm/contract/billings 
https://api.{{environment}}.catch-e.com/fm/contract/billings?contract_id={contract_id} 
https://api.test.catch-e.com/fm/contract/billings?contract_id={contract_id}&client_id={client_id}&invoice_type={invoice_type} 

Query Parameters

Key

Format

Notes

Mandatory

contract_id

string

Scopes results to one contract. Omit to retrieve non-deleted billing records across all contracts.

No

client_id

string

Filters to a client. Combinable with other filters (AND semantics).

No

invoice_no

string

Filters by invoice number.

No

batch_no

string

Filters by batch number.

No

invoice_type

string

e.g. initial, periodic lease, periodic fee, recharge, credit, sale.

No

invoice_start_date

date

Inclusive lower bound against invoice_date.

No

invoice_end_date

date

Inclusive upper bound against invoice_date.

No

page

integer

Defaults to 1 if omitted.

No

page_size

integer

Defaults to 25 if omitted.

No

All filters can be combined with each other and with contract_id; results must match every supplied filter.

Response Details

Success

200 OK

{ "_links": { "self": { "href": "https://api.catch-e.loc/fm/contract/billings?contract_id=100000" } }, "_embedded": { "fm_billings": [ { "billing_id": "string", "invoice_type": "string", "invoice_no": "string", "invoice_item_no": 0, "contract_id": "string", "posting_class_id": "string", "vmrs_code_id": "string", "batch_no": "string", "item_no": 0, "gst_code_id": "string", "invoice_date": "2026-07-25", "invoice_from_date": "2026-07-25", "invoice_to_date": "2026-08-24", "amount_net": 0, "amount_gst": 0, "received_gross": 0, "posted_date": "2026-07-25", "credit_note_flag": "no", "status_flag": "string", "client_id": "string", "cost_centre": "string", "reg_no": "string", "driver": "string", "description": "string", "contact_name": "string", "allocation_flag": "no" } ] }, "page_count": 1, "page_size": 25, "total_items": 1, "page": 1 } 

Deleted records are always excluded; posted, pending, and history-only records are all returned — there is no status filter. A valid query with no matching records returns 200 OK with an empty _embedded.fm_billings array, total_items: 0, and page_count: 0 — this is not treated as an error.

Error Response Details

Validation Message

Comments

403 Forbidden

You do not have the ContractBilling:Get permission. No billing data is returned.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Forbidden", "status": 403, "detail": "Forbidden" } 

Validation Message

Comments

422 - Unprocessable Entity

The supplied contract_id does not exist.

{ "validation_messages": { "contract_id": { "notExists": "Contract Id does not exist" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" } 

Validation Message

Comments

422 - Unprocessable Entity

One or more filter values are invalid (e.g. non-existent invoice_no, batch_no, or client_id; invalid invoice_type; malformed invoice_start_date, invoice_end_date, page, or page_size). The offending parameter is named before any query executes — no partial result set is returned.

{ "validation_messages": { "invoice_type": { "invalid": "Invalid invoice type" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" } 

Standard Error Responses

These apply to both getContractBilling and getContractBillings.

Validation Message

Comments

401 Unauthorized

1. You have not authenticated before running this API, or 2. The token_timeout of the current session has passed. You need to authenticate again.

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unauthorized", "status": 401, "detail": "Unauthorized" } 

Validation Message

Comments

406 - Not Acceptable

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Not Acceptable", "status": 406, "detail": "Not Acceptable" } 

Validation Message

Comments

415 - Unsupported Media Type

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unsupported Media Type", "status": 415, "detail": "Not Acceptable" } 

Validation Message

Comments

500 - Internal Error

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "string", "status": 599, "detail": "string" } 

Validation Message

Comments

default - Unexpected Error

{ "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "string", "status": 599, "detail": "string" }