/delete_account

Deletes a bank account

  

This endpoint deletes bank accounts linked to end-users, decommissioning them from use in future transactions.

Requests

POST /0.2/delete_account HTTP/1.1
Host: sandbox.silamoney.com
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
Content-Type: application/json

{
  "header": {
    "created": 1234567890, 
    "app_handle": "handle.silamoney.eth", 
    "user_handle":"user.silamoney.eth", 
    "version": "0.2", 
    "crypto": "ETH", 
    "reference": "<your unique id>"
  },
  "account_name": "Custom Account Name"
}

***

HTTP/1.1 200 OK

{
  "success": true,
  "status": "SUCCESS",
  "reference": "ref",
  "message": "Bank account deleted successfully.",
  "response_time_ms": "171",
  "account_name: "Custom Account Name"
}
var response = api.DeleteAccount(userHandle, userPrivateKey, accountName);
var parsedResponse = (DeleteAccountResult)response.Data;

response.StatusCode; // 200
parsedResponse.AccountName; // accountName
parsedResponse.Message; // response message
parsedResponse.Status; // response status
parsedResponse.Success; // true
const res = await sila.deleteAccount("user handle", "account name", "user private key");

console.log(res.statusCode); // 200
console.log(res.data.reference); // Random reference number
console.log(res.data.status); // SUCCESS
console.log(res.data.success);
console.log(res.data.message);
console.log(res.data.account_name); // account name
payload = { "user_handle": user_handle, "account_name": "unlink" }

response = User.delete_account( app, payload, eth_private_key)

// Response
{
    'reference': 'ref',
    'success': True,
    'message': 'Bank account deleted successfully.',
    'account_nickname': 'unlink',
    'status': 'SUCCESS',
    'status_code': 200
}
ApiResponse response = api.deleteAccount("user handle", "account name", "user private key");

DeleteAccountResponse parsedResponse = (DeleteAccountResponse) response.getData();

response.getStatusCode();
parsedResponse.getAccountName();
parsedResponse.getReference();
parsedResponse.getMessage();
parsedResponse.getSuccess();
parsedResponse.getStatus();
//Load your information
$userHandle = 'user.silamoney.eth';
$accountName = 'account';

//Call the API
$response = $client->deleteAccount($userHandle, $accountName);

//Success 200
echo $response->getStatusCode();        //200
$account = $response->getData();
echo $account->getStatus();
echo $account->getReference();
echo $account->getMessage();    //Bank account deleted successfully.
echo $account->getAccountName(); //account.
  
KeyTypeDescription
headerJSON objectRequired. Requires these keys in JSON format: created, app_handle, user_handle. See the /check_handle endpoint for the complete list of fields in this object.
account_nameStringRequired. Max length 40
The account_name must match a bank account associated with the user_handle; check /get_accounts endpoint for a list of these.
Example: Custom Account Name
  

Both authsignature and usersignature headers are required for this request.

The account_name key is required and is used to uniquely identify the bank account to delete.

  

Responses

Status Codesuccess AttributeDescription
200trueBank account successfully deleted.
400falseCheck validation_details for more information. PRODUCT_NOT_READY indicates the account is waiting to be linked (with microdeposit verification, for instance).
401falseauthsignature or usersignature header was absent or incorrect.