Skip to main content
Answer

How to return JSON response instead of 204 No Content from a custom screen API Action?

  • October 28, 2025
  • 1 reply
  • 36 views

Hi everyone,

I'm building a custom API screen in Acumatica with a virtual DAC (PXVirtual) to trigger an authorization process.


 


My screen has:


public PXFilter<VXAuthorizeExistingRequest> MasterView;
public PXSelectReadonly<VXAuthorizeResponse> DetailsView;
public PXAction<VXAuthorizeExistingRequest> RunAuthorize;

 



The RunAuthorize action calls a helper class to execute some logic, then inserts a result record into DetailsView (a virtual table VXAuthorizeResponse), like this:



DetailsView.Cache.Clear();
DetailsView.Cache.Insert(new VXAuthorizeResponse
{
    Success = res.Success,
    Message = res.Message,
    PaymentDocType = res.PaymentDocType,
    PaymentRefNbr = res.PaymentRefNbr,
    LastTranType = res.LastTranType,
    LastTranStatus = res.LastTranStatus,
    ProcessorTranNumber = res.ProcessorTranNumber
});
DetailsView.Cache.IsDirty = false;
MasterView.Cache.IsDirty = false;



When I call the API endpoint like this:


POST /entity/AuthorizeAPI/22.200.002/vxcreateauthorizeapi/runAuthorize
 


Acumatica always returns 204 No Content, even though I’ve inserted a record into the read-only view.
I’d like the API to return JSON data immediately — e.g., the VXAuthorizeResponse fields — instead of 204.
 


Question:

Is there any supported way (or workaround) to make a custom screen action return a JSON response directly in REST (not 204)?

Thanks in advance for any insights!

Best answer by Tony Lanzer

@PhatPham, I believe an endpoint action will always return a 204. However, a regular entity endpoint will return JSON in the response when you send a PUT for an insert/update. This might not meet your needs, though.  If not, you could add a GET request after your action POST to read the data of course.

1 reply

Tony Lanzer
Pro III
Forum|alt.badge.img+2
  • Pro III
  • Answer
  • October 30, 2025

@PhatPham, I believe an endpoint action will always return a 204. However, a regular entity endpoint will return JSON in the response when you send a PUT for an insert/update. This might not meet your needs, though.  If not, you could add a GET request after your action POST to read the data of course.