This POST API can be used by GEP to update (persist) a Goods Receipt (GR) document in LEO. It is the lower-level write endpoint that backs Save / channel-event flows. Unlike SaveDocument, this endpoint does NOT perform DAC validation or override the database status; it persists exactly what is sent.
URL Format: https://<Instance>/leo-gr-domaingateway-api/api/v1/Update
Notes / Behavior:
- Accepts the full GR document (header + lines) - same payload shape as SaveDocument.
- No DAC (Data Access Control) check; intended for trusted server-to-server / BPMN callers.
- Status fields are NOT overwritten - whatever status / statusId is in the payload is what gets stored.
- Returns the persisted document inside returnValue (wrapped in GepReturn).
POST https://api-leogreenqc.gep.com/leo-gr-domaingateway-api/api/v1/Update
Sample Request Body:
{
"_id": "0495fd0b-cb33-4eed-a006-ca9c6a884a82",
"documentId": "0495fd0b-cb33-4eed-a006-ca9c6a884a82",
"grHeaderId": "0495fd0b-cb33-4eed-a006-ca9c6a884a82",
"rootId": "0495fd0b-cb33-4eed-a006-ca9c6a884a82",
"grNumber": "GR-2026.008835",
"documentName": "AutomReceipt202606202248iA0",
"documentNo": "",
"status": "Draft",
"statusId": 1,
"subTypeAppId": "39dd1c6a-2edc-40c7-b0d4-2e50755eb941",
"subType": 1,
"grType": 1,
"grTypeDetails": { "code": 1, "name": "Receipt" },
"orderNumber": "PO-2026-036249",
"orderRootId": "be32debe-c7bd-b2bf-31fd-960137a79b85",
"orderSubTypeAppId": "1e6cc0ad-5273-4e97-af3c-81f1eed2d112",
"orderType": "IndirectOrder",
"referenceDocumentNumber": "PO-2026-036249",
"source": "Order",
"purchaseType": "Standard",
"supplierCode": "PC-2024.004228",
"documentDate": "2026-06-20T22:48:19Z",
"postingDate": "2026-06-20T22:48:19Z",
"createdBy": "P2PAutomation Buyer",
"createdOn": "2026-06-20T22:48:19Z",
"updatedBy": "P2PAutomation Buyer",
"updatedOn": "2026-06-20T22:48:47Z",
"currency": { "isActive": true, "code": "USD", "name": "US Dollar" },
"dataSourceSystem": { "sourceSystemName": "Portal", "sourceSystemCode": 1 },
"supplier": { "...": "supplier object" },
"orderContact": { "...": "contact object" },
"orderAuthor": { "...": "contact object" },
"businessUnit": [ { "entityCode": "BU5", "entityName": "Business Unit 5" } ],
"shipToAddress": { "...": "address object" },
"orderDetails": [ { "orderNumber": "PO-2026-036249" } ],
"linkedDocuments": { "...": "linked PO references" },
"totalAcceptedQuantity": 80,
"totalOrderedQuantity": 80,
"totalReceivedQuantity": 80,
"totalReturnedQuantity": 0,
"auditFields": { "...": "audit fields" },
"grLine": [
{
"_id": "29a58111-a80e-4617-a48b-4eeb8933c9e6",
"grLineId": "29a58111-a80e-4617-a48b-4eeb8933c9e6",
"grLineNumber": "1",
"poNumber": "PO-2026-036249",
"poLineNumber": "1",
"orderedQuantity": 20,
"receivedQuantity": 20,
"deliveredQty": 20,
"lineType": "Material",
"category": "AIRFARE",
"customerItemDescription": "Laptop",
"itemName": "Laptop",
"itemUOM": "EA",
"unitPrice": 10,
"priceBasis": "Quantity Based",
"status": "Draft"
}
]
}
{
"isSuccess": true,
"errorMessage": null,
"errorCode": null,
"returnValue": {
"...": "updated GR document"
},
"hasData": true,
"hasException": false,
"exception": null
}
Success Scenario - Request
curl 'https://api-leogreenqc.gep.com/leo-gr-domaingateway-api/api/v1/Update' \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-H 'authorization: Bearer <token>' \
-H 'ocp-apim-subscription-key: <subscription-key>' \
-H 'subtypeappid: 39dd1c6a-2edc-40c7-b0d4-2e50755eb941' \
-H 'x-gep-transaction-scope-id: 5bdd1aa0-2f0d-48de-8776-c5360ba77e64' \
--data-raw '<full GR document JSON - same as SaveDocument>'
Success Scenario - Response
{
"isSuccess": true,
"errorMessage": null,
"errorCode": null,
"returnValue": {
"documentId": "0495fd0b-cb33-4eed-a006-ca9c6a884a82",
"grNumber": "GR-2026.008835",
"status": "Draft",
"version": "0000",
"...": "rest of the persisted GR document"
},
"hasData": true,
"hasException": false,
"exception": null
}
Failure Scenario - Response
{
"isSuccess": false,
"errorMessage": null,
"errorCode": null,
"returnValue": null,
"hasData": false,
"hasException": true,
"exception": {
"Message": "Object reference not set to an instance of an object."
}
}
| 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. | |
| authorization | Yes | String | Bearer token used for authentication. | |
| ocp-apim-subscription-key | Yes | String | APIM subscription key issued to the consumer. | |
| subtypeappid | Yes | GUID (String) | Sub-type application identifier of the Goods Receipt module. | |
| event | String | Event name (optional for direct Update). Channel flows use 'leo-gr-save'. | ||
| x-gep-transaction-scope-id | Yes | GUID (String) | Unique transaction/correlation id sent by the source system. |
Request Body (Header) and GRLine: same fields as SaveDocument API. The only behavioral differences from SaveDocument are documented in the Overview / Notes above (no DAC, no status override).
| Property | Required? | Data type | Description | Validations / Exceptions |
|---|---|---|---|---|
| Update Response (GepReturn) | ||||
| isSuccess | Boolean | True if the update succeeded, false otherwise. | ||
| errorMessage | String | Error message text when isSuccess is false. | ||
| errorCode | JToken / String | Error code (or structured token) when applicable. | ||
| returnValue | Object | Persisted GR document as returned by the service. May be null on failure. | ||
| hasData | Boolean | Convenience flag: returnValue != null. | ||
| hasException | Boolean | Convenience flag: true if exception captured. | ||
| exception | Object | Exception details on server-side failure. |