Jakob
Good morning Jakob. Thanks for that detailed explanation. I tried what you had suggested, using Bastiaan's method of creating the signature.
Installation token...no problem
I then make a POST request with the following details:
uri: https://public-api.sandbox.bunq.com/v1/payment-service-provider-credential
Request body: {"client_payment_service_provider_certificate":"-----BEGIN CERTIFICATE-----\nMIIE1jCCAr4CCQDdp5TgPW...YPl3iSw\nwWS1TNUu1qFndrSCkxSawiaDuEdOoMbaHq7A2hQjIvRJ5X9QqPtE2Lzs\n-----END CERTIFICATE-----\n","client_payment_service_provider_certificate_chain":"-----BEGIN CERTIFICATE-----\nMIIE1jCCAr4CCQDdp5TgPW...YPl3iSw\nwWS1TNUu1qFndrSCkxSawiaDuEdOoMbaHq7A2hQjIvRJ5X9QqPtE2Lzs\n-----END CERTIFICATE-----\n","client_public_key_signature":"fD4OP67uaNETBtOhaaY9sr4c5FP1fn+24dInSowLiNDmqiy/9..."}
Request headers: {Content-Type=[application/json], X-Bunq-Client-Authentication=[9729b907f34329ff1c5d844ba016...]}
...getting a 200 response from the bank with the following details:
{"Response":[{"CredentialPasswordIp":{"id":271175,"created":"2022-02-02 10:42:29.938045","updated":"2022-02-02 10:42:29.938045","status":"PENDING_FIRST_USE","expiry_time":"2022-02-02 11:42:29.937890","token_value":"af648f27f0a1451dae763211b393406d65...","permitted_device":null}}]}
According to Bunq's documentation (https://doc.bunq.com/#/), the response I should be getting at this stage is:
{"Id": {"id": 0}}
The one I got was supposed to be the proper response when I make a GET request to the https://public-api.sandbox.bunq.com/v1/payment-service-provider-credential/{itemId} endpoint.
So, could you please clarify what is going on? It looks like I doin't need to make a second request to get the api user credential id. How am I getting the api key then?
Our company has connected thousands of banks across Europe and none have been more challenging than registering Bunq. Looking forward to solving this riddle. Thanks so much for your time and kind assistance.