Skip to main content
Solved

Sales Quote to Sales Order API

  • 26 June 2024
  • 1 reply
  • 39 views

Is there a way to “Copy To” using the API? 

I have a Sales Quote and want to create a sales order from it using the API. 

Does the sales order has any relation recorded to the sales quote?

I tried to use this below without success

"OrderType": {
"value": "SO"
},
"customerId": {
"value": "ABAKERY"
},
"Details": i
{
"OrderNbr": {
"value": "000238"
},
"OrderType": {
"value": "QT"
}
}
]

 

1 reply

Userlevel 1

Hello @dkasparian ,

If I understand clearly you want to convert or Sales Quote to a Sales Order via HTTP Request.
In the Sales Quote screen, there is an action called “Convert To Order” for this, so we will use this action.

Firstly you need to go and extend the Default Endpoint of Acumatica for that just go to the Web Service Endpoints screen then select the Default Endpoint and click on the Extend Endpoint action as shown below:
 


Type some name for the Endpoint and Version:
 


In the newly created endpoint click on the Insert button and add the Sales Quotes screen to the endpoint as shown below

 


Click on the Sales Quote newly created folder and add key fields for Sales Quote these are OpportunityID and QuoteNbr we will use these later:
 

 

Than click on the Actions folder and Insert a new action called createSalesOrder (that is Convert to Order action in UI)

 

 

When your action is created add OrderType field as paramater so we can choose in which order type we want to create our Sales Order later:

 


Save all changes, so now we can send the HTTP request you need.

To convert your existing Sales Quote to the Sales Order, you need to send a POST request to the action you created earlier. Use this URL and body for your request :

POST {baseUrlOfYourAcumatica}/entity/{NameOfYourEndpoint}/{VersionOfYourEndpoint}/SalesQuote/createSalesOrder

{
"entity":{
"QuoteNbr":{"value":"YOURQUOTENBR"},
"OpportunityID":{"value":"YOUROpportunityID"}
},
"parameters":
{
"OrderType" : {"value":"SO"}
}
}


After that just go and check your Sales Quote and you can find the related Sales Order in the Relations tab, also the status of the Sales Quote should be Converted after that.

NOTE: The request will work only if the Convert To Order button is Enabled on the Sales Quote screen.

Reply