# README
Go finAPI
This package provides a finAPI SDK for Go. It was created via swagger-codegen as described in the finAPI documentation. Addionally some wrapper code was added to improve the usability.
-
API version: v1.93.0
-
Package version: 1.0.0
-
Build package: io.swagger.codegen.languages.GoClientCodegen
Usage
import (
"github.com/fastbill/go-finapi/v3"
finapimodel "github.com/fastbill/go-finapi/v3/model"
)
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
newBankConn := finapimodel.ImportBankConnectionParams{
BankId: 1234,
BankingUserId: "",
BankingPin: "",
StorePin: true,
MaxDaysForDownload: 90,
AccountTypeIds: []int{1,2,3}
}
bankConnection, res, err := client.BankConnectionsApi.ImportBankConnection(userCtx, newBankConn)
Documentation for API Endpoints
All URIs are relative to https://localhost
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 | 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 | GetPayments | Get /api/v1/payments | Get payments |
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 |
TPPCertificatesApi | CreateNewCertificate | Post /api/v1/tppCertificates | Create a new certificate |
TPPCertificatesApi | DeleteCertificate | Delete /api/v1/tppCertificates/{id} | Delete a certificate |
TPPCertificatesApi | GetAllCertificates | Get /api/v1/tppCertificates | Get all certificates |
TPPCertificatesApi | GetCertificate | Get /api/v1/tppCertificates/{id} | Get a certificate |
TPPCredentialsApi | CreateTppCredential | Post /api/v1/tppCredentials | Create new 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
- AccessToken
- Account
- AccountInterface
- AccountList
- AccountParams
- AccountReference
- BadCredentialsError
- Bank
- BankConnection
- BankConnectionInterface
- BankConnectionList
- BankConnectionOwner
- BankConsent
- BankInterface
- BankInterfaceLoginField
- BankList
- CashFlow
- CashFlowList
- CategorizationCheckResult
- CategorizationCheckResults
- Category
- CategoryList
- CategoryParams
- ChangeClientCredentialsParams
- CheckCategorizationData
- CheckCategorizationTransactionData
- ClearingAccountData
- ClientConfiguration
- ClientConfigurationParams
- ConnectInterfaceParams
- DailyBalance
- DailyBalanceList
- DirectDebitOrderingResponse
- EditBankConnectionParams
- EditCategoryParams
- EditTppCredentialParams
- ErrorDetails
- ErrorMessage
- ExecutePasswordChangeParams
- ExecuteSepaDirectDebitParams
- ExecuteSepaMoneyTransferParams
- IbanRule
- IbanRuleIdentifiersParams
- IbanRuleList
- IbanRuleParams
- IbanRulesParams
- IdentifierList
- ImportBankConnectionParams
- KeywordRule
- KeywordRuleIdentifiersParams
- KeywordRuleList
- KeywordRuleParams
- KeywordRulesParams
- Label
- LabelList
- LabelParams
- LoginCredential
- LoginCredentialResource
- MockAccountData
- MockBankConnectionUpdate
- MockBatchUpdateParams
- MoneyTransferOrderingResponse
- MonthlyUserStats
- MultiStepAuthenticationCallback
- MultiStepAuthenticationChallenge
- NewTransaction
- NotificationRule
- NotificationRuleList
- NotificationRuleParams
- PageableBankList
- PageableCategoryList
- PageableIbanRuleList
- PageableKeywordRuleList
- PageableLabelList
- PageablePaymentResources
- PageableSecurityList
- PageableTppAuthenticationGroupResources
- PageableTppCertificateList
- PageableTppCredentialResources
- PageableTransactionList
- PageableUserInfoList
- Paging
- PasswordChangingResource
- Payment
- PaymentExecutionResponse
- PaypalTransactionData
- RemoveInterfaceParams
- RequestPasswordChangeParams
- RequestSepaDirectDebitParams
- RequestSepaMoneyTransferParams
- Security
- SecurityList
- SingleDirectDebitData
- SingleMoneyTransferRecipientData
- SplitTransactionsParams
- SubTransactionParams
- TppAuthenticationGroup
- TppCertificate
- TppCertificateParams
- TppCredentials
- TppCredentialsParams
- TrainCategorizationData
- TrainCategorizationTransactionData
- Transaction
- TransactionList
- TriggerCategorizationParams
- TwoStepProcedure
- UpdateBankConnectionParams
- UpdateMultipleTransactionsParams
- UpdateResult
- UpdateTransactionsParams
- User
- UserCreateParams
- UserIdentifiersList
- UserIdentifiersParams
- UserInfo
- UserUpdateParams
- VerificationStatusResource
- WebForm
How to Update This SDK
- Download the newest version of the official SDK from docs.finapi.io. For that click the download button on the top of the page and select "go" as language.
- Save the zip file you get there to some place on your PC and extract it. Open the folder
go-client
. - Replace the folders
docs
andapi
in the current FastBill finAPI SDK repository with the new ones that you downloaded. - Delete everything in the current
model
folder and then copy all files starting withmodel_
from the freshly downloaded SDK to the repositoriesmodel
folder. - Copy all files besides the ones with
model_
,README.md
andgit_push.sh
and use them to replace the files on root level in the current repository. - Rename all occurances of
package swagger
topackage finapi
in the repository. - Add the import statement
. "github.com/fastbill/go-finapi/v3/model"
to all the files in the root folder of the repository besidesconfiguration.go
,finapi.go
,client.go
andresponse.go
. When you save the file your IDE should also automatically fix all Go formatting errors in the file. Also some missing import statements for the packageoptional
might be added in this process. - In the file
client.go
make sure to keep the following change for the serialization of the Swagger error (either revert the change from copying the file or just paste in the old version again):func (e GenericSwaggerError) Error() string { return e.error + ", body: " + string(e.body) }
- In the file
client.go
make sure to keep the custom HTTP client with the timeout, not the DefaultClient that you get from the fresh SDK download.func NewAPIClient(cfg *Configuration) *APIClient { if cfg.HTTPClient == nil { cfg.HTTPClient = &http.Client{ // The AWS ALB will terminate the connection (e.g. to legacy) after 60s so there is no point // in waiting longer than that for finAPI. Even when they would respond later we could not send // the response anymore. Timeout: 55 * time.Second, } } // ...
- From the
README.md
file in the downloaded SDK copy the sectionsDocumentation for API Endpoints
andDocumentation For Models
and use them to replace those sections in the repositoryREADME.md
file. Also update the API version mentioned at the top of the readme. - 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.
# Packages
No description provided by the author
# Functions
CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
No description provided by the author
No description provided by the author
NewClient creates a new finAPI client.
No description provided by the author
# Variables
ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
# Structs
APIClient manages communication with the finAPI RESTful Services API vv1.93.0 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Client bundles the different API services and holds the configuration.
ClientConfig holds the configuration values for the finAPI client.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GenericSwaggerError Provides access to the body, error and model on returned errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author