Create a sales order in SAP S/4HANA via OData API

domain: SAP S/4HANA Cloud OData · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Fetch a CSRF token by sending a GET request to the API_SALES_ORDER_SRV service root with the header 'x-csrf-token: fetch'; capture the token returned in the response header 'x-csrf-token'.
  2. Obtain an OAuth 2.0 bearer token from the BTP service key for the communication scenario that exposes the Sales Order API (SAP_COM_0109 or equivalent).
  3. POST to /sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder with a JSON body containing at minimum: SalesOrderType, SalesOrganization, DistributionChannel, Division, SoldToParty, and a deep-insert 'to_Item' array with each item's Material, RequestedQuantity, and SalesUnit.
  4. Include headers: Authorization Bearer YOUR_TOKEN, x-csrf-token YOUR_CSRF, Content-Type application/json, Accept application/json.
  5. Check the HTTP 201 response body for the created SalesOrder number; handle any error messages surfaced in the 'error.innererror.errordetails' array.

Known gotchas

Related routes

Send an OData $batch request to SAP Gateway to group multiple entity operations in one HTTP call
sap-s4hana · 5 steps · unrated
Configure and test SAP OData v4 service on SAP Gateway with $filter, $expand, and deep insert
sap-s4hana · 5 steps · unrated
Read business partners via SAP S/4HANA Cloud OData API
SAP S/4HANA Cloud OData · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans