Dynamics 365 Business Central OData V4 Web Service Setup (Purchase Invoice)

Publish Purchase Invoice Web Service

This document is applicable for Dynamics 365 Business Central. Gorilla Expense integrates with Dynamics 365 using web services provided by Dynamics 365 Business Central. The first step is to create the “PurchaseInvoice” and

“PurchaseLines” web services in Dynamics 365. Web services setup can be accessed in Dynamics 365 searching for

“Web Service”


 


 

 

Figure 1

 

Create the new services, by selecting Object Type as “Page”, Object Id as 51 for Purchase Invoice, service name as PurchaseInvoice and Object Id as 55 for Lines, service name as PurchaseLines. Make sure the “Publish” checkbox is checked for both.

 


 

 Figure 2


 

Make sure the new web service is called PurchaseInvoice and PurchaseLines (no spaces in between and capital sensitive letters) and published checkbox is checked as shown above.

 

Once the above steps are completed, copy the PurchaseInvoice and PurchaseLines URL from the field called “OData V4 URL”. And provide it to Gorilla Expense team. Repeat this on for all companies. Example OData V4 URL will look like mentioned below

 

https://api.businesscentral.dynamics.com/v2.0/59acb64d-7f3d-4920-b40e- e3567a44d24e/Sandbox/ODataV4/Company('CRONUS%20USA%2C%20Inc.')/PurchaseInvoice

 

https://api.businesscentral.dynamics.com/v2.0/59acb64d-7f3d-4920-b40e- e3567a44d24e/Sandbox/ODataV4/Company('CRONUS%20USA%2C%20Inc.')/PurchaseLines

 

 

Publish Attachments Web Service

Optionally, Gorilla Expense can also send Receipts as attachments to the Purchase Invoice created via the Purchase Invoice Web service (published in the above section). Gorilla Expense integration does this by sending the receipts to the “Attachments” web service in BC. The pre-requisite for this integration to work is to create the “Attachments” web service in Dynamics 365 by following the steps mentioned below. Web service setup can be accessed in Dynamics 365 searching for “Web Service”.

Figure 5

 

Create a new service, by selecting Object Type as “Page” and Object Id as “20039 attachments”

 

 

Figure 6

 

Make sure the new web service is called Attachments and the published checkbox is checked as shown above.

 

Once the above steps are completed, copy the URL from the field called “OData V4 URL”. And provide it to Gorilla Expense team. Repeat this on for all companies. Example OData V4 URL will look like mentioned below

 

https://api.businesscentral.dynamics.com/v2.0/59acb64d-7f3d-4920-b40e- e3567a44d24e/Sandbox/ODataV4/Company('CRONUS%20USA%2C%20Inc.')/Attachments

 

 

Publish Workflow purchase Documents Web Service

Once the “Attachments” web service is published you also have to create and publish the “Workflow Purchase Document” web service in Dynamics 365. Web service setup can be accessed in Dynamics 365 searching for “Web Service”.

 


 

Figure 7

 

Create a new service, by selecting Object Type as “Page”, Object Id as 6404 for workflow Purchase

Documents, service name as purchaseDocuments and make sure the “Publish” checkbox is checked.

 

Text  Description automatically generated

 

Figure 8

 

Make sure the new web service is called purchaseDocuments (no spaces in between and capital sensitive letters) and published checkbox is checked as shown above.

 

Once the above steps are completed, copy the URL from the field called “OData V4 URL. And provide it to Gorilla Expense team. Repeat this on for all companies. Example OData V4 URL will look like mentioned below

 

https://api.businesscentral.dynamics.com/v2.0/59acb64d-7f3d-4920-b40e- e3567a44d24e/Sandbox/ODataV4/Company('CRONUS%20USA%2C%20Inc.')/purchaseDocuments