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

Book a draft invoice on a specific invoice number

I have problems with the REST API sending a PUT to Book a draft invoice selecting the invoice number. For example, if my Draft number is 45 and I want to create a Book invoice with number 328, I try this calling with the method PUT (I have changed here the AppID and AccessID for security reasons):


Is that correct?, must I send any JSON data in this petition?, is neccesary to add the header: "Content-Type: application/json" as in the POSTs petitions?

The result of my calling is:

{"message":"We have experienced an internal server error. The error has been logged.", "errorCode":"E00000","developerHint":"If you continue to see errors here, please contact api@e-conomic.com. Remember to include error id and agreement number when contacting support.","logId":"70d9230f-fac1-4b8a-a93b-aaf887420bbf","httpStatusCode":500,"logTime":"2015-03-13T20:17:13"}

- - - - - - -

When I see the details of a Draft invoice with the GET method, in the last lines appears the next description, that is the thing that I'm trying to do:

"bookWithNumber":{"description":"Book a draft invoice on a specific invoice number.","href":"https://restapi.e-conomic.com/invoices/booked/_4_bookingNumber?AppID=eRAvkbyi8hh3lJBGUhA_R4gsz4J0t-gp_6nN_PsL7P41&AccessID=gd3TjweI22f_LR-w-Mm4cayNO_KliZLvX-rCzojkRaE2","httpMethod":"put"}


Thanks a lot

created Mar 13, 2015 by aabascal
100% Accept Rate
Q 1 A 0 C 0

1 Answer

Best answer



"_4_bookingNumber" means ":bookingNumber".

To book invoice 26 with number 32465
PUT https://restapi.e-conomic.com/invoices/booked/32465
Payload: {"id":26}

This won't work until March 26 as the deprecated endpoint is broken in that regard (hence why it is deprecated). We've added a quickfix to the code though and it is expected to be released on the 26th.
Please do note that the endpoint has a status of deprecated and no extensive work will be carried out on it. We were lucky that this was possible to fix in a jiffy :-)

answered Mar 25, 2015 by olej
Visma e-conomic A/S