Skip to main content

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 @pdeatherage,

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,

Good Luck,


@Vignesh Ponnusamy Thank you for the info. I have another scenario. If, instead of putting the order on hold, is it possible to mark it as Risk Hold? We have orders that fail the AVS check, so we need to review the payment. I’m trying to figure out a way to mark those as Risk Hold. Does that need to be done as an update to the order - or is there same way to set the payment status? Essentially, I’m wanting to be able to set orders as Pending Approval, Awaiting Payment, Risk Hold, or Open.


@pdeatherage, From your previous comment, I assume you wanted to create/use custom status Risk Hold. So following are a few pointer that should help you get started with,

  • 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,

Please feel free to post if you have any questions.

Good Luck,


Reply