cURL
curl --request DELETE \
--url https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId} \
--header 'partner-api-key: <api-key>'import requests
url = "https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}"
headers = {"partner-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'partner-api-key': '<api-key>'}};
fetch('https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}', 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://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"partner-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("partner-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}")
.header("partner-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["partner-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyBank Accounts
Delete Bank Account (User)
DELETE
/
api
/
partner
/
v2
/
banks
/
users
/
{userId}
/
accounts
/
{userBankInfoId}
cURL
curl --request DELETE \
--url https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId} \
--header 'partner-api-key: <api-key>'import requests
url = "https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}"
headers = {"partner-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'partner-api-key': '<api-key>'}};
fetch('https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}', 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://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"partner-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("partner-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}")
.header("partner-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.capa.fi/api/partner/v2/banks/users/{userId}/accounts/{userBankInfoId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["partner-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyDeletes a bank account for a user. This performs a soft delete by disabling the account.
Error Codes
These are the errors this endpoint returns most often. Branch oncode, not message, and handle codes you don’t recognize by their HTTP status. See Error Codes for the complete list.
Common Errors
| HTTP Status | Code | Message |
|---|---|---|
| 401 | UNAUTHORIZED | ”API Key is missing” |
| 401 | UNAUTHORIZED | ”Invalid API Key format” |
| 401 | UNAUTHORIZED | ”Invalid API Key” |
| 429 | TOO_MANY_REQUESTS | ”ThrottlerException: Too Many Requests” (wait the number of seconds in the Retry-After header) |
User Ownership Errors
| HTTP Status | Code | Message |
|---|---|---|
| 401 | UNAUTHORIZED | ”User is not associated with the partner” |
Endpoint-Specific Errors
| HTTP Status | Code | Message |
|---|---|---|
| 400 | INVALID_USER_INPUT_ERROR | ”Invalid User Input” |
| 403 | USER_BANK_INFO_ACCESS_DENIED | ”The bank information does not belong to the specified user.” |
| 403 | USER_BANK_INFO_ACCESS_DENIED | ”The bank information belongs to a different partner.” |
| 404 | NOT_FOUND_ERROR | ”Requested UserBankInfo was not found” |
Authorizations
API key for the affiliated partner performing the request.
Path Parameters
The user ID
Example:
"8374f327-38bd-4b0b-b8a7-2524599eb903"
The user bank info ID to delete
Example:
"8374f327-38bd-4b0b-b8a7-2524599eb903"
Response
Deletes a bank account for a user by userId and userBankInfoId. This performs a soft delete by setting the disabled field to true.