Virtual AccountDebit Virtual Account

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 header
  • Content-Type: application/json

Request Parameters

ParameterRequiredTypeDescription
account_numberYesstringThe unique identifier of the virtual account from which funds will be deducted
amountYesnumberAmount to be deducted from the virtual account balance
tx_refNostringYour reference for this transaction
noteNostringReference or description for the deduction transaction

Request Example

{
  "account_number": "1234567890",
  "amount": 1000,
  "tx_ref": "REF_1234",
  "note": "Deduction for February 2025"
}

Response Parameters

ParameterTypeDescription
statusstringStatus of the request (success/error)
messagestringDescription of the operation result
data.account.account_namestringName associated with the virtual account
data.account.account_numbernumberUnique identifier of the virtual account
data.account.account_aliasstringCustom reference name for the account
data.account.balancenumberCurrent balance after deduction
data.account.statusstringCurrent status of the account
data.account.currencystringCurrency of the account
data.account.created_atstringTimestamp of account creation
data.account.updated_atstringTimestamp of last account update
data.transaction.tx_refstringYour reference for this debit transaction (optional)
data.transaction.notestringDescription provided for the debit
data.transaction.typestringThe type of transaction (credit/debit)
data.transaction.amountnumberAmount deducted in this transaction
data.transaction.currencystringCurrency of the withdrawal
data.transaction.created_atstringTimestamp of the withdrawal transaction
1import requests
2import json
3
4url = "https://api.chapa.co/v1/virtual-account/deduct"
5
6payload = json.dumps({
7 "account_number": "100314252",
8 "amount": 20,
9 "tx_ref": "VWDYi1qyA6",
10 "note": "Connecting Ethiopia to the Global Market"
11})
12
13headers = {
14 'Content-Type': 'application/json',
15 'Authorization': 'Bearer CHASECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
16}
17
18response = requests.post(url, headers=headers, data=payload)
19print(response.text)