API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Get Invoice nr. using customer number (and cost number)

*EDIT* - like whole post
Initially I asked how to do this, but I managed to implement what I wanted.
Ok.. the problem I have now is the following:
I manage to call Invoice_FindByNumber and get the result, but the result is empty. 
Here is my code:
$client = new SoapClient($wsdlUrl, array("trace" => 1, "exceptions" => 1));
'xmlns' => "http://e-conomic.com",
foreach($array as $i)
       $rez =$client->Invoice_FindByNumber(array('number' => $i));
       echo '<br>';
And the rezult that I get has the following format:
object(stdClass)#2 (0) { } 
object(stdClass)#3 (0) { } 
object(stdClass)#2 (0) { } 
object(stdClass)#3 (0) { } 
The customer numbers that I use to call this method are fine, because someone does this task manually, but what am I doing wrong right now? Or is what I get ok and I have no idea what to do with it?
created Apr 14, 2016 by alyn509
100% Accept Rate

edited Apr 18, 2016 by alyn509
Q 2 A 0 C 2

2 Answers

Best answer

Hi Alyn

Please use either Invoice_FindByNumberInterval or Invoice_FindByNumberList

Both take your array and give you an array of invoice handles back.

To work with the data you need to get it first by feeding the invoice handle array to Invoice_GetDataArray

answered Apr 15, 2016 by olej
selected Jan 18, 2017 by alyn509
But.. If you already have the numbers why not just wrap them as handles and get the data straight away instead?
answered Apr 15, 2016 by olej
Visma e-conomic A/S