Close Account
Overview
You can initiate account closure, at any point, using the Close Account API.
Prerequisites
- Account closure can be initiated if the account doesn't have unprocessed transaction(s) — i.e., transactions in
SCHEDULED/PENDINGstatus. - The account will be closed once all transactions in
PROCESSINGstatus areCOMPLETEDand the SEND (created to move the outstanding balance amount from that account to the customer's external account via ACH or address via check) getsCOMPLETED.
Resource Access
Production (api.ahrvo.network)
POST https://api.ahrvo.network/banking/us2/v1/customer/id/{customerId}/account/id/{accountId}/close
Staging (gateway.ahrvo.network)
POST https://gateway.ahrvo.network/banking/us2/v1/customer/id/{customerId}/account/id/{accountId}/close
Authentication
| Header | Description |
|---|---|
Authorization | Bearer {JWT token} |
x-api-key | Your API key |
Content-Type | application/json |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
customerId | integer | Internal customer ID |
accountId | integer | Internal account ID |
Arguments
| Field | M / O | Description |
|---|---|---|
cancelUnprocessedSchedules | O | Instruction to cancel unprocessed transactions |
reason | M | Reason for initiating account closure |
comment | Conditional | Required if reason is OTHERS. Additional reason(s) for account closure. |
outstandingBalanceInstruction | M | The destination and preferred method for moving the balance amount |
outstandingBalanceInstruction.preferredMethod | M | Preferred method: ACH or CHECK |
outstandingBalanceInstruction.destination | M | Destination for the outstanding balance |
outstandingBalanceInstruction.destination.externalAccount.id | O | External account ID (for ACH method) |
outstandingBalanceInstruction.destination.externalAccount.externalId | O | External account external ID (for ACH method) |
outstandingBalanceInstruction.destination.address.id | O | Address ID (for CHECK method) |
outstandingBalanceInstruction.destination.address.externalId | O | Address external ID (for CHECK method) |
outstandingBalanceInstruction.processingDetail.processingMode | O | Processing mode (for ACH method) |
outstandingBalanceInstruction.processingDetail.deliveryMode | O | Delivery mode (for CHECK method) |
Example Request
Close Account with ACH
POST /banking/us2/v1/customer/id/4000180/account/id/4024062/close HTTP/1.1
Host: api.ahrvo.network
Authorization: Bearer {placeholder("JWT token")}
x-api-key: {placeholder("your-api-key")}
Content-Type: application/json
{
"cancelUnprocessedSchedules": true,
"reason": "OTHERS",
"comment": "Health Emergency",
"outstandingBalanceInstruction": {
"destination": {
"externalAccount": {
"id": "4004445"
}
},
"preferredMethod": "ACH",
"processingDetail": {
"processingMode": "FORWARD"
}
}
}
Example Response
HTTP Status: 200 OK
Important Notes
Outstanding Balance
When closing an account, any outstanding balance will be transferred to the specified destination using the preferred method (ACH or CHECK).
Unprocessed Transactions
Account closure cannot be initiated if there are transactions in SCHEDULED or PENDING status. Set cancelUnprocessedSchedules to true to cancel them automatically.
ACH vs CHECK
- ACH: Specify
destination.externalAccountandprocessingDetail.processingMode - CHECK: Specify
destination.addressandprocessingDetail.deliveryMode