Updating a Current Account Transaction
Description
Used to update an existing current account transaction. The record to be updated is found by referencing either the UpdateErpCode (current ERP code) or the Id (system ID) fields sent in the request body. The new ERP code of the record is set via the erpCode field in the request body.
- Endpoint:
/cat/cat - Method:
PUT
Request Example
- Header:
Authorization: Bearer {token}, Content-Type: application/json - Body:
JSON
Request Body
| Field | Required | Format | Description / Validation |
|---|---|---|---|
UpdateErpCode | Conditional | String | The current ERP code of the record to be updated. This field is required if the Id field is empty. |
Id | Conditional | Guid | The unique system ID of the record to be updated. This field is required if the UpdateErpCode field is empty. |
AgentErpCode | Yes | String | The ERP code of the related agent. Cannot be empty. |
amount | Yes | Decimal | The new debt amount. Must be (> 0). |
paidAmount | No | Decimal | The paid amount. Must be a positive number. Cannot be greater than amount. |
documentNo | Yes | String | The new document number. Cannot be empty. |
currentAccountErpCode | Yes | String[] | The ERP code of the current account. Cannot be empty. |
currentAccountTransactionType | Yes | String (Enum) | Must be one of the following values: "Promissory Note", "Cheque", "Credit Card", "Debt Receipt", "Invoice", "Wire Transfer", "Order", "Carryover", "Transfer". |
dueDate | Yes | DateTime | The new due date (ISO 8601: YYYY-MM-DD). |
transactionDate | Yes | DateTime | The new transaction date (ISO 8601: YYYY-MM-DD). Cannot be later than the dueDate. |
currencyId | Yes | String | Currency code (e.g., "TRY"). Must be defined in the system. |
erpCode | Yes | String | The new or updated ERP code of the transaction. Cannot be empty. |
description | No | String | The new transaction description. |
Business Rules and Notes
- Reference Identification: To update a record, you must send at least one of the
UpdateErpCodeorIdfields. If both are left empty, the request will receive a400 Bad Requesterror. - Record Not Found: If no transaction matching the provided
UpdateErpCodeorIdis found in the system, a404 Not Founderror is returned. - ERP Code Management: While
UpdateErpCodeis used to locate the record to be updated, theerpCodefield specifies the new ERP code of this record. If you do not want to change the ERP code, you can send the same value in both fields. - Duplicate ERP Code: If the new
erpCodeyou want to assign is already used by another record (excluding the record being updated), the system returns a409 Conflicterror. - Date Validation: The
transactionDatefield cannot be later than thedueDatefield.
- Successful Request
- Successful Response
- Sample cURL
{
"agentErpCode": "NT26822394",
"amount": 4500,
"paidAmount": 0,
"documentNo": "DemoTest",
"currentAccountErpCode": "441B3BF1-8F5F-4CCD-A116-7CD90D3E4C04",
"documentType": "Senet",
"dueDate": "2025-08-05T07:51:00.157Z",
"transactionDate": "2025-08-05T07:51:00.157Z",
"currencyCode": "USD",
"description": "test test",
"updateErpCode": "7044dac0-bbb3-4845-a316-702e2702b1673",
"erpCode":"12001450"
}
{
"result": {
"erpCode": "12001450",
"createdAt": "2025-10-01T16:06:08.2428899+03:00"
},
"status": "success",
"message": "Current account transaction updated."
}
curl --location --request PUT 'https://prodtest_gw.finrota.com/cat/cat' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJlcnB2MS5hcGkiLCJjYXR2MS5hcGkiLCJ2ZW5kb3J2MS5hcGkiXSwiYWN0b3J0Ijoic2VydmljZSIsInJvbGUiOiJzZXJ2aWNlIiwiVW5pcXVlIjoiMjBhZmRmZTctYjdiZi00N2UyLWJhYzQtYjQ5YThjNGJiMDc5IiwiVGVuYW50SWQiOiI2NzA2ODNjMS0yZmUwLTQ4NDYtODdiMi02Y2JhOWI3OTNhYjIiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL2V4cGlyYXRpb24iOiI2Mzg5NTA5MTIxMjczOTI1ODciLCJuYmYiOjE3NTkzMjE2MTIsImV4cCI6MTc1OTQ5NDQxMiwiaWF0IjoxNzU5MzIxNjEyLCJpc3MiOiJzc28uYXBpIiwiYXVkIjoiZWNvenVtLnNzbyJ9.5lyBbGfKMzfQZJ5Rz73rR254oy7ne_xGpEBDr7lTtPk' \
--data '{
"agentErpCode": "NT26822394",
"amount": 4500,
"paidAmount": 0,
"documentNo": "DemoTest",
"currentAccountErpCode": "441B3BF1-8F5F-4CCD-A116-7CD90D3E4C04",
"documentType": "Senet",
"dueDate": "2025-08-05T07:51:00.157Z",
"transactionDate": "2025-08-05T07:51:00.157Z",
"currencyCode": "USD",
"description": "test test",
"updateErpCode": "7044dac0-bbb3-4845-a316-702e2702b1673",
"erpCode":"12001450"
}'