Categorygithub.com/fastbill/go-finapi/v3
modulepackage
3.1.0
Repository: https://github.com/fastbill/go-finapi.git
Documentation: pkg.go.dev

# 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.

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

ClassMethodHTTP requestDescription
AccountsApiDeleteAccountDelete /api/v1/accounts/{id}Delete an account
AccountsApiDeleteAllAccountsDelete /api/v1/accountsDelete all accounts
AccountsApiEditAccountPatch /api/v1/accounts/{id}Edit an account
AccountsApiExecuteSepaDirectDebitPost /api/v1/accounts/executeSepaDirectDebitExecute SEPA Direct Debit
AccountsApiExecuteSepaMoneyTransferPost /api/v1/accounts/executeSepaMoneyTransferExecute SEPA Money Transfer
AccountsApiGetAccountGet /api/v1/accounts/{id}Get an account
AccountsApiGetAndSearchAllAccountsGet /api/v1/accountsGet and search all accounts
AccountsApiGetDailyBalancesGet /api/v1/accounts/dailyBalancesGet daily balances
AccountsApiGetMultipleAccountsGet /api/v1/accounts/{ids}Get multiple accounts
AccountsApiRequestSepaDirectDebitPost /api/v1/accounts/requestSepaDirectDebitRequest SEPA Direct Debit
AccountsApiRequestSepaMoneyTransferPost /api/v1/accounts/requestSepaMoneyTransferRequest SEPA Money Transfer
AuthorizationApiGetTokenPost /oauth/tokenGet tokens
AuthorizationApiRevokeTokenPost /oauth/revokeRevoke a token
BankConnectionsApiConnectInterfacePost /api/v1/bankConnections/connectInterfaceConnect a new interface
BankConnectionsApiDeleteAllBankConnectionsDelete /api/v1/bankConnectionsDelete all bank connections
BankConnectionsApiDeleteBankConnectionDelete /api/v1/bankConnections/{id}Delete a bank connection
BankConnectionsApiEditBankConnectionPatch /api/v1/bankConnections/{id}Edit a bank connection
BankConnectionsApiGetAllBankConnectionsGet /api/v1/bankConnectionsGet all bank connections
BankConnectionsApiGetBankConnectionGet /api/v1/bankConnections/{id}Get a bank connection
BankConnectionsApiGetMultipleBankConnectionsGet /api/v1/bankConnections/{ids}Get multiple bank connections
BankConnectionsApiImportBankConnectionPost /api/v1/bankConnections/importImport a new bank connection
BankConnectionsApiRemoveInterfacePost /api/v1/bankConnections/removeInterfaceRemove an interface
BankConnectionsApiUpdateBankConnectionPost /api/v1/bankConnections/updateUpdate a bank connection
BanksApiGetAndSearchAllBanksGet /api/v1/banksGet and search all banks
BanksApiGetBankGet /api/v1/banks/{id}Get a bank
BanksApiGetMultipleBanksGet /api/v1/banks/{ids}Get multiple banks
CategoriesApiCreateCategoryPost /api/v1/categoriesCreate a new category
CategoriesApiDeleteAllCategoriesDelete /api/v1/categoriesDelete all categories
CategoriesApiDeleteCategoryDelete /api/v1/categories/{id}Delete a category
CategoriesApiEditCategoryPatch /api/v1/categories/{id}Edit a category
CategoriesApiGetAndSearchAllCategoriesGet /api/v1/categoriesGet and search all categories
CategoriesApiGetCashFlowsGet /api/v1/categories/cashFlowsGet cash flows
CategoriesApiGetCategoryGet /api/v1/categories/{id}Get a category
CategoriesApiGetMultipleCategoriesGet /api/v1/categories/{ids}Get multiple categories
CategoriesApiTrainCategorizationPost /api/v1/categories/trainCategorizationTrain categorization
ClientConfigurationApiEditClientConfigurationPatch /api/v1/clientConfigurationEdit client configuration
ClientConfigurationApiGetClientConfigurationGet /api/v1/clientConfigurationGet client configuration
LabelsApiCreateLabelPost /api/v1/labelsCreate a new label
LabelsApiDeleteAllLabelsDelete /api/v1/labelsDelete all labels
LabelsApiDeleteLabelDelete /api/v1/labels/{id}Delete a label
LabelsApiEditLabelPatch /api/v1/labels/{id}Edit a label
LabelsApiGetAndSearchAllLabelsGet /api/v1/labelsGet and search all labels
LabelsApiGetLabelGet /api/v1/labels/{id}Get a label
LabelsApiGetMultipleLabelsGet /api/v1/labels/{ids}Get multiple labels
MandatorAdministrationApiChangeClientCredentialsPost /api/v1/mandatorAdmin/changeClientCredentialsChange client credentials
MandatorAdministrationApiCreateIbanRulesPost /api/v1/mandatorAdmin/ibanRulesCreate IBAN rules
MandatorAdministrationApiCreateKeywordRulesPost /api/v1/mandatorAdmin/keywordRulesCreate keyword rules
MandatorAdministrationApiDeleteIbanRulesPost /api/v1/mandatorAdmin/ibanRules/deleteDelete IBAN rules
MandatorAdministrationApiDeleteKeywordRulesPost /api/v1/mandatorAdmin/keywordRules/deleteDelete keyword rules
MandatorAdministrationApiDeleteUsersPost /api/v1/mandatorAdmin/deleteUsersDelete users
MandatorAdministrationApiGetIbanRuleListGet /api/v1/mandatorAdmin/ibanRulesGet IBAN rules
MandatorAdministrationApiGetKeywordRuleListGet /api/v1/mandatorAdmin/keywordRulesGet keyword rules
MandatorAdministrationApiGetUserListGet /api/v1/mandatorAdmin/getUserListGet user list
MocksAndTestsApiCheckCategorizationPost /api/v1/tests/checkCategorizationCheck categorization
MocksAndTestsApiMockBatchUpdatePost /api/v1/tests/mockBatchUpdateMock batch update
NotificationRulesApiCreateNotificationRulePost /api/v1/notificationRulesCreate a new notification rule
NotificationRulesApiDeleteAllNotificationRulesDelete /api/v1/notificationRulesDelete all notification rules
NotificationRulesApiDeleteNotificationRuleDelete /api/v1/notificationRules/{id}Delete a notification rule
NotificationRulesApiGetAndSearchAllNotificationRulesGet /api/v1/notificationRulesGet and search all notification rules
NotificationRulesApiGetNotificationRuleGet /api/v1/notificationRules/{id}Get a notification rule
PaymentsApiGetPaymentsGet /api/v1/paymentsGet payments
SecuritiesApiGetAndSearchAllSecuritiesGet /api/v1/securitiesGet and search all securities
SecuritiesApiGetMultipleSecuritiesGet /api/v1/securities/{ids}Get multiple securities
SecuritiesApiGetSecurityGet /api/v1/securities/{id}Get a security
TPPCertificatesApiCreateNewCertificatePost /api/v1/tppCertificatesCreate a new certificate
TPPCertificatesApiDeleteCertificateDelete /api/v1/tppCertificates/{id}Delete a certificate
TPPCertificatesApiGetAllCertificatesGet /api/v1/tppCertificatesGet all certificates
TPPCertificatesApiGetCertificateGet /api/v1/tppCertificates/{id}Get a certificate
TPPCredentialsApiCreateTppCredentialPost /api/v1/tppCredentialsCreate new TPP credentials
TPPCredentialsApiDeleteTppCredentialDelete /api/v1/tppCredentials/{id}Delete a set of TPP credentials
TPPCredentialsApiEditTppCredentialPatch /api/v1/tppCredentials/{id}Edit a set of TPP credentials
TPPCredentialsApiGetAllTppCredentialsGet /api/v1/tppCredentialsGet all TPP credentials
TPPCredentialsApiGetAndSearchTppAuthenticationGroupsGet /api/v1/tppCredentials/tppAuthenticationGroupsGet all TPP Authentication Groups
TPPCredentialsApiGetTppCredentialGet /api/v1/tppCredentials/{id}Get a set of TPP credentials
TransactionsApiDeleteAllTransactionsDelete /api/v1/transactionsDelete all transactions
TransactionsApiDeleteTransactionDelete /api/v1/transactions/{id}Delete a transaction
TransactionsApiEditMultipleTransactionsPatch /api/v1/transactionsEdit multiple transactions
TransactionsApiEditMultipleTransactionsDeprecatedPatch /api/v1/transactions/{ids}Edit multiple transactions (DEPRECATED)
TransactionsApiEditTransactionPatch /api/v1/transactions/{id}Edit a transaction
TransactionsApiGetAndSearchAllTransactionsGet /api/v1/transactionsGet and search all transactions
TransactionsApiGetMultipleTransactionsGet /api/v1/transactions/{ids}Get multiple transactions
TransactionsApiGetTransactionGet /api/v1/transactions/{id}Get a transaction
TransactionsApiRestoreTransactionPost /api/v1/transactions/{id}/restoreRestore a transaction
TransactionsApiSplitTransactionPost /api/v1/transactions/{id}/splitSplit a transaction
TransactionsApiTriggerCategorizationPost /api/v1/transactions/triggerCategorizationTrigger categorization
UsersApiCreateUserPost /api/v1/usersCreate a new user
UsersApiDeleteAuthorizedUserDelete /api/v1/usersDelete the authorized user
UsersApiDeleteUnverifiedUserDelete /api/v1/users/{userId}Delete an unverified user
UsersApiEditAuthorizedUserPatch /api/v1/usersEdit the authorized user
UsersApiExecutePasswordChangePost /api/v1/users/executePasswordChangeExecute password change
UsersApiGetAuthorizedUserGet /api/v1/usersGet the authorized user
UsersApiGetVerificationStatusGet /api/v1/users/verificationStatusGet a user's verification status
UsersApiRequestPasswordChangePost /api/v1/users/requestPasswordChangeRequest password change
UsersApiVerifyUserPost /api/v1/users/verify/{userId}Verify a user
WebFormsApiGetWebFormGet /api/v1/webForms/{id}Get a web form

Documentation For Models

How to Update This SDK

  1. 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.
  2. Save the zip file you get there to some place on your PC and extract it. Open the folder go-client.
  3. Replace the folders docs and api in the current FastBill finAPI SDK repository with the new ones that you downloaded.
  4. Delete everything in the current model folder and then copy all files starting with model_ from the freshly downloaded SDK to the repositories model folder.
  5. Copy all files besides the ones with model_, README.md and git_push.sh and use them to replace the files on root level in the current repository.
  6. Rename all occurances of package swagger to package finapi in the repository.
  7. Add the import statement . "github.com/fastbill/go-finapi/v3/model" to all the files in the root folder of the repository besides configuration.go, finapi.go, client.go and response.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 package optional might be added in this process.
  8. 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)
    }
    
  9. 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,
            }
        }
        // ...
    
  10. 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.
  11. 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