xero get invoices
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: OAuth2
$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
$apiInstance = new XeroAPI\XeroPHP\Api\AccountingApi(
new GuzzleHttp\Client(),
$config
);
$xeroTenantId = "YOUR_XERO_TENANT_ID";
$ifModifiedSince = new DateTime("2020-02-06T12:17:43.202-08:00");
$where = "Status=="' . \XeroAPI\XeroPHP\Models\Accounting\Invoice::STATUS_DRAFT . '"";
$order = "InvoiceNumber ASC";
$iDs = array("00000000-0000-0000-0000-000000000000")
$invoiceNumbers = array("INV-001", "INV-002")
$contactIDs = array("00000000-0000-0000-0000-000000000000")
$statuses = array("DRAFT", "SUBMITTED")
$page = 1;
$includeArchived = true;
$createdByMyApp = false;
$unitdp = 4;
$summaryOnly = true;
try {
$result = $apiInstance->getInvoices($xeroTenantId, $ifModifiedSince, $where, $order, $iDs, $invoiceNumbers, $contactIDs, $statuses, $page, $includeArchived, $createdByMyApp, $unitdp, $summaryOnly);
} catch (Exception $e) {
echo 'Exception when calling AccountingApi->getInvoices: ', $e->getMessage(), PHP_EOL;
}
?>