DELETE /bank-accounts/:id/link
Unlink a bank account from your own branch (the caller's branch, taken from your API key). The account record stays in your service and keeps its links to other branches. Unlinking does not delete it; it removes the account from your branch's GET /bank-accounts.
Endpoint
http
DELETE /bank-accounts/:id/linkFull URL: https://api.easyslip.com/v2/bank-accounts/:id/link
Your API key identifies the branch. There is no branchId in the path or body.
Authentication
Required. See Authentication Guide.
http
Authorization: Bearer YOUR_API_KEYRequest
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | number | Yes | The bank account id, which must currently be linked to your branch |
No request body.
Type Definitions
typescript
// Response
interface UnlinkResponse {
success: true;
data: {
unlinked: true;
};
}
// Error Response
interface ErrorResponse {
success: false;
error: {
code: string;
message: string;
};
}Examples
bash
curl -X DELETE https://api.easyslip.com/v2/bank-accounts/12345/link \
-H "Authorization: Bearer YOUR_API_KEY"javascript
const unlinkBankAccount = async (id) => {
const response = await fetch(`https://api.easyslip.com/v2/bank-accounts/${id}/link`, {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const result = await response.json();
if (!result.success) {
throw new Error(result.error.message);
}
return result.data;
};
// Usage
await unlinkBankAccount(12345);php
function unlinkBankAccount(int $id): array
{
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.easyslip.com/v2/bank-accounts/' . $id . '/link',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY'
]
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
if (!$result['success']) {
throw new Exception($result['error']['message']);
}
return $result['data'];
}
// Usage
unlinkBankAccount(12345);python
import requests
def unlink_bank_account(account_id: int) -> dict:
response = requests.delete(
f'https://api.easyslip.com/v2/bank-accounts/{account_id}/link',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
result = response.json()
if not result['success']:
raise Exception(result['error']['message'])
return result['data']
# Usage
unlink_bank_account(12345)Response
Success Response (200)
json
{
"success": true,
"data": {
"unlinked": true
}
}Error Responses
Bank Account Not Found (404)
json
{
"success": false,
"error": {
"code": "BANK_ACCOUNT_NOT_FOUND",
"message": "Bank account not found"
}
}Notes
- Unlinks from your own branch, identified by your API key. There is no
branchId. - The account must currently be linked to your branch; otherwise
404 BANK_ACCOUNT_NOT_FOUND. - Only the link to your branch is removed. The account record is not deleted and other branches' links are untouched.
- After unlinking, the account no longer appears in
GET /bank-accounts, but you can still find it viaGET /bank-accounts/alland link it back.