Withdrawals
Create withdrawal
Create a withdrawal from a specified bank account.
POST
/
withdrawals
Create withdrawal
curl --request POST \
--url https://{host}/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"bankAccountId": "ba_64f0c51e7fb3fc001234abcd",
"amount": 50,
"currency": "EUR",
"reference": "Withdraw to bank"
}
'import requests
url = "https://{host}/withdrawals"
payload = {
"bankAccountId": "ba_64f0c51e7fb3fc001234abcd",
"amount": 50,
"currency": "EUR",
"reference": "Withdraw to bank"
}
headers = {
"x-user-id": "<x-user-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-id': '<x-user-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
bankAccountId: 'ba_64f0c51e7fb3fc001234abcd',
amount: 50,
currency: 'EUR',
reference: 'Withdraw to bank'
})
};
fetch('https://{host}/withdrawals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/withdrawals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bankAccountId' => 'ba_64f0c51e7fb3fc001234abcd',
'amount' => 50,
'currency' => 'EUR',
'reference' => 'Withdraw to bank'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-user-id: <x-user-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/withdrawals"
payload := strings.NewReader("{\n \"bankAccountId\": \"ba_64f0c51e7fb3fc001234abcd\",\n \"amount\": 50,\n \"currency\": \"EUR\",\n \"reference\": \"Withdraw to bank\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-id", "<x-user-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/withdrawals")
.header("x-user-id", "<x-user-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bankAccountId\": \"ba_64f0c51e7fb3fc001234abcd\",\n \"amount\": 50,\n \"currency\": \"EUR\",\n \"reference\": \"Withdraw to bank\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/withdrawals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-id"] = '<x-user-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bankAccountId\": \"ba_64f0c51e7fb3fc001234abcd\",\n \"amount\": 50,\n \"currency\": \"EUR\",\n \"reference\": \"Withdraw to bank\"\n}"
response = http.request(request)
puts response.read_body{
"id": "wd_64f0c51e7fb3fc001234abcd",
"ownerId": "bank-user-12345",
"bankAccountId": "ba_64f0c51e7fb3fc001234abcd",
"amount": 50,
"currency": "EUR",
"status": "pending",
"consideration": {
"currency": "EUR",
"amount": 50
},
"reference": "Withdraw to bank",
"createdAt": "2023-11-07T05:31:56Z"
}{
"message": "Invalid amount",
"code": "INVALID_AMOUNT"
}{
"message": "Authentication required",
"code": "UNAUTHORIZED"
}{
"message": "Access denied",
"code": "FORBIDDEN"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The external user identifier of the acting customer.
Example:
"bank-user-12345"
Body
application/json
Response
Withdrawal created
Example:
"wd_64f0c51e7fb3fc001234abcd"
Example:
"bank-user-12345"
Example:
"ba_64f0c51e7fb3fc001234abcd"
Withdrawal amount as a number
Required range:
x >= 0.01Example:
50
ISO 4217 currency code
Available options:
GBP, EUR, USD Example:
"EUR"
Status of the withdrawal
Available options:
pending, completed, failed Example:
"pending"
Withdrawal consideration with currency and amount
Show child attributes
Show child attributes
Example:
"Withdraw to bank"
⌘I
Create withdrawal
curl --request POST \
--url https://{host}/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"bankAccountId": "ba_64f0c51e7fb3fc001234abcd",
"amount": 50,
"currency": "EUR",
"reference": "Withdraw to bank"
}
'import requests
url = "https://{host}/withdrawals"
payload = {
"bankAccountId": "ba_64f0c51e7fb3fc001234abcd",
"amount": 50,
"currency": "EUR",
"reference": "Withdraw to bank"
}
headers = {
"x-user-id": "<x-user-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-id': '<x-user-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
bankAccountId: 'ba_64f0c51e7fb3fc001234abcd',
amount: 50,
currency: 'EUR',
reference: 'Withdraw to bank'
})
};
fetch('https://{host}/withdrawals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/withdrawals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bankAccountId' => 'ba_64f0c51e7fb3fc001234abcd',
'amount' => 50,
'currency' => 'EUR',
'reference' => 'Withdraw to bank'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-user-id: <x-user-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/withdrawals"
payload := strings.NewReader("{\n \"bankAccountId\": \"ba_64f0c51e7fb3fc001234abcd\",\n \"amount\": 50,\n \"currency\": \"EUR\",\n \"reference\": \"Withdraw to bank\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-id", "<x-user-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/withdrawals")
.header("x-user-id", "<x-user-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bankAccountId\": \"ba_64f0c51e7fb3fc001234abcd\",\n \"amount\": 50,\n \"currency\": \"EUR\",\n \"reference\": \"Withdraw to bank\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/withdrawals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-id"] = '<x-user-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bankAccountId\": \"ba_64f0c51e7fb3fc001234abcd\",\n \"amount\": 50,\n \"currency\": \"EUR\",\n \"reference\": \"Withdraw to bank\"\n}"
response = http.request(request)
puts response.read_body{
"id": "wd_64f0c51e7fb3fc001234abcd",
"ownerId": "bank-user-12345",
"bankAccountId": "ba_64f0c51e7fb3fc001234abcd",
"amount": 50,
"currency": "EUR",
"status": "pending",
"consideration": {
"currency": "EUR",
"amount": 50
},
"reference": "Withdraw to bank",
"createdAt": "2023-11-07T05:31:56Z"
}{
"message": "Invalid amount",
"code": "INVALID_AMOUNT"
}{
"message": "Authentication required",
"code": "UNAUTHORIZED"
}{
"message": "Access denied",
"code": "FORBIDDEN"
}