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)

0
*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:
 
_________________________________________________________________________
<?php
 
$client = new SoapClient($wsdlUrl, array("trace" => 1, "exceptions" => 1));
 
 
$client->ConnectWithToken(array(
'xmlns' => "http://e-conomic.com",
'token' => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
'appToken' => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));
 
$array = array(XXXXXXXX, XXXXXXXX, XXXXXXXX, XXXXXXXX);
foreach($array as $i)
{
       $rez =$client->Invoice_FindByNumber(array('number' => $i));
       var_dump($rez); 
       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

+1
 
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
+1
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
...