From my understanding, an order status cannot be set when creating a sales order via the API? Would this have to be done by updating the order? We are importing orders from a shopping cart, and so we need to be able to set the sales order status according to the order status. For example, if it has a payment, but that has been flagged by our processor, I need to have those orders set to Hold in Acumatica (they are set to Open by default since they have a payment attached). If it can’t be set at the time of SO creation, how would it be updated via the API?
Hi
Yes, initially the Sales Order status is set to Open when we created it. If you wish to set to On Hold(based on some business requirement or condition), you can use the Hold action. You can invoke the Action using the POST method. I see Default endpoint doesn’t have the Sales Order PutOnHold action mapped.
In this case, you can extend the latest Default endpoint version and add the action to it. Below are the screenshot of the mapping for your reference,
Now you can use the post method like below to invoke the action from API.
Method: Post
URL: <<Instance URL>>/entity/DefaultExt/22.200.001/SalesOrder/PutOnHold
Request Payload:
{
"entity": {
"OrderType": {
"value": "SO"
},
"OrderNbr": {
"value": "SO006773"
}
}
}
For more details on extending the endpoint and invoking a action from endpoint, refer the following documentations,
- https://help.acumatica.com/(W(2))/Help?ScreenId=ShowWiki&pageid=c450492e-06fe-4563-95c3-efa76975415b
- https://help.acumatica.com/(W(2))/Help?ScreenId=ShowWiki&pageid=91bf9106-062a-47a8-be1f-b48517a54324
Good Luck,
- Sales Order screen screen has workflow to it. The document status and transitions are defined and controlled by the workflow. You can extend the existing workflow, modify as per the requirements
- Firstly, you can customize the status field and the workflow to meet your business requirements. (Note: Workflows use use actions to set the status of the document)
- Once customize the screen, you can use APIs to invoke the action and set the status as necessary
Below are a few documents and courses you can refer to,
- https://help.acumatica.com/(W(15))/Help?ScreenId=ShowWiki&pageid=7002fb50-3aff-4819-b995-ef2d18f13272
- https://help.acumatica.com/(W(9))/Help?ScreenId=ShowWiki&pageid=8ce8c907-9854-4bbd-b8f2-557703b9812f
- https://openuni.acumatica.com/courses/reporting/w150-workflows/
Please feel free to post if you have any questions.
Good Luck,
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.