Transaction History

Fetch Virtual Account Transaction History

Endpoint

GET {{baseUrl}}/virtual-accounts/{user_id}/transactions

Description

This endpoint allows you to fetch the transaction history of a virtual account.

Request

Headers

  • Content-Type: application/json

  • Authorization: Bearer {your_api_token}

Path Parameters

Example Request

GET {{baseUrl}}/virtual-accounts/{user_id}/transactions
Authorization: Bearer your_api_token
Content-Type: application/json

<?php

$user_id = "123456";
$api_token = "your_api_token";
$base_url = "{{baseUrl}}";
$url = "$base_url/virtual-accounts/$user_id/transactions

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 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);
?>

Get Individual Transaction by ID

Endpoint

GET {{baseUrl}}/transactions/{transaction_id}

Description

This endpoint allows you to fetch details of an individual transaction by its unique identifier.

Request

Headers

  • Content-Type: application/json

  • Authorization: Bearer {your_api_token}

Path Parameters

Example Request

<?php

$transaction_id = "txn_abcdef123456";
$api_token = "your_api_token";
$base_url = "{{baseUrl}}";
$url = "$base_url/api/v1/transactions/$transaction_id";

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 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