Created
November 3, 2021 14:19
-
-
Save basst85/8a8a96659ff1a7c57887dd5d568c8da8 to your computer and use it in GitHub Desktop.
bunq_create_bunqMeTab.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import warnings | |
from bunq.sdk.context.api_context import ApiContext, ApiEnvironmentType | |
from bunq.sdk.context.bunq_context import BunqContext | |
from bunq.sdk.model.generated.endpoint import BunqMeTab, BunqMeTabEntry | |
from bunq.sdk.model.generated.object_ import Amount | |
warnings.filterwarnings("ignore") | |
_API_KEY = '<YOUR_BUNQ_API_KEY>' | |
_DEVICE_DESCRIPTION = 'TestPython' | |
_CONFIG_FILE_LOCATION = './bunq.conf' | |
api_context = ApiContext.create(ApiEnvironmentType.PRODUCTION, _API_KEY, _DEVICE_DESCRIPTION) | |
api_context.ensure_session_active() | |
api_context.save(_CONFIG_FILE_LOCATION) | |
BunqContext.load_api_context(api_context) | |
bunqmetabid = BunqMeTab.create( | |
BunqMeTabEntry( | |
Amount('0.01', 'EUR'), | |
'Description' | |
) | |
).value | |
bunqmetab = BunqMeTab.get(bunqmetabid) | |
print(bunqmetab.value.bunqme_tab_share_url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment