REST
REST/OData is the modern way to access SAP over HTTP with JSON, the interface behind Fiori and most cloud and web integrations. In SAP, "REST API" in practice usually means OData services.
Prefer REST/OData for UIs, mobile, and modern web integrations, and whenever you consume S/4HANA cloud APIs.
- SAP’s primary RESTful interface is OData, a standardised REST protocol returning JSON, with rich query options.
- OData supports $filter, $select, $expand, $orderby and paging ($top/$skip), so clients fetch exactly what they need.
- In SAP, "REST API" in practice usually means OData services.
- Watch out: Over-fetching without $filter/$select/$top.
REST and OData in SAP
SAP’s primary RESTful interface is OData, a standardised REST protocol returning JSON, with rich query options. OData services expose SAP business data and operations to Fiori, mobile apps, and external systems. S/4HANA and cloud products publish many OData APIs (on the Business Accelerator Hub), and you can build your own from CDS.
A REST/OData call
GET /sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder?$filter=SoldToParty eq '1000'&$top=20
Authorization: Bearer <token>
Accept: application/jsonQuery options
OData supports $filter, $select, $expand, $orderby and paging ($top/$skip), so clients fetch exactly what they need. This precision keeps integrations efficient, request minimal data rather than pulling everything and filtering client-side.
When to use it
Prefer REST/OData for UIs, mobile, and modern web integrations, and whenever you consume S/4HANA cloud APIs. It is the strategic direction; reserve SOAP and RFC for classic or SAP-to-SAP scenarios.
Common pitfalls
- Over-fetching without $filter/$select/$top.
- Ignoring OData error handling.
- Using RFC/SOAP where OData fits better.