# Update account balance history config v2 Update the account balance history configuration. When you call this endpoint after `cycle_config_validity.start`, the new configuration is valid only after the two-cycle closing date. Example: - division timezone: UTC - Update account balance history configuration called at: `2023-05-01T18:00:00Z` - current cycle closing time: 22:00:00 - current cycle closing date: 2023-04-30 (from `2023-04-30T22:00:00Z` to `2023-05-01T22:00:00Z`) - cycle config validity start datetime of the new config: `2023-05-02T22:00:00Z` - current config stays valid until `2023-05-02T22:00:00Z` If this endpoint is called when the current datetime is less than or equal to `cycle_config_validity.start` of the most recent configuration, the new configuration overrides the the most recent configuration. Example: - division timezone: UTC - Update account balance history configuration called at: `2023-05-01T19:00:00Z` - Cycle config validity start datetime of the most recent configuration: `2023-05-02T22:00:00Z` - New config overrides the most recent configuration settings, keeping the same cycle config validity start date: `2023-05-01T22:00:00Z` This endpoint generates an [Account balance history configuration changed](https://developers.pismo.io/events/docs/account-balances-balance-history-config-change-1) event. # OpenAPI definition ```json { "openapi": "3.0.0", "info": { "title": "Banking - Transaction banking", "version": "0.9.0", "description": "Transaction banking API", "contact": { "name": "API Support", "url": "https://developers.pismo.io/support/" }, "license": { "name": "Copyright Pismo" } }, "servers": [ { "url": "https://sandbox.pismolabs.io", "description": "Sandbox API server for testing" } ], "security": [ { "BearerAuth": [] } ], "tags": [ { "name": "Bank statements", "description": "Bank statements endpoints" } ], "components": { "parameters": { "AccountBalanceConfigIdPathv2": { "name": "balanceHistoryConfigId", "in": "path", "description": "Balance history configuration ID", "schema": { "type": "string", "format": "uuid", "maxLength": 52 }, "required": true, "example": "ee665f37-340f-461e-b520-af3b1b61c6ee" } }, "schemas": { "CycleClosingTimeV2": { "type": "string", "format": "time", "description": "Cycle closing time indicates what time of day the cycle closes for a division, organization, or program. This time uses the timezone configured for the corresponding division, organization, or program.", "pattern": "^(?:([01]?\\d|2[0-3]):([0-5]?\\d):)?([0-5]?\\d)$", "example": "23:00:00", "maxLength": 8 }, "CycleEventDelay": { "type": "integer", "format": "int32", "description": "The cycle event delay specifies how many minutes after `cycle_closing_time` the account balance history event is issued for each account in the division.", "example": 15, "minimum": 5 }, "ErrorCode": { "description": "Error code\n`minLength: 1`\n`maxLength: 12`\n", "type": "string", "minLength": 1, "maxLength": 12, "example": "WPMT0017" }, "ErrorMessage": { "description": "Error message\n`minLength: 1`\n`maxLength: 1000`\n", "type": "string", "minLength": 1, "maxLength": 1000, "example": "Invalid JSON payload received: Error unmarshalling request" }, "ErrorResponse": { "type": "object", "properties": { "code": { "$ref": "#/components/schemas/ErrorCode" }, "message": { "$ref": "#/components/schemas/ErrorMessage" } } }, "UpdateAccountBalanceHistoryConfigurationRequestV2": { "description": "Update account balance history configuration request object", "type": "object", "properties": { "cycle_closing_time": { "$ref": "#/components/schemas/CycleClosingTimeV2" }, "cycle_event_delay": { "$ref": "#/components/schemas/CycleEventDelay" } } } }, "responses": { "204NoContent": { "description": "No Content" }, "500InternalServer3": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Generic internal error": { "value": { "code": "CMN9999", "message": "Internal error" } } } } } } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } }, "paths": { "/bank-statements/v2/account-balances/history/config/{balanceHistoryConfigId}": { "patch": { "summary": "Update account balance history config v2", "description": "Update the account balance history configuration.\n\nWhen you call this endpoint after `cycle_config_validity.start`, the new configuration is valid only after the two-cycle closing date.\nExample:\n - division timezone: UTC\n - Update account balance history configuration called at: `2023-05-01T18:00:00Z`\n - current cycle closing time: 22:00:00\n - current cycle closing date: 2023-04-30 (from `2023-04-30T22:00:00Z` to `2023-05-01T22:00:00Z`)\n - cycle config validity start datetime of the new config: `2023-05-02T22:00:00Z`\n - current config stays valid until `2023-05-02T22:00:00Z`\n\nIf this endpoint is called when the current datetime is less than or equal to `cycle_config_validity.start` of the most recent configuration, the new configuration overrides the the most recent configuration.\nExample:\n - division timezone: UTC\n - Update account balance history configuration called at: `2023-05-01T19:00:00Z`\n - Cycle config validity start datetime of the most recent configuration: `2023-05-02T22:00:00Z`\n - New config overrides the most recent configuration settings, keeping the same cycle config validity start date: `2023-05-01T22:00:00Z`\n\nThis endpoint generates an [Account balance history configuration changed](https://developers.pismo.io/events/docs/account-balances-balance-history-config-change-1) event.\n", "operationId": "patch-account-balances-history-configv2", "tags": [ "Bank statements" ], "parameters": [ { "$ref": "#/components/parameters/AccountBalanceConfigIdPathv2" } ], "requestBody": { "description": "Request body", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateAccountBalanceHistoryConfigurationRequestV2" }, "examples": { "Update account balances history config response": { "value": { "cycle_closing_time": "22:01:00", "cycle_event_delay": 30 } } } } } }, "responses": { "204": { "$ref": "#/components/responses/204NoContent" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Invalid JSON payload received": { "value": { "code": "WCFG0001", "message": "Invalid JSON payload received: Error unmarshalling request" } }, "Missing required parameter": { "value": { "code": "WCFG0002", "message": "Missing required parameter {id}" } }, "Missing cycle_closing_time and cycle_event_delay": { "value": { "code": "WCFG0002", "message": "cycle_closing_time or cycle_event_delay must be provided" } }, "Validation error": { "value": { "code": "WCFG0002", "message": "validation error: {message}" } }, "Invalid target type": { "value": { "code": "WCFG0010", "message": "Invalid target type" } }, "Invalid target ID": { "value": { "code": "WCFG0011", "message": "Invalid target ID" } } } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Division not found": { "value": { "code": "WCFG0003", "message": "Division not found" } }, "Account balance history config not found": { "value": { "code": "WCFG0005", "message": "Account balance history config not found" } }, "Program not found": { "value": { "code": "WCFG0006", "message": "Program not found" } }, "Organization not found": { "value": { "code": "WCFG0007", "message": "Organization not found" } } } } } }, "500": { "$ref": "#/components/responses/500InternalServer3" } } } } } } ```