{"id":22157713,"url":"https://github.com/link0/bunq","last_synced_at":"2025-07-26T08:32:06.741Z","repository":{"id":62517329,"uuid":"84679623","full_name":"link0/bunq","owner":"link0","description":"API client in PHP for bunq","archived":false,"fork":false,"pushed_at":"2017-11-27T18:08:48.000Z","size":59,"stargazers_count":8,"open_issues_count":13,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-03T00:51:55.319Z","etag":null,"topics":["bunq"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/link0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-11T21:01:41.000Z","updated_at":"2019-08-10T05:36:33.000Z","dependencies_parsed_at":"2022-11-02T13:45:37.961Z","dependency_job_id":null,"html_url":"https://github.com/link0/bunq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/link0/bunq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/link0%2Fbunq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/link0%2Fbunq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/link0%2Fbunq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/link0%2Fbunq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/link0","download_url":"https://codeload.github.com/link0/bunq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/link0%2Fbunq/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267140642,"owners_count":24041970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bunq"],"created_at":"2024-12-02T03:13:03.213Z","updated_at":"2025-07-26T08:32:06.410Z","avatar_url":"https://github.com/link0.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"link0/bunq\n==========\n[![Latest Stable Version](https://poser.pugx.org/link0/bunq/v/stable.svg)](https://packagist.org/packages/link0/bunq)\n[![Total Downloads](https://poser.pugx.org/link0/bunq/downloads.svg)](https://packagist.org/packages/link0/bunq)\n[![License](https://poser.pugx.org/link0/bunq/license.svg)](https://packagist.org/packages/link0/bunq)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/link0/bunq/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/link0/bunq/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/link0/bunq/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/link0/bunq/?branch=master)\n[![Build Status](https://scrutinizer-ci.com/g/link0/bunq/badges/build.png?b=master)](https://scrutinizer-ci.com/g/link0/bunq/build-status/master)\n\nThis library implements the [bunq API](https://doc.bunq.com).\n\nAny feedback and testing is very welcome through issues and/or pull requests.\n\n## Basic usage\n\n\nThe following code example does a few things to get you started as fast as possible:\n\n1. Create an InstallationServer\n2. Create an DeviceServer\n3. Retrieve a session from the SessionServer to be able to use the API\n\nBefore you copy/paste this code be sure you have an API key to use. When developing and testing the API you probably don't  want\nto use the API key for production. Instead you want to use a developer API key.\nA developer API key can be obtained by asking the support desk from bunq itself (using the bunq app). Once you've got that\nAPI key you can fill it in into the `$apiKey` variable.\n\nThe function `registerInstallationAndDeviceServer()` is only supposed to be called once. After the first call you can comment this rule out.\n\n\n```php\n\u003c?php\n\nuse Link0\\Bunq\\Client;\nuse Link0\\Bunq\\Domain\\Keypair;\nuse Link0\\Bunq\\Domain\\Keypair\\PublicKey;\nuse Link0\\Bunq\\Environment\\Production;\nuse Link0\\Bunq\\Environment\\Sandbox;\nuse Link0\\Bunq\\Service\\InstallationService;\n\nrequire_once('vendor/autoload.php');\n\n/**\n * @param $installationService\n * @param $keypair\n * @param $apiKey\n * @return mixed\n */\nfunction registerInstallationAndDeviceServer(InstallationService $installationService, $keypair, $apiKey)\n{\n    $installation = $installationService-\u003ecreateInstallation($keypair);\n\n    $installationToken = $installation[1];\n    $serverPublicKey = $installation[2];\n\n    // Cache the server public key somewhere\n    file_put_contents('server-public-key.txt', $serverPublicKey);\n\n    // Cache the installation token somehere\n    file_put_contents('installation-token.txt', $installationToken);\n\n    $installationService-\u003ecreateDeviceServer($installationToken, $apiKey, 'I pasted this from README.md');\n}\n\n// openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048\n// openssl rsa -pubout -in private.pem -out public.pem\n$keypair = Keypair::fromStrings(\n    file_get_contents('public.pem'),\n    file_get_contents('private.pem')\n);\n\n// Replace this with what you received from the app\n$apiKey = 'your-api-key';\n\n$debugMode = true;\n\n//$environment = new Production($debugMode);\n$environment = new Sandbox($debugMode);\n$client = new Client($environment, $keypair);\n\n$installationService = new InstallationService($client);\n\nregisterInstallationAndDeviceServer($installationService, $keypair, $apiKey);\n\n$installationToken = file_get_contents('installation-token.txt');\n\n$sessionServer = $installationService-\u003ecreateSessionServer($installationToken, $apiKey);\n\n$sessionServerId = $sessionServer[0];\n$sessionToken = $sessionServer[1];\n$user = $sessionServer[2];\n\nfile_put_contents('session-token.txt', $sessionToken);\n\n// After this, you can use the client with all other services as followed\n$client = new Client(\n    $environment,\n    $keypair,\n    new PublicKey(file_get_contents('server-public-key.txt')),\n    file_get_contents('session-token.txt')\n);\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flink0%2Fbunq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flink0%2Fbunq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flink0%2Fbunq/lists"}