This GET API retrieves a complete order document from the LEO Order Aggregator service using the specified documentNumber. The endpoint returns the order header along with its associated line items and related details as a single aggregated response object.
URL Format
https://<Instance>/leo-order-aggregator-api/api/v1/OrderAggregation/v1/GetOrderByDocumentNumber?documentNumber=<encodedDocumentNumber>GET https://api-leoeu.gep.com/leo-order-aggregator-api/api/v1/OrderAggregation/v1/GetOrderByDocumentNumber?documentNumber=<encodedDocumentNumber>
This endpoint uses the GET method and does not require a request body. The documentNumber value must be provided as a URL-encoded query parameter in the request URL.
Example: documentNumber=PO-2026-036249
{
"exception": null,
"data": {
"...": "Aggregated order document containing the order header and associated line items."
},
"hasData": true,
"hasException": false
}
Notes and Behavior
documentNumberis a required query parameter and must be URL-encoded (for example,PO-2026-036249).subtypeAppIdis a required request header with the value1e6cc0ad-5273-4e97-af3c-81f1eed2d112.If the order exists, the API returns:
{ "exception": null, "data": "<aggregated order document>", "hasData": true, "hasException": false }- The service internally resolves the order header using the document number and then aggregates the associated line items and details.
- If an internal error occurs, the API returns an HTTP
500response with theexceptionobject populated, including the error message and stack trace, andhasExceptionset totrue.
Success Scenario Request
curl --location 'https://api-leoeu.gep.com/leo-order-aggregator-api/api/v1/OrderAggregation/v1/GetOrderByDocumentNumber?documentNumber=PO-2026-036249' \
--header 'accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'subtypeAppId: 1e6cc0ad-5273-4e97-af3c-81f1eed2d112'
Success Scenario Response
{
"exception": null,
"data": {
"...": "<aggregated order document>"
},
"hasData": true,
"hasException": false
}
Failure Scenario Response (HTTP 500)
{
"exception": {
"message": "Response status code does not indicate success: 500 (Internal Server Error).",
"stackTrace": "<stack trace details>"
},
"data": null,
"hasData": false,
"hasException": true
}
Request Headers |
|
|
|
|
|---|---|---|---|---|
Property | Required? | Data type | Description | Validations / Exceptions |
accept | No | String | Response media type. Use application/json. |
|
Authorization | Yes | String | Bearer token used for authentication. |
|
subtypeAppId | Yes | GUID (String) | Sub-type application identifier of the Order Aggregator module. Value: 1e6cc0ad-5273-4e97-af3c-81f1eed2d112. | Must be a valid GUID |
Query String Parameters |
|
|
|
|
|---|---|---|---|---|
Property | Required? | Data type | Description | Validations / Exceptions |
documentNumber | Yes | String | Document number of the order to retrieve. Must be URL-encoded. | Must be a valid existing order document number |
GetOrderByDocumentNumber Response |
|
|
|
|
|---|---|---|---|---|
Property | Required? | Data type | Description | Validations / Exceptions |
exception |
| Object | Null on success. Contains message and stackTrace when the call fails. |
|
data |
| Object | The aggregated order document (header fields merged with the line items). Null when no data is found. |
|
hasData |
| Boolean | True when data is present in the response. |
|
hasException |
| Boolean | True when an exception occurred during processing. |
|