Last active
September 12, 2016 21:29
-
-
Save jaredk2g/1e36398a9c162e9ada66b337dd308921 to your computer and use it in GitHub Desktop.
List the events for an invoice on Invoiced (PHP)
This file contains 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 | |
// prerequisite: run "composer require invoiced/invoiced" | |
require 'vendor/autoload.php'; | |
$invoiced = new Invoiced\Client('TODO_INSERT_API_KEY'); | |
$objectType = 'invoice'; | |
$invoiceId = 'TODO_INSERT_INVOICE_ID'; | |
// List the events for an object (i.e. an invoice) | |
$relatedTo = $objectType.','.$invoiceId; | |
list($events, $metadata) = $invoiced->Event->all(['related_to' => $relatedTo]); | |
foreach ($events as $event) { | |
echo $event; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment