Solved

How to extend a Business Account to Vendor using an API request ?


Hi All,

We want to extend a Business Account to a Vendor using an Acumatica Webservice endpoint. In the past we were successful in making a POST request to extend Business Account to a Customer using ‘ConvertBusinessAccountToCustomer’. We were hoping if there is something like that event for extending to Vendor as well. 

Any leads on how to accomplish this would be greatly appreciated.

 

Best Regards,
Amruta

icon

Best answer by jinin 5 January 2022, 18:44

View original

11 replies

I was able to add “ExtendToVendor@Action” to ‘businessaccount’ module of the endpoint. But there are couple of required fields on the Vendor screen which needs to be filled out in order to complete extension to Vendor. Since the ‘Action’ is added to ‘businessaccount’ module, I’m unable to add the required fields of Vendor screen to the parameters. 

Any thoughts on how to accomplish the “ConvertBusinessAccountToVendor” given the circumstances?
All the help is greatly appreciated.

Best Regards,
Amruta

Userlevel 2
Badge

I’m working on using the ConvertBusinessAccountToCustomer api.  Once I’ve figured that out then I might be able to help with the vendor.  For the conversion to a customer what parameters did you use or did you pass in the business account id in the body?

Userlevel 7
Badge +11

Hi @vpoulson 

I’ve tried to use the Extend to vendor and Extend to Customer. Both giving same error “ The Extend to Customer button is disabled /The Extend to Vendor button is disabled 

I’ve used the BusinessAccountId as a parameter.
And also set the Default Vendor Class/ Default Customer class in the preference screen. So able to save the records in screen without any other details. Assume same should work with API as well.

I tried like below. 

 

Let me know if you find a way to achieve this.

Userlevel 2
Badge

here is the body I used for the ConvertBusinessAccountToCustomer:

{

    "entity":{

        "Type":{"value":"BAccount"},

        "BusinessAccountID":{"value":"BA00000029"}

    }

}

If had already set the Business Account to a Customer and then deleted the customer I would still get the button disabled error.  Hope this help.

Userlevel 7
Badge +11

Thanks @vpoulson . Worked now 

Userlevel 7
Badge +11

 
@Amruta  @vpoulson  I’ve tried below steps to extend the Vendor details.

      1.  Extend the default endpoint

  1. Select the Business Account Entity
  2. Select the action under Business Account Entity 
  3. Next click the Insert button and insert the Extend to Vendor Action
  4. Save 
     

    6. Try the below request

  Url : /entity/TEST/20.200.001/BusinessAccount/ExtendToVendorAction

Request JSON : 

{

    "entity":{ 

        "Type":{"value":"BAccount"},

        "BusinessAccountID":{"value":"BACCOUNT04"}

    }

}
 


Hope this help you.

Userlevel 2
Badge

For some reason I don’t have the ExtendToVendor@Action for the mapped actions option in my system.

I’m on 21R2.212.v.1.0.14 and I’m not sure what could be different.  I’ve tried the ExtendToVendor@RecordCreation and just the ExtendToVendor mapping but neither of those work.

 

Any ideas on why I don’t have that action?

Userlevel 2
Badge

In looking more closely at the options it seems that I would need to use the @RecordCreation option.  

When I try that in Postman I get a 422 Unprocessable Entity error.  When I run the Extend as Vendor in the tenant I need to set the Vendor Class before I can save the new vendor.  I’m not sure how to set the vendor class in the api call.  Any ideas on how to do that?

Userlevel 7
Badge +11

Hi @vpoulson  

I will review  and update my findings.

Userlevel 7
Badge +11

Hi @vpoulson 

Before I tested 20R2 instance and now checked the same on the 21R2 instance. 

yes, the entity name changed on the 21R2 instance from ExtendToVendorAction to ExtendToVendor.

And also the request needs to change like below. 

{

    "entity": {

        "BusinessAccountID": {    "value": "BACCOUNT02"   },

        "Name": {   "value": "BusinessAccount02"    },

        "VendorID": {    "value": "BACCOUNT02"   },

         "VendorClass": {     "value": "INTERCO"

        }       

    }

}

But Vendor class is not accepting from Request. So I’ve configured on the Account preference screen.
 

 

Userlevel 2
Badge

@jinin thanks so much.  I’ll give that a try and see how it goes.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved