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

CurrentInvoiceLine_CreateFromDataArray: Encoding: object has no 'Number' property

0

Gives me an error: SOAP-ERROR: Encoding: object has no 'Number' property

$bookinvoice = $client->CurrentInvoiceLine_CreateFromDataArray(
                            array('dataArray' =>
                                    array(
                                            'CurrentInvoiceLineData' => array (
                                            'Handle'    => array('Id' => $invoiceId), // user's unique ID
                                            'Number' => 1, // Is it invoice ID???
                                            'DeliveryDate' => date("c"),
                                            'Quantity' => 1.00,
                                            'UnitNetPrice' => $project->goal,
                                            'DiscountAsPercent' => 0.00,
                                            'TotalNetAmount' => $project->goal,
                                            'TotalMargin' => 20.00, //  
                                            'MarginAsPercent' => $marginaspercent
                                        )
                                    )
                            )
                    );

 

I have  (from function CurrentInvoice_CreateFromDataArray)

$invoiceId = $createinvoice->CurrentInvoiceHandle->Id;

 

QUESTION: where in this code for CurrentInvoiceLine_CreateFromDataArray abowe my $invoiceId ?

Why I am receiving SOAP-ERROR: Encoding: object has no 'Number' property?

But I added all fields which are required according to this documentation
(including Number, which  received from function CurrentInvoice_CreateFromDataArray)

https://api.e-conomic.com/secure/api1/economicwebservice.asmx?WSDL

image


MinOccurs means required, is that correct?

Maybe I am using wrong documentation? Do you think you could could
provide me link to correct version of documentation?

created Dec 21, 2015 by webmat
0% Accept Rate
Q 6 A 0 C 1

1 Answer

0

MinOccurs 1 is rather useless. It can help identify WSDL requirements but tells you nothing about application specific requirements.

You should go for the human readable documentation: https://api.e-conomic.com/secure/api1/EconomicWebService.asmx?op=CurrentInvoiceLine_CreateFromData

XML structure as described on above link.

<Handle>
          <Id>int</Id>
          <Number>int</Number>
        </Handle>
        <Id>int</Id>
        <Number>int</Number>
        <InvoiceHandle>
          <Id>int</Id>
        </InvoiceHandle>
        <Description>string</Description>
        <DeliveryDate>dateTime</DeliveryDate>
        <UnitHandle>
          <Number>int</Number>
        </UnitHandle>
        <ProductHandle>
          <Number>string</Number>
        </ProductHandle>
        <Quantity>decimal</Quantity>
        <UnitNetPrice>decimal</UnitNetPrice>
        <DiscountAsPercent>decimal</DiscountAsPercent>
        <UnitCostPrice>decimal</UnitCostPrice>
        <TotalNetAmount>decimal</TotalNetAmount>
        <TotalMargin>decimal</TotalMargin>
        <MarginAsPercent>decimal</MarginAsPercent>
        <DepartmentHandle>
          <Number>int</Number>
        </DepartmentHandle>
        <DistributionKeyHandle>
          <Number>int</Number>
        </DistributionKeyHandle>
        <InventoryLocationHandle>
          <Number>int</Number>
        </InventoryLocationHandle>

 

answered Dec 21, 2015 by olej
Visma e-conomic A/S
...