2

I have a question about Ariba punchoutSetupRequest.

My API response is like this:

<?xml version="1.0" encoding="UTF-8"?>
<cXML payloadID="1454654070603.1234567890@ctoms1234" timeStamp="2016-02-05T15:34:30-15:00">
    <Response>
        <Status code="400" text="Failed"/>
        <PunchOutSetupResponse>
            <StartPage>
                <URL>http://ARIBA-TEST.ty.chugai-pharm.co.jp/Buyer/punchout?client=HTML.8gnyW0CvGJ1R!-34269844!1454653851331&amp;responseid=5&amp;locale=ja_JP</URL>
            </StartPage>
        </PunchOutSetupResponse>
    </Response>
</cXML>

However, Ariba calls my API and response like this to me.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.034/cXML.dtd">
<cXML payloadID="1501225074983-2497119422372518906@216.109.111.6" timestamp="2017-07-27T23:57:54-07:00">
    <Response>
        <Status code="500" text="Internal Server Error">Error:Punchout error from supplier:Response:
            <!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">
            <cXML payloadID="958074700772@www.workchairs.com" timestamp="2005-06-14T12:59:09-07:00">
                <Response>
                    <Status code="400" text="Bad request"/>
                    <PunchOutSetupResponse>
                        <StartPage>
                             <URL>https://punchout.workchairs.com/Servlet/sessionid=7006</URL>
                        </StartPage>
                    </PunchOutSetupResponse>
                </Response>
            </cXML>
            Please contact support with the Error Reference Number: ANERR-10000000000000000381125876 for more details
        </Status>
    </Response>
</cXML>

Anyone can help me to fix it? Not sure about my response for setupRequest API.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Hoang Do
  • 45
  • 5

2 Answers2

0

so just to be clear, you're setting up the supplier side of the transaction ?

why do you reply with a 400 code, 400 will mean there is an error and the PunchOutSetupRequest transaction is not correct, its unlikely you want to send the StartPage (entry for your punch out catalog) if the request is not valid, your API should serve

<?xml version="1.0" encoding="UTF-8"?>
<cXML payloadID="1454654070603.1234567890@ctoms1234" timeStamp="2016-02-05T15:34:30-15:00">
    <Response>
        <Status code="200" text="success"/>
        <PunchOutSetupResponse>
            <StartPage>
                <URL>http://ARIBA-TEST.ty.chugai-pharm.co.jp/Buyer/punchout?client=HTML.8gnyW0CvGJ1R!-34269844!1454653851331&amp;responseid=5&amp;locale=ja_JP</URL>
            </StartPage>
        </PunchOutSetupResponse>
    </Response>
</cXML>
Frederic Henri
  • 51,761
  • 10
  • 113
  • 139
  • I return status code 400 because of the setup request data not valid to my database required. However i get 2 status code in my response. What should i do to improve this? – Hoang Do Jul 29 '17 at 12:40
  • even if request is not valid i still need to response the status code 200 and message text Success right? – Hoang Do Jul 31 '17 at 01:17
  • Thks for helping me! I just fix that status code to 200 then is okie! – Hoang Do Jul 31 '17 at 01:34
  • yep you need to differentiate HTTP error and cXML error, see https://stackoverflow.com/a/43684107/4296747 – Frederic Henri Jul 31 '17 at 06:38
0

In Ariba cXML a 400 code has specific meaning such as if one were to have sent a duplicate to an already processed request. For example submit an invoice with an operation = "new" and then attempt to issue a creditmemo for the same invoice number, without operation = "update" value in the header. The other typical 400 code causes are missing payload id, missing timestamp, missing "code required by the particular transaction" missing, etc.