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

Web hook on "Order updated": How to determine if order was converted to Invoice


I have a web hook on the "order updated" event, and I'm receiving the old and new ids without problems.

On my server I'm trying to determine whether:

  1. A new order was created
  2. An order was updated
  3. An order was deleted
  4. An order was converted to an Invoice.

I'm having trouble getting number 4 to work. The only thing I have to work on, is the old id, and I don't see any SOAP methods that can translate the old entity id to an invoice id (if the invoice exists). I've tried several hacks, but with no luck. I hope someone here can help.

created Dec 28, 2015 by Morten2990
0% Accept Rate
Q 3 A 0 C 0

1 Answer

Hi Morten

An order being converted to an invoice will trigger two web hooks (providing you've set these up):
First: An OrderUpdated web hook with OldNumber:OrderNumber and NewNumber:blank
Secondly: An InvoiceUpdated web hook with OldNumber:blank and NewNumber:CurrentInvoiceNumber

All this tells you is that an order stopped existing and an invoice started to exist.

To have a cross-reference all the way from Quotation to Order to CurrentInvoice to Invoice you should set "OtherReference" and use this for reference to the object.

There is no separate "OrderUpgradedToInvoice" web hook.
answered Jan 4, 2016 by olej
Hi there,
I'm currently trying to accomplish the same thing, and the method you provide makes sense. The problem is that I'm not able to trigger the InvoiceUpdated webhook when going from Order -> Invoice. Only the OrderUpdated web hook is triggered.
I've setup "Order Updated", "Invoice Updated" and "Invoice Booked". The first and last web hook is triggered but never "Invoice Updated". The only way I can trigger that web hook is by editing the invoice, e.g. inputting a value in "OtherReference" and click save.

Do I need to do something else in order to have the "Invoice Updated" web hook triggered?
To follow up I found out that the web hooks "Order updated" and "Invoice updated" are not triggered if using the functionality to transfer the order to invoicing (instead of editing the order and clicking "Upgrade to Invoice".

Is that by design or a bug? It's quite annoying as it makes it complicated  to perform an action once an order is ready for delivery and transfered to invoicing (but not yet ready to be booked)
Visma e-conomic A/S