Deduct from Virtual Account
Withdraw funds from an existing virtual account. This operation requires the virtual account to have sufficient balance.
Endpoint https://api.chapa.co/v1/virtual-account/deduct
Method POST
Authentication
Authorization
: Pass your secret key as a bearer token in the request headerContent-Type
: application/json
Request Parameters
Parameter | Required | Type | Description |
---|---|---|---|
account_number | Yes | string | The unique identifier of the virtual account from which funds will be deducted |
amount | Yes | number | Amount to be deducted from the virtual account balance |
tx_ref | No | string | Your reference for this transaction |
note | No | string | Reference or description for the deduction transaction |
Request Example
{
"account_number": "1234567890",
"amount": 1000,
"tx_ref": "REF_1234",
"note": "Deduction for February 2025"
}
Response Parameters
Parameter | Type | Description |
---|---|---|
status | string | Status of the request (success/error) |
message | string | Description of the operation result |
data.account.account_name | string | Name associated with the virtual account |
data.account.account_number | number | Unique identifier of the virtual account |
data.account.account_alias | string | Custom reference name for the account |
data.account.balance | number | Current balance after deduction |
data.account.status | string | Current status of the account |
data.account.currency | string | Currency of the account |
data.account.created_at | string | Timestamp of account creation |
data.account.updated_at | string | Timestamp of last account update |
data.transaction.tx_ref | string | Your reference for this debit transaction (optional) |
data.transaction.note | string | Description provided for the debit |
data.transaction.type | string | The type of transaction (credit/debit) |
data.transaction.amount | number | Amount deducted in this transaction |
data.transaction.currency | string | Currency of the withdrawal |
data.transaction.created_at | string | Timestamp of the withdrawal transaction |
1import requests2import json34url = "https://api.chapa.co/v1/virtual-account/deduct"56payload = json.dumps({7 "account_number": "100314252",8 "amount": 20,9 "tx_ref": "VWDYi1qyA6",10 "note": "Connecting Ethiopia to the Global Market"11})1213headers = {14 'Content-Type': 'application/json',15 'Authorization': 'Bearer CHASECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'16}1718response = requests.post(url, headers=headers, data=payload)19print(response.text)