Retrieve Ledger Entries

Facades: merchant

Overview

Retrieve a list of ledgers by date range using the merchant facade.

Parameters

ParameterDescription
currencyThe three digit currency string for the ledger to retrieve.
startDateThe first date for the query filter.
endDateThe last date for the query filter.

Example

$ledger = null;

//check within the last few days
$date = new \DateTime();
$today = $date->format("Y-m-d");
$dateBefore = $date->modify('-30 day');
$sevenDaysAgo = $dateBefore->format("Y-m-d");

$ledger = $bitpay->getLedger(Currency::BTC, $sevenDaysAgo, $today);