The integration or consume third-party APIs in D365 Finance & Operations, we need to design models (Contract class) in first step to deserialize the JSON which is difficult to make for huge JSON, so i design the solution that, write the code of consuming API in C# Library and return the model in D365 F&O and use them.
Steps are below:
1st Step
We need to create c# Class library and create a model class or past special, it will converted to models automatically .
This will help you to create huge JSON model in just one click.
After all this process build the C# Library and get the dll
![](https://evinciblesolutions.com/us/wp-content/uploads/2023/03/Step-1.png)
2nd Step
Goto the D365 F&O project reference and browse the dll and add that into your project.
![](https://evinciblesolutions.com/us/wp-content/uploads/2023/03/Step-2.png)
3rd Step
Write the code to call the C# Library method from D365 F&O using x++
![](https://evinciblesolutions.com/us/wp-content/uploads/2023/03/Step-3.png)
By using above steps you can use C# models in D365 F&O and implement the solution .