# Get account balance history config by target type v2 Get the latest valid account balance history configuration for a specific target (organization, program, or division). # 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": { "BalanceHistoryTargetTypePath": { "name": "targetType", "in": "path", "description": "Target type of the balance history configuration", "schema": { "type": "string", "enum": [ "ORGANIZATION", "PROGRAM", "DIVISION" ] }, "required": true, "example": "ORGANIZATION" }, "BalanceHistoryTargetIdPath": { "name": "targetId", "in": "path", "description": "Target ID (either `org_id`, `program_id`, or `division_id`)", "schema": { "type": "string", "minLength": 1, "maxLength": 52 }, "required": true, "example": "my-org-123" } }, "schemas": { "BalanceHistoryConfigID": { "type": "string", "format": "uuid", "description": "Balance history configuration ID", "example": "550e8400-e29b-41d4-a716-446655440000" }, "BalanceHistoryTargetType": { "type": "string", "description": "The target type of the balance history configuration, based on the hierarchical level it applies to.", "enum": [ "ORGANIZATION", "PROGRAM", "DIVISION" ], "example": "ORGANIZATION" }, "BalanceHistoryTargetID": { "type": "string", "description": "Target ID (`org_id`, `program_id`, or `division_id`)", "minLength": 1, "maxLength": 52, "example": "my-org-123" }, "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 }, "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 }, "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" } } }, "BalanceHistoryConfigItemV2": { "description": "Balance history configuration items", "type": "object", "properties": { "id": { "$ref": "#/components/schemas/BalanceHistoryConfigID" }, "target_type": { "$ref": "#/components/schemas/BalanceHistoryTargetType" }, "target_id": { "$ref": "#/components/schemas/BalanceHistoryTargetID" }, "cycle_closing_time": { "$ref": "#/components/schemas/CycleClosingTimeV2" }, "cycle_event_delay": { "$ref": "#/components/schemas/CycleEventDelay" }, "cycle_config_validity": { "$ref": "#/components/schemas/CycleConfigValidity" } }, "required": [ "id", "target_type", "target_id", "cycle_closing_time", "cycle_event_delay", "cycle_config_validity" ] } }, "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/v2/account-balances/history/config/{targetType}/{targetId}": { "get": { "summary": "Get account balance history config by target type v2", "description": "Get the latest valid account balance history configuration for a specific target (organization, program, or division).", "operationId": "get-account-balance-history-config-by-target-v2", "tags": [ "Bank statements" ], "parameters": [ { "$ref": "#/components/parameters/BalanceHistoryTargetTypePath" }, { "$ref": "#/components/parameters/BalanceHistoryTargetIdPath" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BalanceHistoryConfigItemV2" }, "examples": { "Get config for Organization": { "value": { "id": "550e8400-e29b-41d4-a716-446655440000", "target_type": "ORGANIZATION", "target_id": "my-org", "cycle_closing_time": "23:59:59", "cycle_event_delay": 60, "cycle_config_validity": { "start": "2023-05-01T22:10:00Z" } } }, "Get config for Program": { "value": { "id": "660e8400-e29b-41d4-a716-446655440001", "target_type": "PROGRAM", "target_id": "100", "cycle_closing_time": "22:00:00", "cycle_event_delay": 30, "cycle_config_validity": { "start": "2023-04-01T22:10:00Z" } } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Invalid attribute": { "value": { "code": "WCFG0002", "message": "Invalid attribute: targetType or targetID is empty" } }, "Invalid target type": { "value": { "code": "WCFG0010", "message": "Invalid target type: must be ORGANIZATION, PROGRAM, or DIVISION" } } } } } }, "404": { "description": "Not Found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "Config not found": { "value": { "code": "WCFG0005", "message": "Config not found" } } } } } }, "500": { "$ref": "#/components/responses/500InternalServer" } } } } } } ```