Retrieve Invoices

Facades: merchant

Overview

An aged list of invoices can be retrieved using method parameters that map to URL parameters on the API.

Parameters

Parameter

Description

dateStart

The start date for the query filter, in YYYY-MM-DD format.

dateEnd

The end date for the query filter, in YYYY-MM-DD format.

status

The invoice status you want to query on, which can be one of the following: New, Paid, Confirmed, Complete, Expired, Invalid, or Declined.

See the InvoiceStatus class for more information.

orderId

The optional order id specified at time of invoice creation.

limit

Maximum results that the query will return (useful for paging results).

offset

Number of results to offset (ex. skip 10 will give you results starting with the 11th).

Example

$datetime = DateTime::createFromFormat('Y-m-d H:i', "2022-04-06 10:00");
$today = $datetime->format("Y-m-d\TH:i:s.v\Z");
$dateBefore = $datetime->modify('-7 day');
$sevenDaysAgo = $dateBefore->format("Y-m-d\TH:i:s.v\Z");
$getInvoices = $bitpay->getInvoices($sevenDaysAgo, $today, null, null, 10, null);