Facades: merchant
Overview
Get settlements filtered by query parameters.
Parameters
Parameter | Description |
---|---|
currency | The three digit currency string for the ledger to retrieve. |
dateStart | The start date for the query. |
dateEnd | The end date for the query. |
status | Can be processing , completed , or failed . |
limit | Maximum number of settlements to retrieve. |
offset | Offset for paging. |
Example
import java.text.SimpleDateFormat;
List<Settlement> settlements = null;
Date date = new Date();
Date dateBefore = new Date(date.getTime() - 30 * 24 * 3600 * 1000);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String today = sdf.format(date);
String oneMonthAgo = sdf.format(dateBefore);
// make sure we get a ledger with a not null Entries property
settlements = bitpay.getSettlements(Currency.USD, oneMonthAgo, today, null, null, null);