Virtual Account Management

Fetch Virtual Accounts

Endpoint

GET {{baseUrl}}/business/virtual-account

Description

This endpoint allows you to fetch all virtual accounts

Request

Headers

  • Content-Type: application/json

  • Authorization: Bearer {your_api_token}

Fetch Virtual Account

Endpoint

POST {{baseUrl}}/business/virtual-account/{{customerID}}

Description

This endpoint allows you to fetch a particular virtual account, effectively marking it as inactive and preventing any further transactions.

Request

Headers

  • Content-Type: application/json

  • Authorization: Bearer {your_api_token}

Delete Virtual Account

Endpoint

POST {{baseUrl}}/business/virtual-account/delete-virtual-account/{{customerID}}

Description

This endpoint allows you to delete a virtual account, effectively marking it as inactive and preventing any further transactions.

Request

Headers

  • Content-Type: application/json

  • Authorization: Bearer {your_api_token}

Path Parameters

ParameterTypeRequiredDescription

customer_id

string

Yes

Unique identifier of the virtual account

Example Request

POST {{baseUrl}}/business/virtual-account/delete-virtual-account/{{customerID}}
Authorization: Bearer your_api_token
Content-Type: application/json

Response

Success (200)

FieldTypeDescription

message

string

Success message

customer_id

string

Unique identifier of the account

status

string

New status of the account ("archived")

Example Response

{
  "message": "Virtual account deleted successfully."
}

Enable Virtual Account

Endpoint

POST {{baseUrl}}/virtual-accounts/{account_id}/enable

Description

This endpoint allows you to enable a previously disabled virtual account.

Request

Headers

  • Content-Type: application/json

  • Authorization: Bearer {your_api_token}

Path Parameters

ParameterTypeRequiredDescription

account_id

string

Yes

Unique identifier of the virtual account

Example Request

POST {{baseUrl}}/virtual-accounts/1234567890/enable
Authorization: Bearer your_api_token
Content-Type: application/json

Response

Success (200)

FieldTypeDescription

message

string

Success message

account_id

string

Unique identifier of the account

status

string

New status of the account ("enabled")

Example Response

{
  "message": "Virtual account enabled successfully.",
  "account_id": "va_1234567890abcdef",
  "status": "enabled"
}

Disable Virtual Account

Endpoint

POST {{baseUrl}}/virtual-accounts/{account_id}/disable

Description

This endpoint allows you to disable a virtual account, preventing any further transactions until it is re-enabled.

Request

Headers

  • Content-Type: application/json

  • Authorization: Bearer {your_api_token}

Path Parameters

ParameterTypeRequiredDescription

account_id

string

Yes

Unique identifier of the virtual account

Example Request

POST /api/v1/virtual-accounts/va_1234567890abcdef/disable
Authorization: Bearer your_api_token
Content-Type: application/json

Response

Success (200)

FieldTypeDescription

message

string

Success message

account_id

string

Unique identifier of the account

status

string

New status of the account ("disabled")

Example Response

{
  "message": "Virtual account disabled successfully.",
  "account_id": "va_1234567890abcdef",
  "status": "disabled"
}

<?php

$account_id = "1234567890";
$api_token = "your_api_token";
$url = `{{baseUrl}}/virtual-accounts/$account_id/{action}`;

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    "Authorization: Bearer $api_token",
    "Content-Type: application/json"
));

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>

Last updated