Acumatica REST API

HI All,

With Acumatica 6 release you can find (and actually use) new type of API – Rest API.

Acumatica 6 API

Acumatica Rest API is based on Contract based API, so here you have some important points:

  • You need to use existing or custom endpoint be able to send API calls
  • Field and container is available for REST API only if it is defined in contract. But you may extend existing contracts.
  • With REST API you have the same set of commands that you have with Contract Based API.
  • Acumatica uses Json format for transfer data between client and server
  • You still have to maintain session and authentication cookies.

URL: http://<InstanceName>/entity/<EndpointName>/<EndpointVersion>/<Entity>
Example: http://acumatica.com/entity/Default/6.00.001/StockItem

Ok, lest try to do some examples. Here I will show you how to call Acumatica REST commands from Browser. By using this approach you can easily test functionality and just feel, how does it work.

To do so, we need a special tool. I will use PostMan extension for Google Chrome browser.

postman api builder

As we need to maintain session and cookies between calls, we also need to install Postman Interceptor extension.

postman api builder

Login
Now we actually can login. To do so, we need to send our credentials for the specific url:
URL: http://acumatica.com/entity/auth/login
JSON:

{
    "name" : "admin",
    "password" : "123",
    "company" :  ""
}

Response should be 204 No Content.

Geting
Ok, authentication is done, lets try to select data.

URL: http://acumatica.com/entity/Default/6.00.001/StockItem

Filtering
If we want some filtering or conditions, we just can use “OData” like filters – $filter=ItemStatus eq ‘Active’

URL: http://acumatica.com/entity/Default/6.00.001/StockItem?$filter=ItemStatus eq ‘Active’&$top=9

Additional parameters that you can use together with URL when you retrieve records from Acumatica ERP:

  • $filter: To specify filtering conditions on the records to be returned
  • $skip: To specify the number of records to be skipped from the list of returned records
  • $top: To specify the number of records to be returned in the list
  • $expand: To specify the linked and detail entities to be expanded
  • $custom: To specify the fields that are not defined in the contract to be returned

Getting Single Record
If you know key, you can easily get details about single record – just add key field to the url string:

URL: http://acusea.acumatica.com/future/entity/Default/6.00.001/StockItem/AACOMPUT01

Puting
You also can create new entity using REST API, in this case you need to use PUT method and send item details using JSON format. Name of the fields and containers you can get from Contract definition.

URL: http://acusea.acumatica.com/future/entity/Default/6.00.001/StockItem
JSON:

{
    "InventoryID" : {value : "Kettler" } ,
    "Description" : {value : "New Cool Kettler" },
    "ItemClass" : {value : "ELECCOMP" }
}

Documentation
Good news that the documentation on the REST API is included right within standard Acumatica Help. There you can find multiple examples and good code snippets that you can use from your favorite language/platform/code.

Have a nice integration!

89 Replies to “Acumatica REST API”

  1. Hi Andrew,

    You can use it like this:
    http://[Base endpoint URL]/[Top-level entity]/[Action name]

    You use the POST HTTP method and pass the record to which the action should be applied and the parameters of the action in the request body in JSON format as follows:
    {
    "entity" : [record in JSON format],
    "parameters" : [parameters in JSON format]
    }

    1. Hi Sergey,
      {
      “entity” : [record in JSON format],
      “parameters” : [parameters in JSON format]
      }
      Can you please give an example for passing the entity. I am getting an error like this:
      {
      “message”: “The request is invalid.”,
      “modelState”: {
      “entity”: [
      “Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path ‘entity’, line 2, position 13.”,
      “The Entity field is required.”
      ],
      “parameters”: [
      “Error reading JObject from JsonReader. Current JsonReader item is not an object: Null. Path ‘parameters’, line 119, position 23.”
      ]
      }
      }

    2. I am looking to relate two entities specifically a customer and contacts I thought It would be as easy as passing in an array of contact ids but errors saying fields cannot be empty but everything already exists I just want to relate the objects. Would I do this through an action?

      How do I get a list of all the actions?

      How come sometimes it says that x is not defined in the dictionary ? Can I get a list of things that are defined in the each dictionary?

      1. Hi Ed,
        I’m not sure if I got your question correctly, but if you want to attach new contact to customer, you should work thought screen – contacts and than specify there BAccount. Than Contact will be linked to customer.
        If you mean something else, please give me more details about command you use and exact error message with stack trace.

  2. Hi Dkardell,
    You should pass filters with query URL. And yes, you should have spaces there, but in the end spaces should be encoded as accordingly to standard URL encoding rules

  3. Hi Sergey,

    I'm trying to work with the REST APIs using PHP cURL code.

    I'm testing by doing to calls in Postman: Login, Create a Customer. It works fine.

    Then I generate the PHP cURL code and run the code in PHP, but I get an error on the second call: {"message":"You are not logged in."}

    I'm thinking that Postman automatically passes the session information between calls.

    So, I added Postman Interceptor and now I get back cookie information like this: https://imgur.com/a/zejPA

    But, when I generate the PHP cURL code, it still doesn't generate the cookie information:
    "http://localhost/Acumatica/entity/auth/login&quot;,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{rn "name": "admin",rn "password": "mypassword",rn "company": "Company"rn}",
    CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/json",
    "postman-token: 3af0af99-e514-ab2e-4f69-7481a1b9c6ce"
    ),
    ));

    $response = curl_exec($curl);
    $err = curl_error($curl);

    curl_close($curl);

    if ($err) {
    echo "cURL Error #:" . $err;
    } else {
    echo $response;
    }

    Do you know how to get the PHP cURL code that will pass the cookie information between API calls?

  4. Hi Sergey,
    I am trying to use the action Prepare Invoice for a sales order with the instructions from your post dating 26th January.
    I can't get it to work, do you think it is possible to do it for this action ?

    Thanks,

  5. Hi Sergey,

    Nevermind on this. I was able to get it to work.
    I needed to add the PrepareInvoice action in web service endpoint SalesOrder.

  6. Can we create record with custom field in rest api:
    {
    "OrderType": {value: "IN"},
    "CustomerID" : {value : "1ARA" } ,
    "Details" :[
    {
    "InventoryIDz": {value: "1BRO01"},
    "InventoryID" : {value: "6DOC"}
    }]
    }

  7. Hi Indranil,

    Try using no filters to find out the date field name for the specific object(endpoint) you are looking for. For example, the StockItem endpoint gives information about the items that are on stock. It has a field 'LastModified' that accepts date values as filters. Here is how the filter can be applied.
    https:///StockItem?$filter=ItemStatus eq 'Active' and LastModified gt datetimeoffset'2017-10-01'
    This URI would fetch all stock items that are in a status of 'Active' and modified after 01-OCT-2017.

    Good luck.

  8. I did think the best way to fetch a product price would be to use the endpoint for products(NonStockItem or StockItem I think) and then use the response JSON to extract the relevant information (in this case the price as you want it) from it.
    As for the multiple addresses, I think these multiple addresses would need to be added as a JSON array onto the corresponding linked entity. I have not tried it myself though.

    Cheers

  9. NonStockItem or StockItem are not the best place for price, as price may be different per customer/class/item/promotion and so on.
    There is an example in our Acumatica I210 training guide (Contract-Based Web Serivices) that uses small csutomization fro that. Please check Lesson 3.4: Retrieving the Price of an Item
    You can do the same with REST, but use PUT method

  10. Hi, how do I select a value from a selector based on some condition? I'm creating an Inventory Adjustment transaction and I need to select a ReceiptNbr to associate with the adjustment transaction. I need to select the oldest receipt with a non zero qty. on hand from the selector. How do I perform this? Can you provide an example? Thank you.
    -Raj

  11. Hi Rajasekaran,
    I do not think you can do this in one request. I suggest you get oldest receipt from receipts screen or generic inquiries and than create a adjustment with second request.

  12. Hello,

    I created a Production Order using the REST api in Postman. Now I need to release this production order.

    I am POSTing to http://localhost/Development/entity/MANUFACTURING/17.200.001/ProductionOrder/ReleaseProductionOrder
    {
    "entity":{"ProductionNbr": {"value": "0000249"}},
    "parameters": null
    }

    response:

    {
    "message": "The request is invalid.",
    "modelState": {
    "parameters": [
    "Error reading JObject from JsonReader. Current JsonReader item is not an object: Null. Path 'parameters', line 3, position 22."
    ]
    }
    }

    Any idea on why I am getting this message ?

    Thanks,

    Mauricio Camara

  13. Hi Maurício,
    I see that you miss the second key of Production Order – OrderType. When you pass entity you need to pass all keys to find it.
    Also make sure that your action is defined in the contract.

  14. Thanks for the response Sergey …

    I tried passing the OrderType as well. I tried using ProductionNbr as well as the DB field name ProdOrdID. The Action is defined in the web services endpoint ProductionOrder > Actions > ReleaseProductionOrder.

    Passing the number and type my response was:
    {
    "message": "The request is invalid.",
    "modelState": {
    "parameters": [
    "Error reading JObject from JsonReader. Current JsonReader item is not an object: Null. Path 'parameters', line 3, position 22."
    ]
    }
    }

    Thanks a lot,

    Mauricio

  15. Hi Maurício,
    I'm really sorry for long reply. Could you please create a case with Acumatica team? It looks that we need to investigate your problem. Thank you!

  16. Hey Tourvi,

    You should be able to get the list of available endpoints and its fields on the menu "System" >> "Integration" >> "Web Service Endpoints".

    Goodluck!

  17. Hi Nick,
    You can use allocations popup on SO to put LotSerialNbr there:
    new SalesOrderDetail()
    {
    InventoryID = new StringValue() { Value = "AAMACHINE1" },
    Allocations = new SalesOrderDetailAllocation[]
    {
    new SalesOrderDetailAllocation()
    {
    Allocated = new BooleanValue() { Value = true },
    LotSerNbr = new StringValue() { Value = "123" },
    },
    },

    Or you can create shipment from shipment screen and link it with sales order. In second case you need to have 2 calls.

  18. Hi Sergey,

    I was referring to how use the rest api. I am using postman and I have been unable to submit a value to the detail array.

    I was thinking it would look something like this:

    {
    ShipmentNbr: { value: "Shipment #" },
    ShipmentDate: { value: "4/26/2018"},
    Detail: [
    {
    Inventory: { value: "Some Item ID"},
    ShippedQty: { value: "9" }
    }
    ]

    }

    This does not seem to work.

    Thanks in advance

  19. Nick,
    One of the issues you have is "Inventory" -it should be "InventoryID"
    But if that does not help, please connect me by skype and we can discuss it there. I'll need an error message.

  20. HI Sergey,

    The InventoryID does not work either.

    I am trying to update the shipping lines (Lot Serial Numbers) via a put method, but it seems that the api method only attempts to add new line. is there some kind of identifier (like the @@ in import scenarios) so I can uniquely identify a specific shipping line.

    What would be the best way to message you, so I can give you my skype info?

    Thanks for all the help.

  21. Nick, sorry for later reply.
    You can retrieve data by using record ID. Read about it here http://help.acumatica.com/Main?ScreenId=ShowWiki&pageid=bc9531b0-717b-4b2d-8899-ff7ca805ade1
    Or you also can retrive and update record by keys
    http://help.acumatica.com/Main?ScreenId=ShowWiki&pageid=52c97a83-1fa1-40e9-8219-52a89a91f2da
    Id can be obtained from "ID" field when you retrieve records.

    To contact me please message me in linkedin or thought google hangouts. For security reasons I do not want to publish my skype on blog.

  22. Hi Sergey,

    When sending a request fetch details for a specific StockItem is it possible for the response to include information on the ItemSalesCategory records a item is associated with?

    I reviewed the StockItem schema, but was unable to locate a reference to the associated ItemSalesCategory fields.

    I did find a method to retrieve the information by making a second request using a filter on ItemSalesCategory, but it would help reduce the number of calls required to integrate each StockItem if there was a method to include these details with the existing information for a StockItem.

  23. Hey Sergey,

    I am trying to find if there is a problem with the REST API endpoints starting with 6.00.001. This has been happening for the past couple of days. The usual SalesOrder endpoint I have been using in the past is now rendering a “Object reference not set to an instance of an object”. Any clues why this is happening?

    Thanks
    Lakki

    1. Hi Lakki, as far as I know there are many customers who are using REST API 6.00.
      And NullReferenceException may be a reason of many things including Sales Order itself.
      Could you please provide a bit more details? – Stack Trace, code?

  24. I create an endpoint for SM200530 and try to upload attachment file through rest API. Please note that DAC of this screen does not have CD column. Therefore the uri of api as below.
    (PUT) http://localhost:5481/entity/Security/17.200.001/EncryptionCertificate/e8e1d3c5-f9fd-49d9-9afc-b209d4f9522d/files/test.txt
    (BODY) binary -> attached test.txt file

    Error from postman
    {
    “message”: “An error has occurred.”,
    “exceptionMessage”: “No entity satisfies the condition.”,
    “exceptionType”: “PX.Api.ContractBased.NoEntitySatisfiesTheConditionException”,
    “stackTrace”: ” at PX.Api.ContractBased.EntityService.PutFiles(ISystemContract systemContract, String version, String name, EntityImpl entity, File[] files, CbOperationContext operationContext)\r\n at PX.Api.ContractBased.SystemContracts.V2.SoapFacade.PX.Api.ContractBased.IRestGate.PutFile(EntityImpl entityImpl, String filename, HttpContent body)\r\n at PX.Api.ContractBased.SystemContracts.V2.RestController.PutFile(String objectName, String ids)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.c__DisplayClass10.b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.d__0.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Controllers.ExceptionFilterResult.d__0.MoveNext()\r\n— End of stack trace from previous location where exception was thrown —\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()”
    }

  25. Hi Sergey,

    I have created a new REST API endpoint. Now, I want to deploy it to 200 sites of my clients. How can I achieve that?
    There was a post from Acumatica stackoverflow said that the API migration can be done through customization package. However, in my situation it is very troublesome to manually apply customization for 200 sites.

    Best Regards,
    Khiem.

    1. Hi Vo,
      Unfortunately I can’t answer this from top of my head and need to debug code first. I’ll try to do this as soon as I have some time. But it may be faster if you create a supprot case, so our services team can check your code faster.

  26. H Sergey,

    I try to get list of tenants per site.
    [GET] http://localhost:5481/entity/Security/17.200.001/Tenants (SM203530)
    It gives me error. Please assist.
    “exceptionMessage”: “Optimization cannot be performed.The following fields cause the error:\r\nTenantName: View Companies has BQL delegate\r\nTenantID: View Companies has BQL delegate\r\nCurrent: View Companies has BQL delegate\r\nLoginName: View Companies has BQL delegate\r\nStatus: View Companies has BQL delegate\r\n”,
    “exceptionType”: “PX.Api.ContractBased.OptimizedExport.CannotOptimizeException”

    however, if I try to put in CompanyID, it returns expected data.
    [GET] http://localhost:5481/entity/Security/17.200.001/Tenants/3

  27. Hi, How can I update the items on a sales order record through REST API, such as the quantity, discount? do I need to supply a specific row number? If i’m trying to update its creating a new line but that’s not i need, it should be update based on inventory id. please help me out.

      1. Hi Sergey Marenich
        Thanks Its working fine, can we check specific item is there or not in the Sales order using filter operation, because its not easy to fetch the item id in the salesorder to update it.
        i tried with /SalesOrder?$expand=Details&$filter=ExternalRef eq ‘3422978000000217039’&$filter=Array.Details.InventoryID eq ‘DEMOITEM4’

    1. Hi Munesware,
      Checking item by InventoryId is not always correct as you may have multiple lines with the same inventory item in the SO.
      Better use IDs, or select items with filtering by Inventory and than get IDs

      1. I didn’t get the point “select items with filtering by Inventory and than get IDs” can you give me the example to fetch the ID

    2. Hi Munesware,
      Please refer to I210 training guide: https://openuni.acumatica.com/courses/integration/i210-contract-based-web-services/

      string searchParameters = “$filter=CustomerOrder eq ‘” + customerOrder + “‘&$filter=OrderType eq ” + orderType + “&$expand=Details”;

      string salesOrderToBeUpdated = rs.Get(“SalesOrder”, searchParameters);
      string salesOrderNbr = JsonConvert.DeserializeObject(salesOrderToBeUpdated)[0][“OrderNbr”].value;
      JObject jSalesOrder = JsonConvert.DeserializeObject>(salesOrderToBeUpdated)[0];
      JArray orderLines = jSalesOrder.Value(“Details”);

      string detailLineId = null;
      foreach (JObject orderLine in orderLines)
      {
      string inventoryId = orderLine.GetValue(“InventoryID”).Value(“value”);
      string warehouseId = orderLine.GetValue(“WarehouseID”).Value
      (“value”);
      if (inventoryId == firstItemInventoryID && warehouseId == firstItemWarehouse)
      {
      detailLineId = orderLine.GetValue(“id”).ToString();
      break;
      }
      }

  28. Hi,
    For a particular Sales Order, I am trying to create a shipment, confirm shipments and process invoices through REST Endpoints. For Processing an Invoice , I am using the following endpoint :

    POST https://www.b2biass.net/acumaticaerp/entity/Default/17.200.001/SalesOrder/PrepareSalesInvoice.

    In this step, the invoice is created in AcumaticaERP but the response is empty with a 202 Accepted status(in Postman). Is there a way to retrieve the newly generated invoice reference number from this request.

    1. Hi Reema,
      When you release invoice you get back the ID. Use this Id to get record back later. Also monitor the status to get confirmation that record is processed.
      Please see example here : https://help.acumatica.com/(W(3))/Help?ScreenId=ShowWiki&pageid=91bf9106-062a-47a8-be1f-b48517a54324

  29. I have created a new form through customization, how can I fetch / push data through rest endpoints for the custom fields?

  30. I have performed these steps:

    1. Created an adhoc SQL query and published it to the Acumatica server as a view.

    2. Created a DAC and Generic Inquiry from that published view. It returns data.

    3. Created a Contract 3 Web Service Endpoint.

    4. Tested the endpoint from Postman. I can get a response for the $adHocSchema GET request. I get a single record response back if I use a PUT and use any parameter. getList() throws an error: “PX.Api.ContractBased.OptimizedExport.CannotOptimizeException”

    The GI returns many records. Postman REST PUT test returns one record. Why? I have added IsKey to all of the foreign fields in the DAC.

  31. I’m trying to retrieve all of the Taxes like this:

    var tax = new Tax { ReturnBehavior = ReturnBehavior.All };
    _client.GetList(tax);

    But I’m getting this error:

    PX.Api.ContractBased.OptimizedExport.CannotOptimizeException: More than one detail properties have been used in the request:
    TaxSchedule
    Zones
    Only one of the detail properties of each entity can be requested at once

    I need the TaxSchedule detail property polulated, I will not be using the Zones property. So how can I request the Tax and TaxSchedule?

  32. Hi Sergey,
    {
    “entity” : [record in JSON format],
    “parameters” : [parameters in JSON format]
    }
    Can you please give an example for passing the entity. I am getting an error like this:
    {
    “message”: “The request is invalid.”,
    “modelState”: {
    “entity”: [
    “Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path ‘entity’, line 2, position 13.”,
    “The Entity field is required.”
    ],
    “parameters”: [
    “Error reading JObject from JsonReader. Current JsonReader item is not an object: Null. Path ‘parameters’, line 119, position 23.”
    ]
    }
    }

    1. Pravallika,
      Could you please post here your request? JSON object is fine. What are you sending to Acumatica?

    1. Hi Leomil. What do you mean under other object? Does it means that you want to get Customer Email using Sales Orders entity?
      If yes, than it is not possible. All fields are linked to particular screens and can be accessed only from there.

  33. Hi Sergey,

    Is there a way to create new rest API endpoint without specify Screen ID?
    We have an extension DAC (xxCompany) of Company. We’d like to insert/update xxCompany through API without creating new or update existing screen.

    Thanks.

    1. Hi Vo,
      Unfortunately no. The reason is that only Graph knows how to properly save the data and graph is 1to1 linked with page. Plus Acumatica gets sequence of data import from screen.
      So currently Graph and Page are mandatory for entities in the endpoint.

  34. Hey Sergey,

    I have 3 tenants in one instance and I am using the rest API. I am trying to figure out how we can pass the tenantid in the login endpoint. /entity/auth/login.
    The call looks to be defaulted to the first tenant that we created .

    1. Demo
    2. Pre-Live
    3. Live

    Any ideas?

    1. Hi Derek,
      Please send there the JSON like this:
      {
      “name” : “admin”,
      “password” : “123”,
      “company” : “MyStore”,
      “branch” : “MYSTORE”
      }

  35. Hello Sergey,

    My confusion is that we have 3 tenants and the same companies exist in all the tenants. Is there some special code I need to reference in the API call to make sure that the correct tenant and company is used.

    1. Hi Derek, I think confusion here comes from naming. Company in this login refers Tenant. This is old naming that we had in the past. So when you choose Company you actually choose tenant. Branch will be the name of company or branch.
      Hope it clarifies.

  36. I want to create REST API but i did not getting webservices for contract based REST API can you help me regarding this?

    1. Hi Sanpro, go to Acumatica, open Web Services Endpoint, select default.
      Than use use button “View Endpoint Service” and then OpenAPI 2.0. This is definition for REST API you can consume in 3rd party product.

    1. Hello Sanpro,

      As an administrator search ‘Web Service Endpoints’ in Acumatica. When you are on the screen select which endpoint you are looking for. As an Example ‘Customer’. In the summary top area, you can select the magnify glass and see all the support versions. Here is an active endpoint /entity/default/18.200.001/customer.

  37. Hello,

    I am looking to create a customer using the REST API and have not been successful. Can someone share the payload or article they are using to create a customer?

    1. I found the problem that was causing my issues with creating a customer, the endpoint is case sensitive. I was submitting to /entity/default/18.200.001/customer where I should be submitting to this /entity/Default/18.200.001/Customer.

  38. I am able to retrieve a custom field in Sales Order using the following request URL:

    https:///entity/Default/17.200.001/SalesOrder?$filter=OrderNbr eq ‘029623’&$custom=CurrentDocument.LoadNbr

    Also, the same Sales Order is part of the Shipment:

    https:///entity/Default/17.200.001/Shipment/022006?$expand=Orders,Details,Packages

    The above request will expand Order as the particular Sales Order as :

    “Orders”: [
    {
    “id”: “cc5bb9b7-b66d-439b-90b1-cb8bfa336c76”,
    “rowNumber”: 1,
    “note”: “”,
    “InventoryDocType”: {
    “value”: “Issue”
    },
    “InventoryRefNbr”: {
    “value”: “057792”
    },
    “InvoiceNbr”: {},
    “InvoiceType”: {},
    “OrderNbr”: {
    “value”: “029623”
    },
    “OrderType”: {
    “value”: “SO”
    },
    “ShipmentNbr”: {
    “value”: “022006”
    },
    “ShipmentType”: {
    “value”: “Shipment”
    },
    “ShippedQty”: {
    “value”: 25
    },
    “ShippedVolume”: {
    “value”: 0
    },
    “ShippedWeight”: {
    “value”: 0
    },
    “custom”: {},
    “files”: []
    }

    Is it possible to retrieve the custom field or all custom fields of Sales Order from the Shipment request such as

    https:///entity/Default/17.200.001/Shipment/022006?$expand=Orders($custom=CurrentDocument.LoadNbr),Details,Packages

    The above request is failing for me though. The requirement is to retrieve all details of Sales Order from GET Shipment endpoint.

  39. Hi Reema,
    You need to specify each custom field one by one how it is shown here: https://help-2018r2.acumatica.com/(W(2))/Help?ScreenId=ShowWiki&pageid=c5e2f36a-0971-4b33-b127-3c3fe14106ff
    Also note that you can retrieve schema of custom field as it show here: https://help-2018r2.acumatica.com/(W(2))/Help?ScreenId=ShowWiki&pageid=c5e2f36a-0971-4b33-b127-3c3fe14106ff

    In your query you should remove brackets “(” and “)” . Other fields should be specified just as a comma “,” separated string:
    ?$expand=Orders,Details,Packages$custom=CurrentDocument.LoadNbr,CurrentDocument.OtherNbr,

  40. I’m trying to create a Customer using the REST API. I’ve extended the default endpoint and added 2 fields that are required but when posting, it created an Address record with a BAccountID -2147483647 and didn’t create the Customer.
    The JSON I’m using:
    {
    “CustomerID”: {
    “value”: “TEST8945129A5”
    },
    “CustomerName”: {
    “value”: “TEST CUSTOMERR”
    },
    “CustomerClass”: {
    “value”: “01”
    },
    “StatementCycleId”: {
    “value”: “01”
    },
    “ShippingAddressSameAsMain”: {
    “value”: true
    },
    “Status”: {
    “value”: true
    },
    “ParentRecord”: {
    “value”: null
    },
    “MainContact”: {
    “DisplayName”: {
    “value”: “TEST CUSTOMERR”
    },
    “Email”: {
    “value”: “a@b.com”
    },
    “Address”: {
    “AddressLine1”: {
    “value”: “Test test test”
    },
    “AddressLine2”: {
    “value”: “Test test test”
    },
    “City”: {
    “value”: “Monterrey”
    },
    “State”: {
    “value”: “NL”
    },
    “PostalCode”: {
    “value”: “00300”
    },
    “Country”: {
    “value”: “MX”
    }
    }
    },
    “BillingContact”: {
    “CashAccount”: {
    “value”: “BANAMEXMN”
    },
    “CardAccountNo”: {
    “value”: “0000000000”
    }
    }
    }

    Using PUT to the URL: my.site/AcumaticaSQL/entity/DefaultCustomer/17.200.001/Customer

Leave a Reply

Please rate*

Your email address will not be published. Required fields are marked *