# Create account balance history config v1 Create an account balance history configuration by division code. The configuration becomes effective on the day after the cycle closing time plus the cycle event delay. Example: - Division timezone: `UTC` - Create account balance history configuration is called at: `2023-05-01T18:00:00Z` - Account balance history configuration `cycle_closing_time` is: `22:00:00` - Account balance history configuration `cycle_event_delay` is: `10` - Account balance history configuration starts at `2023-05-01T22:10:00Z` This endpoint generates an [Account balance history configuration created](https://developers.pismo.io/events/docs/account-balances-balance-history-config-creation-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": { "schemas": { "CreateAccountBalanceHistoryConfigurationRequest": { "description": "Create account balance history configuration request object", "type": "object", "properties": { "division_code": { "$ref": "#/components/schemas/DivisionCode2" }, "cycle_closing_time": { "$ref": "#/components/schemas/CycleClosingTime" }, "cycle_event_delay": { "$ref": "#/components/schemas/CycleEventDelay" } }, "required": [ "division_code", "cycle_closing_time", "cycle_event_delay" ] }, "CreateAccountBalanceHistoryConfigurationResponse": { "description": "Get account balance history configuration response object", "type": "object", "properties": { "cycle_closing_time": { "$ref": "#/components/schemas/CycleClosingTime" }, "cycle_event_delay": { "$ref": "#/components/schemas/CycleEventDelay" }, "cycle_config_validity": { "$ref": "#/components/schemas/CycleConfigValidity" } } }, "CycleClosingTime": { "type": "string", "format": "time", "description": "Time of day the cycle closes for a division. This time follows the timezone configured in division. You can find the division timezone using the [Get division by code](https://developers.pismo.io/pismo-docs/reference/get-division-by-code-v2) endpoint.", "pattern": "^(?:([01]?\\d|2[0-3]):([0-5]?\\d):)?([0-5]?\\d)$", "example": "22:00:00", "maxLength": 8 }, "CycleConfigValidity": { "type": "object", "description": "The start and end date/time indicating when the cycle configuration becomes valid or invalid.\n", "properties": { "start": { "type": "string", "format": "datetime", "description": "The date and time when the configuration becomes valid. Format = `yyyy-mm-dd:hr:mm:ss`.", "example": "2023-04-01T22:10:00Z" }, "end": { "type": "string", "format": "datetime", "description": "The date and time when the configuration ends. Format = `yyyy-mm-dd:hr:mm:ss`.", "example": "2023-05-01T22:10:00Z" } } }, "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 }, "DivisionCode2": { "type": "string", "description": "Division code registered in the [Create division](https://developers.pismo.io/pismo-docs/reference/post-division-v2) endpoint.", "maximum": 36, "example": "US" }, "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" } } } }, "responses": { "500InternalServer": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Generic internal error": { "value": { "code": "ECMN9999", "message": "Internal error" } } } } } } }, "securitySchemes": { "BearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" } } }, "paths": { "/bank-statements/v1/account-balances/history/config": { "post": { "summary": "Create account balance history config v1", "description": "Create an account balance history configuration by division code.\n\nThe configuration becomes effective on the day after the cycle closing time plus the cycle event delay.\nExample:\n - Division timezone: `UTC`\n - Create account balance history configuration is called at: `2023-05-01T18:00:00Z`\n - Account balance history configuration `cycle_closing_time` is: `22:00:00`\n - Account balance history configuration `cycle_event_delay` is: `10`\n - Account balance history configuration starts at `2023-05-01T22:10:00Z`\n\nThis endpoint generates an [Account balance history configuration created](https://developers.pismo.io/events/docs/account-balances-balance-history-config-creation-1) event.", "operationId": "post-account-balance-history-configuration", "tags": [ "Bank statements" ], "requestBody": { "description": "Request body", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAccountBalanceHistoryConfigurationRequest" }, "examples": { "Create account balance history configuration": { "value": { "division_code": "my-division", "cycle_closing_time": "22:00:00", "cycle_event_delay": 15 } } } } } }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAccountBalanceHistoryConfigurationResponse" }, "examples": { "Created account balance history configuration successfully": { "value": { "cycle_closing_time": "22:00:00", "cycle_event_delay": 10, "cycle_config_validity": { "start": "2023-05-01T22:10:00Z" } } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "division_code is a required field": { "value": { "code": "WCFG0002", "message": "division_code is a required field" } }, "division_code exceed size": { "value": { "code": "WCFG0002", "message": "division_code must be a maximum of 36 characters in length" } }, "cycle_closing_time is a required field": { "value": { "code": "WCFG0002", "message": "cycle_closing_time is a required field" } }, "cycle_closing_time exceed size": { "value": { "code": "WCFG0002", "message": "cycle_closing_time must be a maximum of 8 characters in length" } }, "cycle_closing_time invalid time format": { "value": { "code": "WCFG0002", "message": "cycle_closing_time has an invalid time format: {cycle_closing_time}" } }, "cycle_event_delay is a required field": { "value": { "code": "WCFG0002", "message": "cycle_event_delay is a required field" } }, "cycle_event_delay must be 5 minutes or greater": { "value": { "code": "WCFG0002", "message": "cycle_event_delay must be 5 or greater" } }, "cycle_event_delay exceed maximum minutes": { "value": { "code": "WCFG0002", "message": "cycle_event_delay must be 1,439 or less" } }, "Invalid JSON payload received": { "value": { "code": "WCFG0001", "message": "Invalid JSON payload received: Error unmarshalling request" } } } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Division not found": { "value": { "code": "WCFG0003", "message": "Division not found" } } } } } }, "409": { "description": "Conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Division already configured": { "value": { "code": "WCFG0004", "message": "Division already configured" } } } } } }, "500": { "$ref": "#/components/responses/500InternalServer" } } } } } } ```