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

Webhook: Finding DebtorNumber for Cashbook booked

0

When using webhook for cashbook booked, i get from serialnumber and to serialnumber. With these, it is possible to get Entries from the API via Entry_FindBySerialNumberInterval, where the data afterwards can be requested with Entry_GetData(Array).

However the result from Entry_GetData, does not give any information about which debtor the payment is related to.

I can see it is a DebtorPayment and account 5600 (debtors), but not debtor number.

The goal is to keep debtor balance in sync between e-conomic and local system. This is not possible, if i cannot detect DebtorPayments DebtorNumber.

 

Result for an Entry_GetData

(

            [Handle] => stdClass Object

                (

                    [SerialNumber] => 49753

                )

 

            [SerialNumber] => 49753

            [AccountHandle] => stdClass Object

                (

                    [Number] => 5600

                )

 

            [Amount] => -500.00

            [AmountDefaultCurrency] => -500.00

            [Quantity1] => 

            [Quantity2] => 

            [CurrencyHandle] => stdClass Object

                (

                    [Code] => DKK

                )

 

            [Date] => 2013-10-23T00:00:00

            [Text] => Indbet. fak.

            [Type] => DebtorPayment

            [VoucherNumber] => 50001

        )

created Oct 23, 2013 by ksvendsen
20% Accept Rate
Q 6 A 12 C 1

1 Answer

+1
 
Best answer

Hi,

Entries are the financial part - but incidentally, any corresponding debtor entries share the same serial numbers (internally, debtor entries are actually a subset of entries).

Therefore, you can simply take the serial number interval from the web hook and throw it at DebtorEntry_FindBySerialNumberInterval - that should give you any payments and/or manual debtor invoices that have been booked from the cash book.

In combination with the InvoiceBooked web hook for actual debtor invoices, you should be able to keep in sync this way.

 

Best regards,

answered Oct 24, 2013 by Christian Estrup
selected Oct 24, 2013 by ksvendsen
Visma e-conomic A/S
...