Discussions
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
How to get (download) Invoice PDF by API (web services)?
I'm a newbie in NetSuite, today I'm trying to develop a demo to get invoice. I used this library
ryanwinchester/netsuite-php
I can get invoice information by this code:
$transactionSearch = new SearchEnumMultiSelectField();
$transactionSearch->operator = "anyOf";
$transactionSearch->searchValue = array('_invoice');
$search = new TransactionSearchBasic();
$search->type = $transactionSearch;
$request = new SearchRequest();
$request->searchRecord = $search;
$searchResponse = $netsuite_service->search($request);
But no invoices PDF URL in response.
Then I tried with MessageSearchBasic
$messagesSearch = new SearchBooleanField();
$messagesSearch->searchValue = true;
$search = new MessageSearchBasic();
$request = new SearchRequest();
$request->searchRecord = $search;
$searchResponse = $netsuite_service->search($request);
I can get the list of sent email with invoices PDF URL, but this one only can get sent email, for transactions not yet send email this can't get.