From 6c3e3ba02c16b0d3b9cf18cd3cd15e3cea6bfc70 Mon Sep 17 00:00:00 2001 From: lexym Date: Wed, 18 Mar 2020 15:17:20 +0100 Subject: [PATCH 1/3] Add TransferWise quickstart --- DESCRIPTION.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/DESCRIPTION.md b/DESCRIPTION.md index 572bec6..27e63a2 100644 --- a/DESCRIPTION.md +++ b/DESCRIPTION.md @@ -1189,3 +1189,58 @@ To decide how you are going to make your tab visible, pass a visibility object i Setting `cash_register_qr_code` to true will connect this tab to the QR code from the cash register. If this cash register does not have a QR code yet, one will be created. Only one Tab can be connected to the cash register’s QR code at any given time. Setting `tab_qr_code` to true will create a QR code specifically for this tab. This QR code can not be linked to anything else. + +# Quickstart: Create a TransferWise payment + +## Goal + +You want to send a payment in currency other than euro outside the SEPA zone. + +## Before you start + +Make sure that you have opened a session and that for any call you make after that, you pass the session’s token in the `X-Bunq-Client-Authentication` header. + +ℹ️ *bunq relies on TransferWise for international, so you need to create a TransferWise account linked to a bunq account to be able to create international transfers. You can do it either from the bunq app or using our API as described below.* + +## Get the up-to-date exchange rate (optional) + +You might want to check the latest currency exchange rate before making a transfer. Here’s how you can do it using the bunq API: +1. Check the list of supported currencies via `GET /user/{userID}/transferwise-currency`. Copy the needed currency code. +2. Create a temporary quote for the currency of your choice via `POST /user/{userID}/transferwise-quote-temporary`. + +ℹ️ *A quote is the exchange rate at the exact timestamp. Temporary quotes carry solely informative value and cannot be used for creating a transfer.* + +3. Read the temporary quote via `GET /user/{userID}/transferwise-quote-temporary/{transferwise-quote-temporaryID}`. + +## Create a TransferWise account + +You need a TransferWise account linked to your bunq account to make TransferWise payments via the bunq API. Create one via `POST /user/{userID}/transferwise-user`, and save its ID. + +ℹ️ *You cannot use an existing TransferWise account.* + +## Create a quote + +1. Create a quote via POST /user/{userID}/transferwise-quote and save its ID. + +ℹ️ *Use amount_target to indicate the sum the recipient must get. Amount_source, on the other hand, will indicate the sum you want to send, but it will not necessarily be the final sum the recipient gets.* + +ℹ️ *Quotes are valid for 30 minutes so if you do not manage to create a transfer within this time, you will need to create another quote.* + +2. Get the exchange rate by reading the quote via GET /user/{userID}/transferwise-quote/(transferwise-quoteID). + +## Create a recipient + +If you have sent money via the TransferWise account linked to your bunq account, you can reuse the recipients. You can list their IDs via `GET /user/{userID}/transferwise-quote/{transferwise-quoteID}/transferwise-recipient`. + +To create a new, previously unused recipient, follow these steps: +1. Retrieve the fields required for creating the recipient as the requirements vary for the type of recipient in each country. Iterate sending the following request pair till there are no more required fields: +- `GET /user/{userID}/transferwise-quote/{transferwise-quoteID}/transferwise-recipient-requirement` +- `POST /user/{userID}/transferwise-quote/{transferwise-quoteID}/transferwise-recipient-requirement` +2. Create a recipient account using the final request body from the previous step with `POST /user/{userID}/transferwise-quote/{transferwise-quoteID}/transferwise-recipient-requirement` + +## Create a transfer + +Finally, having both the quote ID and the recipient ID, you can create a transfer. 🎉 + +1. Check if there are any additional transfer requirements via `POST /user/{userID}/transferwise-quote/{transferwise-quoteID}/transferwise-transfer-requirement`. +2. Create a transfer via `POST /user/{userID}/monetary-account/{monetary-accountID}/transferwise-quote/{transferwise-quoteID}/transferwise-transfer`. You need to specify the ID of the monetary account from which you want the payment to be made. From c66ba7e9d96f92654216970208a2f41defceb0b1 Mon Sep 17 00:00:00 2001 From: lexym Date: Wed, 18 Mar 2020 15:23:16 +0100 Subject: [PATCH 2/3] Update DESCRIPTION.md --- DESCRIPTION.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION.md b/DESCRIPTION.md index 27e63a2..d7502f1 100644 --- a/DESCRIPTION.md +++ b/DESCRIPTION.md @@ -1192,17 +1192,17 @@ Setting `tab_qr_code` to true will create a QR code specifically for this tab. T # Quickstart: Create a TransferWise payment -## Goal +## Before you start Make sure that you have opened a session and that for any call you make after that, you pass the session’s token in the `X-Bunq-Client-Authentication` header. ℹ️ *bunq relies on TransferWise for international, so you need to create a TransferWise account linked to a bunq account to be able to create international transfers. You can do it either from the bunq app or using our API as described below.* -## Get the up-to-date exchange rate (optional) +## Create a TransferWise account You need a TransferWise account linked to your bunq account to make TransferWise payments via the bunq API. Create one via `POST /user/{userID}/transferwise-user`, and save its ID. ℹ️ *You cannot use an existing TransferWise account.* -## Create a quote +## Create a quote 1. Create a quote via POST /user/{userID}/transferwise-quote and save its ID. @@ -1228,7 +1228,7 @@ You need a TransferWise account linked to your bunq account to make TransferWise 2. Get the exchange rate by reading the quote via GET /user/{userID}/transferwise-quote/(transferwise-quoteID). -## Create a recipient +## Create a recipient If you have sent money via the TransferWise account linked to your bunq account, you can reuse the recipients. You can list their IDs via `GET /user/{userID}/transferwise-quote/{transferwise-quoteID}/transferwise-recipient`. @@ -1238,7 +1238,7 @@ To create a new, previously unused recipient, follow these steps: - `POST /user/{userID}/transferwise-quote/{transferwise-quoteID}/transferwise-recipient-requirement` 2. Create a recipient account using the final request body from the previous step with `POST /user/{userID}/transferwise-quote/{transferwise-quoteID}/transferwise-recipient-requirement` -## Create a transfer +## Create a transfer Finally, having both the quote ID and the recipient ID, you can create a transfer. 🎉 From ba16c15922321a759db03f81e462dd0bef7b08d2 Mon Sep 17 00:00:00 2001 From: lexym Date: Wed, 18 Mar 2020 15:23:42 +0100 Subject: [PATCH 3/3] Update Sidebar.js --- src/plugins/BunqLayoutPlugin/components/Sidebar/Sidebar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/BunqLayoutPlugin/components/Sidebar/Sidebar.js b/src/plugins/BunqLayoutPlugin/components/Sidebar/Sidebar.js index 19d147e..a5ff1fd 100644 --- a/src/plugins/BunqLayoutPlugin/components/Sidebar/Sidebar.js +++ b/src/plugins/BunqLayoutPlugin/components/Sidebar/Sidebar.js @@ -72,8 +72,8 @@ class Sidebar extends React.Component { name: "Quickstart: Create a Tab payment" }, { - destination: "quickstart-create-a-tab-payment", - name: "Quickstart: Create a Tab payment" + destination: "quickstart-transwerwise-payment", + name: "Quickstart: Create a TransferWise payment" } ];