Deleting, Deactivating and Reactivating Wallets
Learn what happens when you delete or deactivate a wallet
Wallet Deactivation
Wallets can be deactivated in order to disable groups of cards. When a wallet is deactivated, this deactivation propagates to all of its sub-wallets. The cards associated with those wallets are unaffected, however all transactions made by those cards will be declined.
Below is an example of this deactivation propagation:
Wallet Reactivation
When a wallet is reactivated, there are two possible options:
- Reactivate the wallet and propagate the reactivation to all of its sub-wallets
- Reactivate only the specified wallet and don't propagate the reactivation
The first option is useful when you want to reverse a deactivation request. The second allows more fine-grained control.
Wallet Deletion
When deleting a wallet, you have the option of transferring its associated cards and sub-wallets, or having them removed along with the wallet.
If you choose to transfer the associated sub-wallets, their parent wallet will be updated to be the parent of the wallet being deleted. Furthermore, it you choose to transfer the associated cards, the cards' associated wallet will be updated to be the parent of the wallet being deleted.
In the event that wallets are not being transferred, these wallets will be permanently deleted and their funds are transferred to their parent wallet. Similarly, if cards are not being transferred, they will be terminated.
Only wallets other than the root wallet are able to be deleted. Attempts to delete a root wallet will fail.
Example: Delete an existing wallet
import os
import requests
API_URL = "https://api.dba.thepennyinc.com/v1"
ACCESS_TOKEN = os.getenv("PENNY_ACCESS_TOKEN")
wallet_id = "<id of wallet to delete>
payload = {
"delete": True,
"transfer_wallets": True, # move sub-wallets to the parent wallet
"transfer_cards": False # remove this wallet's cards, keep other cards as is
}
headers = {
"Authorization": f"Bearer {ACCESS_TOKEN}"
}
response = requests.delete(API_URL + f"/wallets/{wallet_id}", headers=headers, json=payload)
Visualizations
Below we have visual examples which indicate how the various deletion options function when using the Deactivate or delete a wallet endpoint.
Transfer cards and sub-wallets
Cards in the deleted wallet are transferred to its parent wallet. The sub-wallets of the deleted wallet are assigned to the deleted wallet's parent wallet.
Transfer cards only
Cards in the deleted wallet and all of its sub-wallets are transferred to the deleted wallet's parent wallet.
Transfer wallets only
Cards in the deleted wallet are terminated, the deleted wallet's sub-wallets are reassigned to the deleted wallet's parent wallet. Cards in sub-wallets are unaffected.
No wallet or card transfers
Cards in the deleted wallet and its sub-wallets are terminated. All sub-wallets of the deleted wallet are deleted as well.
Updated over 1 year ago