{"openapi":"3.0.0","info":{"version":"v1","title":"3rd party bank transactions","description":""},"paths":{"/transactions/{cluid}":{"get":{"operationId":"getClientTransactions","tags":["public"],"description":"Get transactions by for given cluid, across all known accounts.","parameters":[{"$ref":"#/components/parameters/cluidPath"},{"$ref":"#/components/parameters/dateFromParam"},{"$ref":"#/components/parameters/dateToParam"}],"responses":{"200":{"$ref":"#/components/responses/ClientTransactions"},"default":{"$ref":"#/components/responses/ApiError"}}}},"/transactions/{cluid}/{accountNumber}":{"get":{"operationId":"getAccountTransactions","tags":["public"],"description":"Get transactions by for given cluid and account number.","parameters":[{"$ref":"#/components/parameters/cluidPath"},{"$ref":"#/components/parameters/accountNumberPath"},{"$ref":"#/components/parameters/dateFromParam"},{"$ref":"#/components/parameters/dateToParam"}],"responses":{"200":{"$ref":"#/components/responses/AccountTransactions"},"default":{"$ref":"#/components/responses/ApiError"}}},"put":{"operationId":"putAccountTransactions","tags":["private"],"description":"Replace statement transactions and balances for given cluid, account, and month.","parameters":[{"$ref":"#/components/parameters/cluidPath"},{"$ref":"#/components/parameters/accountNumberPath"},{"$ref":"#/components/parameters/dateFromParam"},{"$ref":"#/components/parameters/dateToParam"}],"requestBody":{"$ref":"#/components/requestBodies/AccountTransactions"},"responses":{"204":{"description":"Successfully stored new transactions."},"default":{"$ref":"#/components/responses/ApiError"}}}},"/aps/transactions":{"get":{"operationId":"getApsTransactions","tags":["public"],"description":"Get transactions by for given cluid, across all known accounts. Specifically exposed for APS via MW operation `GetExtractedDocument`. Parameters are passed as headers.","parameters":[{"in":"header","name":"date_from","description":"Starting date of the query, inclusive.","required":true,"schema":{"type":"string","format":"date"}},{"in":"header","name":"date_to","description":"Ending date of the query, inclusive.","required":true,"schema":{"type":"string","format":"date"}},{"in":"header","name":"cluid","required":true,"schema":{"$ref":"#/components/schemas/Cluid"}}],"responses":{"200":{"$ref":"#/components/responses/ApsTransactions"},"default":{"$ref":"#/components/responses/ApiError"}}}}},"components":{"schemas":{"Cluid":{"type":"string","description":"Unique ČS client identifier","example":"1994-12-09-17.09.04.165876","pattern":"^[\\w-.]+$","minLength":18,"maxLength":30},"Amount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"number","format":"decimal","description":"Amount in specified currency","example":1250.78},"currency":{"type":"string","description":"Currency code according to ISO 4217","example":"CZK","pattern":"^[A-Z]+$","minLength":3,"maxLength":3}}},"CzBbanValue":{"type":"string","description":"Czech BBAN - account number in format `{prefix}-{number}/{bankCode}`. \nAccount prefix, or leading zeroes, might be ommited on input, \nbut number is always properly formatted on output.","pattern":"^(\\d{1,6}-)?\\d{1,10}/\\d{4}$","example":"000019-2000145399/0800"},"CzBban":{"type":"object","description":"Czech BBAN - account number in format consisting of account prefix, account number and bank code.","required":["accountNumber","bankCode"],"properties":{"accountPrefix":{"type":"string","pattern":"^\\d{1-6}$","example":"000019"},"accountNumber":{"type":"string","pattern":"^\\d{1-10}$","example":"2000145399"},"bankCode":{"type":"string","pattern":"^\\d{4}$","example":"0800"}}},"Iban":{"type":"string","description":"IBAN, according to ISO 13616, without spaces.","minLength":10,"maxLength":40,"pattern":"^[A-Z]{2}\\d{2}[A-Z0-9]+$","example":"CZ6508000000192000145399"},"CounterPartyAccountNumber":{"type":"string","description":"Any string representing other side of the transaction. Might be BBAN, IBAN, or any arbitrary text.\nExamples:\n* \"123456-123456789/0123\"\n* \"CZ6508000000192000145399\"\n* \"4026 **** **** 1234\"","maxLength":255,"example":"123456-123456789/0123"},"ApsCounterPartyAccountNumber":{"type":"string","description":"Prefix representing transaction tpye (C for credit, D for debit) and any string representing other side of the transaction. Might be BBAN, IBAN, or any arbitrary text.\nExamples:\n* \"C123456-123456789/0123\"\n* \"DCZ6508000000192000145399\"\n* \"C4026 **** **** 1234\"","maxLength":255,"example":"123456-123456789/0123"},"EntryReference":{"type":"string","description":"Transaction identifier, assigned by a bank. Have no specific meaning or format.","maxLength":255,"example":"060-060-004-370459"},"BookingDate":{"type":"string","format":"date","description":"Date when transaction was created.","example":"2019-10-19"},"ValueDate":{"type":"string","format":"date","description":"Date when transaction was accounted for.","example":"2019-10-20"},"TransactionDescription":{"type":"string","description":"Description, possibly additional information about the transaction.","maxLength":500,"example":"8201701069595 BIC: GIBACZPXXXX; #71A# SHA ZALOHA DLE SMLOUVY O DODAVKACH,zaloha dle smlouvy o dodavkach c. 45678/2017,VS0250117002/SS0000000000/KS0000SEPA prevod"},"TransactionName":{"type":"string","description":"Name of the transaction, as specified on the statement.","example":"TRANSAKCE PLATEBNÍ KARTOU","maxLength":255},"TransactionSource":{"type":"string","description":"Source type, where the transaction was obtained.","enum":["OCR","ONLINE"],"example":"OCR"},"TransactionType":{"type":"string","description":"Identifier, whether transaction is credit or debit.","example":"CRDT","enum":["DBIT","CRDT"]},"ApiErrorResult":{"type":"object","description":"API error schema","required":["status","errors"],"properties":{"status":{"type":"integer","description":"HTTP status code, should be same as response"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ApiError"}}}},"ApiError":{"type":"object","description":"Application error","required":["error","cz-transactionId"],"properties":{"error":{"type":"string","description":"Error code","example":"MAX_VALUE"},"cz-transactionId":{"type":"string","description":"Tracing identifier","example":"1.567987.6513247876854132:5468798765132"},"scope":{"type":"string"},"dev-message":{"type":"string","description":"Exception message"},"dev-stacktrace":{"type":"string","description":"Exception stack-trace"}}},"Transaction":{"type":"object","description":"Single transaction details","required":["amount","bookingDate","source","type","valueDate"],"properties":{"amount":{"$ref":"#/components/schemas/Amount"},"bookingDate":{"$ref":"#/components/schemas/BookingDate"},"counterPartyAccountNumber":{"$ref":"#/components/schemas/CounterPartyAccountNumber"},"description":{"$ref":"#/components/schemas/TransactionDescription"},"entryReference":{"$ref":"#/components/schemas/EntryReference"},"name":{"$ref":"#/components/schemas/TransactionName"},"source":{"$ref":"#/components/schemas/TransactionSource"},"type":{"$ref":"#/components/schemas/TransactionType"},"valueDate":{"$ref":"#/components/schemas/ValueDate"},"variableSymbol":{"$ref":"#/components/schemas/VariableSymbol"},"specificSymbol":{"$ref":"#/components/schemas/SpecificSymbol"},"constantSymbol":{"$ref":"#/components/schemas/ConstantSymbol"}}},"VariableSymbol":{"type":"string","description":"Variable symbol (up to 10 digits)","maxLength":10,"minLength":1,"pattern":"^\\d+$"},"SpecificSymbol":{"type":"string","description":"Specific symbol (up to 10 digits)","maxLength":10,"minLength":1,"pattern":"^\\d+$"},"ConstantSymbol":{"type":"string","description":"Specific symbol (up to 4 digits)","maxLength":4,"minLength":1,"pattern":"^\\d+$"},"AccountBalance":{"type":"object","description":"Balance of the account on given start of the day, that is, before any transaction of that day occured.","required":["date","balance"],"properties":{"date":{"type":"string","format":"date","description":"Date for given account balance.","example":"2020-02-17"},"balance":{"$ref":"#/components/schemas/Amount"}}},"AccountTransactions":{"type":"object","description":"List of transactions and known balances for given CLUID and account.\n\nNote that `czBban` is present only for czech account numbers, while `iban` is mandatory.","required":["transactions","balances"],"properties":{"transactions":{"type":"array","description":"List of transactions, where ordering is according to `valueDate`. The order within date is significant, and should be same order as transactions are accounted for, this, however, cannot be guaranteed, as it depends on the source data ordering.","items":{"$ref":"#/components/schemas/Transaction"}},"balances":{"type":"array","description":"List of known account balances.","items":{"$ref":"#/components/schemas/AccountBalance"}}}},"AccountTransactionsWithIdentity":{"allOf":[{"type":"object","required":["cluid","iban"],"properties":{"cluid":{"$ref":"#/components/schemas/Cluid"},"iban":{"$ref":"#/components/schemas/Iban"},"czBban":{"$ref":"#/components/schemas/CzBban"}}},{"$ref":"#/components/schemas/AccountTransactions"}]},"ClientTransactions":{"type":"object","description":"List of collected client accounts, their transactions and balances.","required":["cluid","accounts"],"properties":{"cluid":{"readOnly":true,"allOf":[{"$ref":"#/components/schemas/Cluid"}]},"accounts":{"type":"array","description":"List of known accounts for given CLUID, with transactions and balances for each account.","items":{"$ref":"#/components/schemas/AccountTransactionsWithIdentity"}}}},"ApsTransaction":{"type":"object","description":"APS backward-compatible transaction definition for `GetExtractedDocument` operation.","required":["date","amount","source","type"],"properties":{"amount":{"type":"number","format":"decimal","description":"Amount in CZK","example":1250.78},"counterPartyAccountNumber":{"$ref":"#/components/schemas/ApsCounterPartyAccountNumber"},"description":{"$ref":"#/components/schemas/TransactionDescription"},"name":{"$ref":"#/components/schemas/TransactionName"},"source":{"$ref":"#/components/schemas/TransactionSource"},"transactionDate":{"$ref":"#/components/schemas/ValueDate"},"type":{"type":"string","description":"Identifier, whether transaction is card transaction or not. This information is best effort and not 100% accurate for PDF statements.","enum":["TRN_SC_CRD","TRN_SC_ACC"]}}},"ApsStartingBalance":{"type":"object","description":"APS backward-compatible account balance definition for `GetExtractedDocument` operation. It states balance at start of the day, before any transaction of that date occured.","required":["dateFrom","startingBalanceAmount"],"properties":{"dateFrom":{"type":"string","format":"date","description":"Date for given account balance.","example":"2020-02-17"},"startingBalanceAmount":{"type":"number","format":"decimal","description":"Amount in CZK","example":1250.78}}},"ApsTransactions":{"type":"object","description":"APS backward-compatible response for `GetExtractedDocument` operation.","required":["accounts"],"properties":{"accounts":{"type":"array","description":"List of transactions and balances per account number.","items":{"type":"object","required":["startingBalances","transactions"],"properties":{"accountNumber":{"type":"string","description":"Czech BBAN, or foreign IBAN prefixed with A."},"startingBalances":{"type":"array","items":{"$ref":"#/components/schemas/ApsStartingBalance"}},"transactions":{"type":"array","description":"List of transactions, where ordering is according to `transactionDate`. The order within date is significant, and should be same order as transactions are accounted for, this, however, cannot be guaranteed, as it depends on the source data ordering.","items":{"$ref":"#/components/schemas/ApsTransaction"}}}}}}}},"parameters":{"cluidPath":{"name":"cluid","in":"path","description":"CLUID, ČS client identifier","required":true,"schema":{"$ref":"#/components/schemas/Cluid"}},"accountNumberPath":{"name":"accountNumber","in":"path","description":"IBAN or czech BBAN. Note that slash must be properly URL encoded.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/Iban"},{"$ref":"#/components/schemas/CzBbanValue"}]},"example":"CZ6508000000192000145399"},"dateFromParam":{"name":"dateFrom","in":"query","required":true,"description":"Starting date of the query, inclusive.","schema":{"type":"string","format":"date","example":"2019-08-14"}},"dateToParam":{"name":"dateTo","in":"query","required":true,"description":"Ending date of the query, inclusive.","schema":{"type":"string","format":"date","example":"2020-02-14"}}},"requestBodies":{"AccountTransactions":{"description":"Statement for given cluid, account number and period.","required":true,"content":{"application/x.outertrn.account-transactions+json":{"schema":{"$ref":"#/components/schemas/AccountTransactions"}}}}},"responses":{"ApiError":{"description":"An error occurred","content":{"application/x.outertrn.error+json":{"schema":{"$ref":"#/components/schemas/ApiErrorResult"}}}},"AccountTransactions":{"description":"List of transactions for given cluid and account number.","content":{"application/x.outertrn.account-transactions+json":{"schema":{"$ref":"#/components/schemas/AccountTransactionsWithIdentity"}}}},"ClientTransactions":{"description":"List of transactions for one cluid, grouped by account number.","content":{"application/x.outertrn.client-transactions+json":{"schema":{"$ref":"#/components/schemas/ClientTransactions"}}}},"ApsTransactions":{"description":"List of transactions for one CLUID, grouped by account number, in specific format for MW operation `GetExtractedDocument`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApsTransactions"}}}}}}}