cXML PunchOutSetupRequest: example and element reference
The PunchOutSetupRequest is the first document in every cXML PunchOut session. The buyer’s procurement system sends it to your setup URL to say who is shopping, how to authenticate them, and where to send the cart back.
Where it fits
- A buyer clicks your catalogue inside SAP Ariba, Coupa, Oracle, JAGGAER or another cXML procurement system. The procurement system’s server — not the buyer’s browser — sends an HTTP POST of the PunchOutSetupRequest to your setup URL, normally with
Content-Type: text/xml. - Your endpoint checks the
SharedSecretin theSendercredential, identifies the buying organisation from theFromcredential, and stores theBuyerCookieand theBrowserFormPostURL against a new shopping session. - In the same HTTP response you return a PunchOutSetupResponse carrying a one-time
StartPageURL. The procurement system opens that URL in the buyer’s browser. - When the buyer finishes shopping, your site posts a PunchOutOrderMessage through the browser to the
BrowserFormPostURL, carrying the sameBuyerCookieso the procurement system can match the cart to the session.
A PunchOutSetupRequest from Example Buyer GmbH’s procurement system to 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="1793610900.4821@buyer.example" timestamp="2026-11-02T09:15:00+01:00" xml:lang="en-US">
<Header>
<From>
<Credential domain="NetworkID">
<Identity>AN00000000001</Identity>
</Credential>
</From>
<To>
<Credential domain="DUNS">
<Identity>000000000</Identity>
</Credential>
</To>
<Sender>
<Credential domain="NetworkID">
<Identity>AN00000000001</Identity>
<SharedSecret>change-me</SharedSecret>
</Credential>
<UserAgent>Example Procurement 1.0</UserAgent>
</Sender>
</Header>
<Request deploymentMode="test">
<PunchOutSetupRequest operation="create">
<BuyerCookie>8f3c2a91-session-4471</BuyerCookie>
<Extrinsic name="UserEmail">jana.weber@buyer.example</Extrinsic>
<Extrinsic name="UniqueName">jweber</Extrinsic>
<BrowserFormPost>
<URL>https://procurement.buyer.example/punchout/return?session=4471&lang=de</URL>
</BrowserFormPost>
<Contact role="endUser">
<Name xml:lang="en">Jana Weber</Name>
<Email>jana.weber@buyer.example</Email>
</Contact>
<ShipTo>
<Address addressID="HAM-01">
<Name xml:lang="en">Example Buyer GmbH, Hamburg site</Name>
<PostalAddress>
<Street>Musterstrasse 1</Street>
<City>Hamburg</City>
<PostalCode>20095</PostalCode>
<Country isoCountryCode="DE">Germany</Country>
</PostalAddress>
</Address>
</ShipTo>
</PunchOutSetupRequest>
</Request>
</cXML> The elements that matter
| Name | Needed? | Meaning |
|---|---|---|
cXML/@payloadID | Required | Unique ID for this document. The usual form is a timestamp, a random part and the sender’s host name, joined as time.random@host. |
cXML/@timestamp | Required | When the document was created, in ISO 8601 with a time-zone offset. |
Header/From/Credential | Required | The buying organisation. The domain attribute says what kind of identifier Identity holds: NetworkID (an Ariba Network ID), DUNS, or a value agreed between the parties. |
Header/To/Credential | Required | You, the supplier, as the buyer has you configured. |
Header/Sender/Credential | Required | The system that physically sent the request. For a direct connection this is the buyer; through a network it is the network. |
Sender/Credential/SharedSecret | Conditional | The password you check. Present when the relationship uses shared-secret authentication, which is the common case. It sits in Sender, not From. |
Sender/UserAgent | Required | Free-text name of the sending software. Useful in logs; not used for authentication. |
Request/@deploymentMode | Optional | test or production. A missing attribute means production. |
PunchOutSetupRequest/@operation | Required | create starts a new cart, edit reopens a returned cart for changes, inspect reopens it read-only. The DTD also defines source, used for sourcing events. |
BuyerCookie | Required | Opaque session token from the procurement system. Store it and return it unchanged in the PunchOutOrderMessage. |
Extrinsic | Optional | Named extra values such as UserEmail or UniqueName. Names and presence vary by platform and by buyer configuration. |
BrowserFormPost/URL | Required | Where the cart goes back. The DTD marks it optional, but without it there is nowhere to return the cart, so treat it as required and use the value from each request rather than a configured one. |
Contact | Optional | The person shopping, with Name and Email. The role attribute is often endUser. |
ShipTo/Address | Optional | Delivery address the buyer has selected, sometimes used to show stock or delivery options per site. |
SelectedItem | Optional | Asks you to open the session on a specific product or section rather than your home page. |
ItemOut | Conditional | Sent with edit and inspect: the lines from the earlier cart, identified by SupplierPartID and any SupplierPartAuxiliaryID you returned. |
Mistakes that get it rejected
SharedSecret is inside Sender. When a request comes through a network, From and Sender carry different identities, and code that reads From fails authentication on every call. Return status 401 when the secret does not match, not a generic error.BuyerCookie means the procurement system cannot match the returned cart to the open session. It is opaque: store the exact string and send it back.BrowserFormPost arrive XML-escaped (&). An XML parser turns that into a plain &; decoding it again, or posting to a URL you stored in configuration instead of the one in this request, sends the cart to the wrong place.Status element of the PunchOutSetupResponse. An HTML error page or an empty 500 shows the buyer a generic failure with nothing to diagnose. Answer in cXML even when the request is bad.Have a PunchOutSetupRequest that a buyer rejected? Paste it into the free cXML and OCI tester; it checks structure in your browser.
PunchOutSetupRequest questions
What content type does a PunchOutSetupRequest use?
It is normally posted as text/xml. Some systems post the document as a form field instead, so a tolerant endpoint accepts the raw body and, for application/x-www-form-urlencoded requests, the cxml-urlencoded field.
Do I have to validate the request against the DTD?
No. Most suppliers parse the document without fetching the DTD and check the fields they use. Do not let your parser resolve external entities or a DOCTYPE internal subset from an incoming request.
What is the difference between From and Sender?
From is the organisation the request is on behalf of. Sender is the system that transmitted it and carries the shared secret. On a direct connection they are often the same; through a network such as SAP Business Network they differ.
Rather not hand-build this?
The free PunchOut shop handles the PunchOutSetupRequest 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