This POST API can be used to create a Goods Receipt (GR) in LEO by GEP from the source/ERP system. The API accepts the GR header information along with one or more GR line items being received against an existing Purchase Order.
URL Format: https://<Instance>/leo-gr-domaingateway-api/api/v1/Process
POST https://api-leoqc.gep.com/leo-gr-domaingateway-api/api/v1/Process
Sample Request Body:
{
"sourceSystemGRNumber": "SS-GR-0503",
"grNumber": "SS-GR-0503",
"documentDate": "2025-02-20",
"postingDate": "2025-02-20",
"operationName": "Create",
"subTypeCode": "OI",
"grLine": [
{
"poNumber": "Auto216171",
"poLineNumber": "1",
"grLineNumber": "1",
"receivedQuantity": 1,
"deliveredQty": 1,
"receivedDate": "2025-02-20"
}
]
}
{
"data": {
"grNumber": "SS-GR-0503",
"sourceSystemGRNumber": "SS-GR-0503",
"status": "Created",
"transactionId": "7c8186dc-c7f4-41cf-a3c6-934b662c84ab"
},
"statusCode": "200",
"errorDetails": [],
"successDetails": [ { "key": "SS-GR-0503" } ]
}
Success Scenario - Request
curl --location 'https://api-leoqc.gep.com/leo-gr-domaingateway-api/api/v1/Process' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'subtypeappid: 39dd1c6a-2edc-40c7-b0d4-2e50755eb941' \
--header 'event: leo-gr-interface-createGR' \
--header 'Authorization: Bearer <token>' \
--header 'ocp-apim-subscription-key: <subscription-key>' \
--header 'x-gep-transaction-scope-id: 7c8186dc-c7f4-41cf-a3c6-934b662c84ab' \
--data '{
"sourceSystemGRNumber": "SS-GR-0503",
"grNumber": "SS-GR-0503",
"documentDate": "2025-02-20",
"postingDate": "2025-02-20",
"operationName": "Create",
"subTypeCode": "OI",
"grLine": [
{
"poNumber": "Auto216171",
"poLineNumber": "1",
"grLineNumber": "1",
"receivedQuantity": 1,
"deliveredQty": 1,
"receivedDate": "2025-02-20"
}
]
}'Success Scenario - Response
{
"data": {
"grNumber": "SS-GR-0503",
"sourceSystemGRNumber": "SS-GR-0503",
"status": "Created",
"transactionId": "7c8186dc-c7f4-41cf-a3c6-934b662c84ab"
},
"statusCode": "200",
"errorDetails": [],
"successDetails": [ { "key": "SS-GR-0503" } ]
}
Failure Scenario - Response
{
"data": null,
"statusCode": "400",
"errorDetails": [
{
"key": "poNumber",
"errors": [
{
"errorCode": "GR_PO_NOT_FOUND",
"errorDescription": "Purchase Order 'Auto216171' was not found or is not open."
}
]
}
],
"successDetails": []
}
Property | Required? | Data type | Description | Validations / Exceptions |
|---|---|---|---|---|
Request Headers |
|
|
|
|
accept | Yes | String | Response media type. Use application/json. |
|
Content-Type | Yes | String | Payload media type. Use application/json. |
|
subtypeappid | Yes | GUID (String) | Sub-type application identifier issued for the client/tenant. |
|
event | Yes | String | Event name routing the request. Use leo-gr-interface-createGR. |
|
Authorization | Yes | String | Bearer token used for authentication. |
|
ocp-apim-subscription-key | Yes | String | APIM subscription key issued to the consumer. |
|
x-gep-transaction-scope-id | Yes | GUID (String) | Unique transaction/correlation id sent by the source system. |
|
Property | Required? | Data type | Description | Validations / Exceptions |
|---|---|---|---|---|
CreateGR Request Body |
|
|
|
|
sourceSystemGRNumber | Yes | String (100) | Goods Receipt number from the source system. Used as the external reference. | Must be unique per source system |
grNumber | Yes | String (100) | Goods Receipt number to be created in LEO. Generally same as sourceSystemGRNumber. |
|
documentDate | Yes | Date (yyyy-MM-dd) | Document date of the Goods Receipt. | Valid ISO date |
postingDate | Yes | Date (yyyy-MM-dd) | Posting date of the Goods Receipt in the ERP. | Valid ISO date |
operationName | Yes | String | Operation to be performed. For this API the value must be 'Create'. | Allowed values: Create |
subTypeCode | Yes | String | Sub-type code of the GR (e.g., OI for Order Item based GR). | Allowed values per client config |
grLine | Yes | List of GRLine object | Array of Goods Receipt line items being received. Check Data Type GRLine for details. | At least one line is required |
Property | Required? | Data type | Description | Validations / Exceptions |
|---|---|---|---|---|
GRLine |
|
|
|
|
poNumber | Yes | String (100) | Purchase Order number against which the goods are being received. | PO must exist and be open |
poLineNumber | Yes | String | Line number on the referenced Purchase Order. | PO line must exist |
grLineNumber | Yes | String | Line number of the Goods Receipt line being created. |
|
receivedQuantity | Yes | Decimal | Quantity received against the PO line. | Must be > 0 and <= open quantity |
deliveredQty | Yes | Decimal | Delivered quantity for the PO line. | Must be >= 0 |
receivedDate | Yes | Date (yyyy-MM-dd) | Date on which the goods were physically received. | Valid ISO date |
Property | Required? | Data type | Description | Validations / Exceptions |
|---|---|---|---|---|
CreateGR Response |
|
|
|
|
data |
| Object | GR object containing details of the created Goods Receipt. |
|
statusCode |
| String | HTTP-style status code of the call (e.g., 200, 400). |
|
errorDetails |
| List of ErrorModel object | Array of error details when the call fails. |
|
successDetails |
| List of SuccessModel object | Array of success details when the call succeeds. |
|
Property | Required? | Data type | Description | Validations / Exceptions |
|---|---|---|---|---|
ErrorDetails |
|
|
|
|
key |
| String | Key for which the error occurred (e.g., grNumber, poNumber). |
|
errors |
| List of Error object | Array of errors raised for this key. |
|
Property | Required? | Data type | Description | Validations / Exceptions |
|---|---|---|---|---|
Errors |
|
|
|
|
errorCode |
| String | Error code identifying the validation/processing failure. |
|
errorDescription |
| String | Human readable description of the error. |
|
Property | Required? | Data type | Description | Validations / Exceptions |
|---|---|---|---|---|
SuccessDetails |
|
|
|
|
key |
| String | Key (sourceSystemGRNumber / grNumber) of the successfully created GR. |
|