#PowerAutomate – Get a copy of an invoice from your E-conomic system

In my company we use e-conomic as our ERP system and it is also used to send invoices to our customers.

Now our commercial managers do not have access to e-conomic but they do need the information about what is invoiced to our customers.

We have build our own CRM system using a Model driven Power App where each commercial manager has access to his accounts.

So how can I give the account manager access to a specific invoice for a specific customer ?

Power Automate and the e-conomic api comes to the rescue.

First of all you need to sign up for a developer account at e-conomic – Developer (e-conomic.com) – this will give you the opportunity to build an app in e-conomic that you can install in your e-conomic ERP app.

There is a fine description on how to do this here – Connecting to the APIs using tokens (e-conomic.com)

When the app is installed you will get an AppSecretToken and a Granttoken – the App secret is generated when you install the app and the Granttoken is visible in the list columen “Adgangs-ID”

Set up the flow

  1. Go to https://make.powerautomate.com/
  2. Pick the right environment
  3. And choose create
  4. Then I picked “Instant cloud flow

    But you could pick another type of trigger from one of the other connectors – perhaps react to an e-mail with the invoice number as a subject or ???

  5. Name your flow and choose the trigger
    and click create
  6. And in order to retrieve a single invoice I add an Input field
  7. Click the Next step button and search for the HTTP connector

    and choose the HTTP action

  8. Choose the GET method and for the URI – you specify – https://restapi.e-conomic.com/invoices/booked/

    and then select Invoice number from the dynamic content list of fields

    and after the Invoice number you add – /pdf – !!!

  9. In order to authenticate the Http request against the e-conomic API – we have to add some headersThe headers has to be X-AppSecretToken and X-AgreementGrantToken

    and you have to use the information from your App registration to get these.

  10. The http request will return a pdf document that then should be saved somewhere – when search for “create file” you can see a lot of possible places to save it

    In this example I will save the file to a OneDrive for Business folder

    So I choose a folder and name the file with the dynamic content of the invoice number and use the Body returned by the Http step as the content of the file that should be created.

  11. Next up – lets save the flow and test it

    so I enter a invoice number I know and hit run

    And success

Final words

In our case we have enhanced the process a bit more and transfer the invoices to an Azure blob storage on a daily schedule plus we have integrated our model driven app with Power BI reporting. So the customer form contains a tab with a Power BI report filtered by the customer with access to all the invoices and KPI’s for the customer.

Hope this give you some inspiration as well.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s