Solved

Using REST API to create SO with Payment in one PUT request

  • 26 January 2024
  • 6 replies
  • 108 views

Userlevel 1

I have a service that is creating Acumatica SO’s via REST calls, and now I need to also create Payments to apply to each SO as it comes in. Is it possible to create an SO with a payment in one PUT request for the sake of simplicity and rate limiting issues? I saw some conflicting information in this thread where a user says:

https://stackoverflow.com/questions/57093218/unable-to-create-payment-for-order-using-rest-api

 

But when I tried this, the response from the server is:

 

{'message': 'An error has occurred.', 'exceptionMessage': "'OrigDocAmt' cannot be empty.\nOrigDocAmt: 'OrigDocAmt' cannot be empty.", 'exceptionType': 'PX.Api.ContractBased.OutcomeEntityHasErrorsException', 'stackTrace': '  …
 

Any help is appreciated!

icon

Best answer by dcomerford 26 January 2024, 18:27

View original

6 replies

Userlevel 7
Badge +12

I believe you can do it but never done it but see help file below 

https://help.acumatica.com/(W(324))/Wiki/ShowWiki.aspx?pageid=e7d7b4a4-4609-4a68-ac74-5ab9006d80c5

Userlevel 7
Badge +11

Hi @pmblake ,

I've attached the sample JSON request for creating an order with payment.

Userlevel 1

I believe you can do it but never done it but see help file below 

https://help.acumatica.com/(W(324))/Wiki/ShowWiki.aspx?pageid=e7d7b4a4-4609-4a68-ac74-5ab9006d80c5

This worked, thanks!

Userlevel 1

Hi @pmblake ,

I've attached the sample JSON request for creating an order with payment.

Hi @jinin ,

I’ve been creating sales orders with payments thanks to your sample JSON, but now I’m running into an issue where the Payment’s “Branch” field under Financial->Link to GL is not coming in as the same value as the SO that it’s attached to. Any idea how to control this value via the same POST request? I tried adding a “Branch” to the Payments JSON but it didn’t work.

 

 

Userlevel 7
Badge +11

Hi @pmblake ,

Could you please incorporate the branch header into the request?

Example:
PX-CbApiBranch : NORTHSERVC 

 

 

Userlevel 1

Hi @pmblake ,

Could you please incorporate the branch header into the request?

Example:
PX-CbApiBranch : NORTHSERVC 

 

 

Ah, I was using the “UserBranch” header for some reason. PX-CbApiBranch worked! Thanks again @jinin 

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