updateContractBudgets

updateContractBudgets

Overview

This method updates the budget amounts, and optionally the payment method, for a contract.

By default, the billing period you nominate and all future billing periods are updated. Set update_single_period to yes to update only the nominated billing period.

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

Permissions

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

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/update https://api.{{environment}}.catch-e.com/fm/contract/budgets/update https://api.test.catch-e.com/fm/contract/budgets/update 

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)

Key

Format

Notes

Mandatory

contract_id

string

Contract Id.

Yes

payment_method

string

Targeted payment method. Applies across all item numbers. Allowed values: direct-debit, cheque, cash, credit-card, eft, other.

No

update_single_period

string

If no, all future billing periods including the nominated billing_period are updated. If yes, only the nominated billing_period is updated. Allowed values: yes, no. Default no.

No

billing_period

integer

The billing period to update. Must be specified if update_single_period is yes.

Conditional

billing_period_item_no

integer

Which item number's amount_net and amount_gst are updated for the matched billing period(s), from 1 to 255. Default 1. Does not affect the scope of the payment_method override.

No

budgets

object

The budgets to update, 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 update.

Yes

amount_gst

number

GST amount to update.

No

Example

{ "contract_id": "5678", "update_single_period": "no", "billing_period": 6, "budgets": { "FIN": { "amount_net": 260.0, "amount_gst": 26.0 } } } 

Response Details

Success

201 - Created

Field

Format

Nates

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