Created
September 7, 2020 16:13
-
-
Save henzard/7a2355d333370d43baf4b5d07a6dac0b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( | |
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. | |
// This is optional, `GuzzleHttp\Client` will be used as default. | |
new GuzzleHttp\Client(), | |
$config | |
); | |
$xero_tenant_id = YOUR_XERO_TENANT_ID; // string | Xero identifier for Tenant | |
$invoice_id = 00000000-0000-0000-000-000000000000; // string | Unique identifier for an Invoice | |
try { | |
$result = $apiInstance->getInvoiceHistory($xero_tenant_id, $invoice_id); | |
print_r($result); | |
} catch (Exception $e) { | |
echo 'Exception when calling AccountingApi->getInvoiceHistory: ', $e->getMessage(), PHP_EOL; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment