insertContractBudgets

insertContractBudgets

Overview

This method inserts new budget entries for one or more contracts, for example adjustment entries.

If the contract has a suspend date, a ContractSuspended 422 validation error is returned, unless the fm / invoice_suspended_contracts_flag global control is set to yes. In that case, an adjustment can be inserted on a suspended (or terminated) contract.

This method requires the ContractBudgets:Insert permission to be associated with your role.

Permissions

The permission for this api is stored in [gb_api_permissions]permission as 'ContractBudgets:Insert'.

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

HTTP Method

Use the HTTP Method 'POST' for consuming this web service.

URL Examples

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

Input Fields (Header)

Key

Format

Notes

Mandatory

Audit-User-Id

string

(Optional) User Id to use for audit purposes. Up to 5 digits. Requires the Audit:UserIdOverride permission.

No

Input Fields (JSON)

Send an array of budget entries.

Key

Format

Notes

Mandatory

contract_id

string

Contract Id.

Yes

billing_period

integer

Billing period.

Yes

billing_period_item_no

integer

Item number distinguishing multiple budget entries within the same contract_id and billing_period (e.g. adjustment entries), from 1 to 255. Defaults to the next available value (current maximum + 1).

No

payment_method

string

Allowed values: direct-debit, cheque, cash, credit-card, eft, other.

No

billing_date

string (date)

Billing date, in yyyy-MM-dd format.

No

budgets

object

The budgets to insert, by posting class code. See budgets below.

No

budgets

The budgets object uses each posting class code as a property name (for example FIN, MAINT, REG). Each property holds the amounts for that posting class:

Key

Format

Notes

Mandatory

amount_net

number

Net amount to insert. Up to 2 decimal places. Default 0.

No

amount_gst

number

GST amount to insert. Up to 2 decimal places. Default 0. If not passed and amount_net is 0.00 or not passed, this is set to 0.00. If amount_net is passed, GST is calculated using Global Controls.

No

Example

[ { "contract_id": "5678", "billing_period": 3, "billing_date": "2026-03-12", "payment_method": "direct-debit", "budgets": { "FIN": { "amount_net": -50.0, "amount_gst": -5.0 }, "MAINT": { "amount_net": 20.0 } } } ] 

Response Details

Success

201 - Created

Field

Format

Notes

affected_records

integer

The number of budget rows affected.

{ "affected_records": 4 } 

Error Response Details

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

403 - Forbidden

- You do not have permissions for this request. - Go to System Roles and enter 'web_services' - Navigate to the Roles / APIs tab to make sure the permission you need to run this API is checked.

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

Validation Message

Comments

406 - Not Acceptable

The Accept header of the request does not match a response format this API supports.

{ "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

The Content-Type of the request is not supported by this API.

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

Validation Message

Comments

422 - Unprocessable Entity

One or more input fields failed validation. The field name and message are returned in validation_messages.

{ "warning_messages": {}, "validation_messages": { "fieldName": { "validationExceptionCode": "A textual description of the validation exception" } }, "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html", "title": "Unprocessable Entity", "status": 422, "detail": "Failed Validation" } 

Validation Message

Comments

423 - Locked

The contract is locked by another process or user.

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

Validation Message

Comments

500 - Internal Error

An unexpected error occurred on the server.

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

Validation Message

Comments

default - Unexpected Error

Any other unexpected error.

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