cXML reference

cXML PunchOutSetupResponse: example and element reference

The PunchOutSetupResponse is your synchronous answer to a PunchOutSetupRequest. It does one of two things: hands back a start URL for the shopping session, or tells the procurement system why it cannot have one.

Where it fits

  1. Your setup endpoint receives a PunchOutSetupRequest from the buyer’s procurement system and authenticates it.
  2. In the body of the same HTTP response you return a PunchOutSetupResponse. On success it has Status code="200" and a StartPage URL for a new session.
  3. The procurement system opens the StartPage URL in the buyer’s browser. The URL is the only thing that ties the browser to the session you just created, so make it single-use and short-lived.
  4. On failure you return a Status with the relevant code (400, 401, 500) and no PunchOutSetupResponse element. The procurement system shows the buyer an error.

A successful PunchOutSetupResponse from Nordwind Supplies (cXML 1.2.061).

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.061/cXML.dtd">
<cXML payloadID="1793610901.9a4f3c@punchout.example.com" timestamp="2026-11-02T08:15:01.204Z" xml:lang="en-US">
  <Response>
    <Status code="200" text="OK"/>
    <PunchOutSetupResponse>
      <StartPage>
        <URL>https://punchout.example.com/nordwind-supplies/?session=q7Wm2xT9vLr4KpZs</URL>
      </StartPage>
    </PunchOutSetupResponse>
  </Response>
</cXML>

The elements that matter

NameNeeded?Meaning
cXML/@payloadIDRequiredA new unique ID for your response. Do not reuse the request’s payloadID.
cXML/@timestampRequiredWhen you produced the response, in ISO 8601.
cXML/@xml:langOptionalLanguage of the document, for example en-US.
ResponseRequiredWraps the answer. A response has no Header: the HTTP connection already identifies both parties.
Status/@codeRequired200 on success. Use 400 for a request you parsed but will not accept, 401 for credentials you do not recognise, 500 for a failure on your side.
Status/@textRequiredThe short name of the code, such as OK or Unauthorized.
Status (content)OptionalA human-readable explanation of an error. Buyers’ support teams read this, so make it specific.
PunchOutSetupResponseConditionalPresent on success only.
StartPage/URLConditionalThe URL the buyer’s browser is sent to. Include a session token so you can find the BuyerCookie and return URL later.

Mistakes that get it rejected

Returning the start URL with a non-200 statusThe procurement system decides success from Status/@code. A response with a StartPage but a 4xx or 5xx code is treated as a failure, and a 200 without a StartPage leaves the buyer nowhere to go.
Reusable session URLsIf the StartPage URL works more than once, anyone who sees it in a log or browser history can shop as that buyer. Expire it after first use or after a short window.
Slow responsesThe procurement system waits for this response while the buyer stares at a spinner, and it will time out. Create the session and answer; do any catalogue loading after the browser arrives.
Unescaped ampersands in the URLAn & in the start URL must be written &amp; inside URL, or the whole response is not well-formed XML and is rejected.

Have a PunchOutSetupResponse that a buyer rejected? Paste it into the free cXML and OCI tester; it checks structure in your browser.

PunchOutSetupResponse questions

What HTTP status should the PunchOutSetupResponse use?

Buyer systems read the outcome from the cXML Status element. QuickPunchOut returns HTTP 200 with the real outcome in Status, including for errors, so the procurement system always receives a document it can parse.

Does the response need a Header element?

No. In cXML, Response documents carry no Header; From, To and Sender only appear on Request and Message documents.

Rather not hand-build this?

The free PunchOut shop handles the PunchOutSetupResponse side of the round trip for you: upload your catalogue from Excel, test a cXML or OCI round trip and invite your buyer. Free until your buyer goes live.

Start free Send us the document