Skip to content

fastbill/go-finapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go finAPI

This package provides a finAPI SDK for Go. It was created via OpenAPI Generator as described in the finAPI documentation. Additionally some wrapper code was added to improve the usability.

  • API version: 1.151.1
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen
  • OpenAPI Generator Version 5.0.1

For more information, please visit https://www.finapi.io/impressumrechtlicher-hinweis

Table of Contents

Usage

import ( 
    "github.com/fastbill/go-finapi/v6"
)


config := finapi.ClientConfig{
    Endpoint: "",
    ClientID: "",
    ClientSecret: "",
}
client := finapi.NewClient(config)

// Use a client context to perform actions like creating new users.
ctx, err := client.NewClientContext()
// handle error
newUser := finapimodel.UserCreateParams{
    Email: "",
    Password: "",
    IsAutoUpdateEnabled: true,
}
user, res, err := client.UsersApi.CreateUser(ctx, newUser)

// Use a user context for user based actions like connection banks etc.
userCtx, err := client.NewUserContext("put finapi user id here", "put user password here")
// handle error

Documentation for API Endpoints

All URIs are relative to https://sandbox.finapi.io

Class Method HTTP request Description
AccountsApi DeleteAccount Delete /api/v1/accounts/{id} Delete an account
AccountsApi DeleteAllAccounts Delete /api/v1/accounts Delete all accounts
AccountsApi EditAccount Patch /api/v1/accounts/{id} Edit an account
AccountsApi ExecuteSepaDirectDebit Post /api/v1/accounts/executeSepaDirectDebit Execute SEPA Direct Debit
AccountsApi ExecuteSepaMoneyTransfer Post /api/v1/accounts/executeSepaMoneyTransfer Execute SEPA Money Transfer
AccountsApi GetAccount Get /api/v1/accounts/{id} Get an account
AccountsApi GetAndSearchAllAccounts Get /api/v1/accounts Get and search all accounts
AccountsApi GetDailyBalances Get /api/v1/accounts/dailyBalances Get daily balances
AccountsApi GetMultipleAccounts Get /api/v1/accounts/{ids} Get multiple accounts
AccountsApi RequestSepaDirectDebit Post /api/v1/accounts/requestSepaDirectDebit Request SEPA Direct Debit
AccountsApi RequestSepaMoneyTransfer Post /api/v1/accounts/requestSepaMoneyTransfer Request SEPA Money Transfer
AuthorizationApi GetToken Post /oauth/token Get tokens
AuthorizationApi RevokeToken Post /oauth/revoke Revoke a token
BankConnectionsApi ConnectInterface Post /api/v1/bankConnections/connectInterface Connect a new interface
BankConnectionsApi DeleteAccessData Delete /api/v1/bankConnections/{id}/aisConsent Delete a consent
BankConnectionsApi DeleteAllBankConnections Delete /api/v1/bankConnections Delete all bank connections
BankConnectionsApi DeleteBankConnection Delete /api/v1/bankConnections/{id} Delete a bank connection
BankConnectionsApi EditBankConnection Patch /api/v1/bankConnections/{id} Edit a bank connection
BankConnectionsApi GetAllBankConnections Get /api/v1/bankConnections Get all bank connections
BankConnectionsApi GetBankConnection Get /api/v1/bankConnections/{id} Get a bank connection
BankConnectionsApi GetMultipleBankConnections Get /api/v1/bankConnections/{ids} Get multiple bank connections
BankConnectionsApi ImportBankConnection Post /api/v1/bankConnections/import Import a new bank connection
BankConnectionsApi RemoveInterface Post /api/v1/bankConnections/removeInterface Remove an interface
BankConnectionsApi UpdateBankConnection Post /api/v1/bankConnections/update Update a bank connection
BanksApi GetAndSearchAllBanks Get /api/v1/banks Get and search all banks
BanksApi GetBank Get /api/v1/banks/{id} Get a bank
BanksApi GetMultipleBanks Get /api/v1/banks/{ids} Get multiple banks
CategoriesApi CreateCategory Post /api/v1/categories Create a new category
CategoriesApi DeleteAllCategories Delete /api/v1/categories Delete all categories
CategoriesApi DeleteCategory Delete /api/v1/categories/{id} Delete a category
CategoriesApi EditCategory Patch /api/v1/categories/{id} Edit a category
CategoriesApi GetAndSearchAllCategories Get /api/v1/categories Get and search all categories
CategoriesApi GetCashFlows Get /api/v1/categories/cashFlows Get cash flows
CategoriesApi GetCategory Get /api/v1/categories/{id} Get a category
CategoriesApi GetMultipleCategories Get /api/v1/categories/{ids} Get multiple categories
CategoriesApi TrainCategorization Post /api/v1/categories/trainCategorization Train categorization
ClientConfigurationApi EditClientConfiguration Patch /api/v1/clientConfiguration Edit client configuration
ClientConfigurationApi GetClientConfiguration Get /api/v1/clientConfiguration Get client configuration
LabelsApi CreateLabel Post /api/v1/labels Create a new label
LabelsApi DeleteAllLabels Delete /api/v1/labels Delete all labels
LabelsApi DeleteLabel Delete /api/v1/labels/{id} Delete a label
LabelsApi EditLabel Patch /api/v1/labels/{id} Edit a label
LabelsApi GetAndSearchAllLabels Get /api/v1/labels Get and search all labels
LabelsApi GetLabel Get /api/v1/labels/{id} Get a label
LabelsApi GetMultipleLabels Get /api/v1/labels/{ids} Get multiple labels
MandatorAdministrationApi ChangeClientCredentials Post /api/v1/mandatorAdmin/changeClientCredentials Change client credentials
MandatorAdministrationApi CreateIbanRules Post /api/v1/mandatorAdmin/ibanRules Create IBAN rules
MandatorAdministrationApi CreateKeywordRules Post /api/v1/mandatorAdmin/keywordRules Create keyword rules
MandatorAdministrationApi DeleteIbanRules Post /api/v1/mandatorAdmin/ibanRules/delete Delete IBAN rules
MandatorAdministrationApi DeleteKeywordRules Post /api/v1/mandatorAdmin/keywordRules/delete Delete keyword rules
MandatorAdministrationApi DeleteUsers Post /api/v1/mandatorAdmin/deleteUsers Delete users
MandatorAdministrationApi GetIbanRuleList Get /api/v1/mandatorAdmin/ibanRules Get IBAN rules
MandatorAdministrationApi GetKeywordRuleList Get /api/v1/mandatorAdmin/keywordRules Get keyword rules
MandatorAdministrationApi GetUserList Get /api/v1/mandatorAdmin/getUserList Get user list
MocksAndTestsApi CheckCategorization Post /api/v1/tests/checkCategorization Check categorization
MocksAndTestsApi MockBatchUpdate Post /api/v1/tests/mockBatchUpdate Mock batch update
NotificationRulesApi CreateNotificationRule Post /api/v1/notificationRules Create a new notification rule
NotificationRulesApi DeleteAllNotificationRules Delete /api/v1/notificationRules Delete all notification rules
NotificationRulesApi DeleteNotificationRule Delete /api/v1/notificationRules/{id} Delete a notification rule
NotificationRulesApi GetAndSearchAllNotificationRules Get /api/v1/notificationRules Get and search all notification rules
NotificationRulesApi GetNotificationRule Get /api/v1/notificationRules/{id} Get a notification rule
PaymentsApi CreateDirectDebit Post /api/v1/payments/directDebits Create direct debit
PaymentsApi CreateMoneyTransfer Post /api/v1/payments/moneyTransfers Create money transfer
PaymentsApi GetPayments Get /api/v1/payments Get payments
PaymentsApi SubmitPayment Post /api/v1/payments/submit Submit payment
SecuritiesApi GetAndSearchAllSecurities Get /api/v1/securities Get and search all securities
SecuritiesApi GetMultipleSecurities Get /api/v1/securities/{ids} Get multiple securities
SecuritiesApi GetSecurity Get /api/v1/securities/{id} Get a security
StandingOrdersApi CreateStandingOrder Post /api/v1/standingOrders Create a standing order
StandingOrdersApi GetStandingOrders Get /api/v1/standingOrders Get standing orders
StandingOrdersApi SubmitStandingOrder Post /api/v1/standingOrders/submit Submit standing order
TPPCertificatesApi CreateNewCertificate Post /api/v1/tppCertificates Upload TPP certificate
TPPCertificatesApi DeleteCertificate Delete /api/v1/tppCertificates/{id} Delete a TPP certificate
TPPCertificatesApi GetAllCertificates Get /api/v1/tppCertificates Get all TPP certificates
TPPCertificatesApi GetCertificate Get /api/v1/tppCertificates/{id} Get a TPP certificate
TPPCredentialsApi CreateTppCredential Post /api/v1/tppCredentials Upload TPP credentials
TPPCredentialsApi DeleteTppCredential Delete /api/v1/tppCredentials/{id} Delete a set of TPP credentials
TPPCredentialsApi EditTppCredential Patch /api/v1/tppCredentials/{id} Edit a set of TPP credentials
TPPCredentialsApi GetAllTppCredentials Get /api/v1/tppCredentials Get all TPP credentials
TPPCredentialsApi GetAndSearchTppAuthenticationGroups Get /api/v1/tppCredentials/tppAuthenticationGroups Get all TPP Authentication Groups
TPPCredentialsApi GetTppCredential Get /api/v1/tppCredentials/{id} Get a set of TPP credentials
TransactionsApi DeleteAllTransactions Delete /api/v1/transactions Delete all transactions
TransactionsApi DeleteTransaction Delete /api/v1/transactions/{id} Delete a transaction
TransactionsApi EditMultipleTransactions Patch /api/v1/transactions Edit multiple transactions
TransactionsApi EditMultipleTransactionsDeprecated Patch /api/v1/transactions/{ids} Edit multiple transactions (DEPRECATED)
TransactionsApi EditTransaction Patch /api/v1/transactions/{id} Edit a transaction
TransactionsApi GetAndSearchAllTransactions Get /api/v1/transactions Get and search all transactions
TransactionsApi GetMultipleTransactions Get /api/v1/transactions/{ids} Get multiple transactions
TransactionsApi GetTransaction Get /api/v1/transactions/{id} Get a transaction
TransactionsApi RestoreTransaction Post /api/v1/transactions/{id}/restore Restore a transaction
TransactionsApi SplitTransaction Post /api/v1/transactions/{id}/split Split a transaction
TransactionsApi TriggerCategorization Post /api/v1/transactions/triggerCategorization Trigger categorization
UsersApi CreateUser Post /api/v1/users Create a new user
UsersApi DeleteAuthorizedUser Delete /api/v1/users Delete the authorized user
UsersApi DeleteUnverifiedUser Delete /api/v1/users/{userId} Delete an unverified user
UsersApi EditAuthorizedUser Patch /api/v1/users Edit the authorized user
UsersApi ExecutePasswordChange Post /api/v1/users/executePasswordChange Execute password change
UsersApi GetAuthorizedUser Get /api/v1/users Get the authorized user
UsersApi GetVerificationStatus Get /api/v1/users/verificationStatus Get a user's verification status
UsersApi RequestPasswordChange Post /api/v1/users/requestPasswordChange Request password change
UsersApi VerifyUser Post /api/v1/users/verify/{userId} Verify a user
WebFormsApi GetWebForm Get /api/v1/webForms/{id} Get a Web Form

Documentation For Models

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat64
  • PtrFloat64
  • PtrString
  • PtrTime

How to Update This SDK

  1. Download the newest version of the official SDK from docs.finapi.io. Select "finAPI Access (with deprecation)" from the product selection. Than click the download button on the top of the page and select "go" as language.
  2. Save the zip file you get there to some place on your PC and extract it. Open the folder go-client.
  3. In the current SDK folder, delete everything besides README.md, LICENSE and finapi.go. Then copy everything besides gitpush.sh and dot files from the new SDK that you downloaded into your existing repository.
  4. Replace all occurances of package io.finapi.access with package finapi besides the one in this README file.
  5. Revert the module name in the go.mod file to the one you had before. Consider increasing the major version in case you expect breaking changes from the update.
  6. Fix compiliation errors if there are some (e.g. the NewTransaction struct might need to be renamed to ExtendedTransaction to avoid a naming collision). In case you see a lot of compilation errors of the type ... redeclared in the block for enum equivalents, it is best to genereate the SDK yourself (see instructions below) and start again at step 3 afterwards.
  7. In the file client.go make sure to keep the following change for the serialization of the OpenAPI error (either revert the change from copying the file or just paste in the old version again):
    func (e GenericOpenAPIError) Error() string {
        return e.error + ", body: " + string(e.body)
    }
  8. From the README.md file in the downloaded SDK copy the sections Documentation for API Endpoints and Documentation For Models and use them to replace those sections in the repository README.md file.' Also update the API version mentioned at the top of the readme.
  9. Replace all float32 with float64 and Float32 with Float64 in the entire SDK with the exception of this README file and the utils.go file. This is needed because otherwise we get rounding errors for large transaction amounts. Float64 only garantees 6 correct digits, not enought for amounts like 123456.78.
  10. Review the changes in the Git diff before commiting them. Files in docs folder can be commited without thourough checking since they only contain text changes.

Generating the SDK in Case the Download Has a Lot of Compilation Errors

  1. In some folder, create a file config.json with the following content.
{
  "packageName": "finapi",
  "enumClassPrefix": true
}
  1. Download the openapi.yml file (not the SDK) from docs.finapi.io and place it in the same folder as the config.json file.
  2. Install the generator via npm install @openapitools/openapi-generator-cli -g.
  3. Run the generator by executing openapi-generator-cli generate -i ./openapi.yaml -g go -o ./sdk -c ./config.json in the folder that contains the config and openapi file.
  4. In case the result contains a lot of compilation errors, delete the generated folder and use openapi-generator-cli version-manager set 5.0.1 to go back to a more stable version of the generator. Then run the command in step 4 again.
  5. Now you can follow the update process described above (skipping steps 1, 2 and 4) by treating the generated SDK like the downloaded one from above.