Go to file
2024-04-12 11:36:46 +03:00
.openapi-generator first commit 2024-04-10 22:18:44 +03:00
api first commit 2024-04-10 22:18:44 +03:00
docs Commit 2024-04-10 22:21:45 +03:00
test Commit 2024-04-10 22:21:45 +03:00
.gitignore first commit 2024-04-10 22:18:44 +03:00
.openapi-generator-ignore first commit 2024-04-10 22:18:44 +03:00
.travis.yml first commit 2024-04-10 22:18:44 +03:00
api_.go first commit 2024-04-10 22:18:44 +03:00
client.go first commit 2024-04-10 22:18:44 +03:00
configuration.go first commit 2024-04-10 22:18:44 +03:00
git_push.sh first commit 2024-04-10 22:18:44 +03:00
go.mod Bump version 2024-04-12 11:36:46 +03:00
go.sum first commit 2024-04-10 22:18:44 +03:00
LICENSE Add license 2024-04-10 23:30:17 +03:00
model_currency_info_inner.go first commit 2024-04-10 22:18:44 +03:00
model_error.go first commit 2024-04-10 22:18:44 +03:00
model_set_web_hook.go first commit 2024-04-10 22:18:44 +03:00
model_statement_items_inner.go first commit 2024-04-10 22:18:44 +03:00
model_user_info_accounts_inner.go first commit 2024-04-10 22:18:44 +03:00
model_user_info_jars_inner.go first commit 2024-04-10 22:18:44 +03:00
model_user_info.go first commit 2024-04-10 22:18:44 +03:00
model_web_hook_response.go Commit 2024-04-10 23:09:31 +03:00
README.md Commit 2024-04-10 22:39:04 +03:00
response.go first commit 2024-04-10 22:18:44 +03:00
swagger.json first commit 2024-04-10 22:18:44 +03:00
types.go Commit 2024-04-10 23:06:38 +03:00
utils.go Commit 2024-04-10 23:06:38 +03:00

Go API client for monobank

API для отримання інформації про виписки та стан особистого рахунку та рахунків ФОП. Для надання доступу потрібно пройти авторизацію у особистому кабінеті https://api.monobank.ua/ та отримати токен для персонального використання.

Якщо у вас є запитання щодо роботи API, запрошуємо до ком'юніті у Telegram-групі. API недоступне для клієнтів до 16 років, дані за дитячими рахунками доступні з батьківського акаунту. Якщо у вас є сервіс і ви хочете централізовано приєднатися до API для надання послуг клієнтам, потрібно підключитися до API для провайдерів послуг, що має більше можливостей. Якщо дані клієнтів не будуть надходити на ваші сервери або ви робите сервіс для своєї родини, використання корпоративного API необов'язкове. Розробка бібліотек або програм, які будуть використовувати клієнти особисто (дані клієнта не будуть проходити черeз вузли розробника), також не потребують використання корпоративного API.

Це надасть змогу клієнтам monobank авторизуватись у вашому сервісі (наприклад, у фінансовому менеджері) для надання інформації про стан рахунку або виписки.

У разі виявлення експлуатації цього API в якості корпоративного, банк залишає за собою право накласти санкції на компанію.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: v2303
  • Package version: 1.0.0
  • Generator version: 7.4.0
  • Build package: org.monobanktools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import monobank "gitea.stuzer.link/stuzer05/go-monobank"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value monobank.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), monobank.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value monobank.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), monobank.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using monobank.ContextOperationServerIndices and monobank.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), monobank.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), monobank.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.monobank.ua

Class Method HTTP request Description
DefaultApi BankCurrencyGet Get /bank/currency Отримання курсів валют
DefaultApi PersonalClientInfoGet Get /personal/client-info Інформація про клієнта
DefaultApi PersonalStatementAccountFromToGet Get /personal/statement/{account}/{from}/{to} Виписка
DefaultApi PersonalWebhookPost Post /personal/webhook Встановлення WebHook

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

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
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author