Trying to make Coupa cXML orderrequest approve fail

358 Views Asked by At

I'm trying to make Coupa cXML orderrequest approval fail. Setting error code 400/401, but Coupa still thinks the approval was successful, and the requisition changes status to ordered. Any ideas how to make Coupa understand that approval wasn't successful?

2

There are 2 best solutions below

4
Ben Simmons On

So basically you are trying to reject a Purchase Requisition? If so- you need to send it to a different URL--> /api/approvals//reject

0
MrGadget On

The exchange of CXML between Coupa and supplier systems is pretty much hidden from the buyer. When they click Approve, the Order is queued up to be sent, perhaps minutes later, while the buyer sees a visual status change immediately. This means that inline validation and rejection doesn't work. Coupa will treat any status code other than 200 as a non-fatal error and will just keep trying to send the same thing.

The only thing you can really do is return a status code 200 to the order, then separately do your validation, and produce an order confirmation CXML to Coupa with "accept" or "reject" as appropriate, the latter of which will change the status of the order on Coupa side.