0

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?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
mindore
  • 69
  • 4

2 Answers2

0

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

Ben Simmons
  • 329
  • 1
  • 6
  • 17
  • I want the user to approve the requisition in coupa. And if the requisition isnt ok to approve on the site i want to tell coupa that it shouldnt change status to approved order. As it is right now the user approves the requisition, I make check on the site if its ok to approve, if its not I will not update the status on the site, so I output the xml-response in original question but coupa ignores it and updates the requisition to an approved order. This is a bit weird as the user chooses when the delivery should be done and then they could approve the order after the delivery time has passed. – mindore Oct 02 '15 at 05:26
  • Just a quick clarifying question- are you the supplier or the customer with the Coupa instance? – Ben Simmons Oct 04 '15 at 01:19
  • I am the supplier. The customer uses coupa to make cxml punchout orders on my website. Everything works fine except the approve part where I need to check if everything is ok. – mindore Oct 04 '15 at 05:49
  • Okay- so you want to take the cXML PO and compare it to your internal system in order to ensure that they placed the PO with all of the right information- right? – Ben Simmons Oct 05 '15 at 02:29
0

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.

MrGadget
  • 1,258
  • 1
  • 10
  • 19