Skip to main content
Solved

Adding a Vendor with GL Account Data via REST API

  • June 13, 2023
  • 3 replies
  • 225 views

I’m attempting to add a new Vendor via the REST API. I receive the error:

DiscTakenAcctID: 'Cash Discount Account' cannot be empty

This is a required field located under the GL Accounts tab. However, the field does not appear when getting the list of Vendors via the REST API. How should the JSON be structured to include this field when adding a new Vendor via the REST API?

Best answer by jinin

Hi @cjprindle ,

If we define the GL accounts at the Vendor class level, whenever a vendor is created with the vendor class through API, it will be auto-populated.

If you want to pass the values while creating the vendor, follow the steps below.

By default, the Vendor entity does not have the GL account details.

  • First, select the endpoint.
  • Next, select the vendor entity.
  • Click on the insert button to create the GL Accounts sub-entity within the Vendor entity, specifying the required fields.
  • In the API request, provide the necessary details when creating the vendor.


 

 

3 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • Answer
  • June 14, 2023

Hi @cjprindle ,

If we define the GL accounts at the Vendor class level, whenever a vendor is created with the vendor class through API, it will be auto-populated.

If you want to pass the values while creating the vendor, follow the steps below.

By default, the Vendor entity does not have the GL account details.

  • First, select the endpoint.
  • Next, select the vendor entity.
  • Click on the insert button to create the GL Accounts sub-entity within the Vendor entity, specifying the required fields.
  • In the API request, provide the necessary details when creating the vendor.


 

 


abhijit
Varsity I
Forum|alt.badge.img
  • December 29, 2023

How did you add the GLAccounts node under Vendor? 


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • January 2, 2024

Hi @abhijit ,

Shared the steps on this post. Let me know if you have any questions.

Insert Vendor API needs cash discount account and cash discount sub. | Community (acumatica.com)