In this example you will explore how to export the following data from Acumatica ERP in a single call via the REST Contract-Based API:
If you need to export records from Acumatica ERP, use the following URL:
http://<Acumatica ERP instance URL>/entity/<Endpoint name>/<Endpoint version>/<Top-level entity>
<Top-level entity>
is the name of the entity which you are going to export
To export stock item records from a local AcumaticaERP
instance by using the Default endpoint of version 6.00.001, you should use the following URL: http://localhost/AcumaticaERP/entity/Default/6.00.001/StockItem
Below is the sample code written in C# to export all stock items by sending a single REST call to the Default endpoint of version 6.00.001:
using (RestService rs = new RestService(
@"http://localhost/AcumaticaERP/", "Default/6.00.001",
username, password, company, branch))
{
string stockItems = rs.GetList("StockItem");
}
To export sales orders of the IN type from a local AcumaticaERP
instance by using the Default endpoint of version 6.00.001, you should use the following URL: http://localhost/AcumaticaERP/entity/Default/6.00.001/SalesOrder?$filter=OrderType eq 'IN'
Below is the sample code written in C# to export all sales orders of the IN type by sending a single REST call to the Default endpoint of version 6.00.001:
using (RestService rs = new RestService(
@"http://localhost/StackOverflow/", "Default/6.00.001",
username, password, company, branch))
{
var parameters = "$filter=OrderType eq 'IN'";
string inSalesOrders = rs.GetList("SalesOrder", parameters);
}