Retrieve Settlements

Facades: merchant

Overview

Get settlements filtered by query parameters.

Parameters

ParameterDescription
currencyThe three digit currency string for the ledger to retrieve.
dateStartThe start date for the query.
dateEndThe end date for the query.
statusCan be processing, completed, or failed.
limitMaximum number of settlements to retrieve.
offsetOffset 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);