acumatica Exporting Records via REST Contract-Based API Data Export in a Single REST Call


Example

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:

  • all stock items existing in the application
  • all sales order of the IN type

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 all stock items in a single REST call:

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 all sales order of the IN type in a single REST call:

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);
}