Lattice - Endpoint Payload Specification
Request-payload specification for every operation of the Lattice custom services in Dynamics 365 Finance and Operations, taken from the service classes and their data contracts. Sample values are USMF demo data.
Field names below match the
[DataMember('...')]strings exactly (PascalCase). Sample values target the USMF legal entity.
0. Global conventions
URL pattern
POST {{baseUrl}}/api/services/{ServiceGroup}/{ServiceName}/{operationName}
- Single op body envelope:
{ "_request": { ... } } - Batch op (
...Batch, X++(List _requests)) body envelope:{ "_requests": [ { ... }, { ... } ] }- Each element of
_requestsis the same contract as the corresponding single op (e.g.confirmSalesOrderBatchtakes a list ofMGCLatticeSalesOrderConfirmRequestContract).
- Each element of
- The request's
LegalEntityIddecides the company: every operation runs insidechangecompany(LegalEntityId), so the calling user's default company does not matter.
Service group → service map (from the AxServiceGroup metadata)
| Service | Service group |
|---|---|
| MGCLatticeSalesOrderPostingService | MGCLatticeAccountsReceivableServiceGroup |
| MGCLatticeSalesOrderCaptureService | MGCLatticeAccountsReceivableServiceGroup |
| MGCLatticeFreeTextInvoiceService | MGCLatticeAccountsReceivableServiceGroup |
| MGCLatticeSalesReturnService | MGCLatticeAccountsReceivableServiceGroup |
| MGCLatticePriceInquiryService | MGCLatticeAccountsReceivableServiceGroup |
| MGCLatticeSalesTradeAgreementService | MGCLatticeAccountsReceivableServiceGroup |
| MGCLatticePurchaseOrderPostingService | MGCLatticeAccountsPayableServiceGroup |
| MGCLatticePurchaseReturnService | MGCLatticeAccountsPayableServiceGroup |
| MGCLatticeVendorInvoiceJournalService | MGCLatticeAccountsPayableServiceGroup |
| MGCLatticeVendorInvoiceService | MGCLatticeAccountsPayableServiceGroup |
| MGCLatticeVendorPaymentProposalService | MGCLatticeAccountsPayableServiceGroup |
| MGCLatticePurchaseRequisitionService | MGCLatticeAccountsPayableServiceGroup |
| MGCLatticeInventoryJournalPostingService | MGCLatticeInventoryServiceGroup |
| MGCLatticeTransferOrderPostingService | MGCLatticeInventoryServiceGroup |
| MGCLatticeInventoryCostService | MGCLatticeInventoryServiceGroup |
| MGCLatticeProductionOrderPostingService | MGCLatticeProductionServiceGroup |
| MGCLatticeGeneralLedgerJournalService | MGCLatticeGeneralLedgerServiceGroup |
| MGCLatticePaymentJournalService | MGCLatticeGeneralLedgerServiceGroup |
| MGCLatticeBudgetRegisterService | MGCLatticeGeneralLedgerServiceGroup |
| MGCLatticeCurrencyRevaluationService | MGCLatticeGeneralLedgerServiceGroup |
| MGCLatticeJournalPostingService | MGCLatticeJournalPostingServiceGroup |
| MGCLatticeFixedAssetService | MGCLatticeFixedAssetsServiceGroup |
| MGCLatticeProjectJournalService | MGCLatticeProjectServiceGroup |
| MGCLatticeProjectInvoiceService | MGCLatticeProjectServiceGroup |
| MGCLatticeExpenseReportService | MGCLatticeExpenseServiceGroup |
| MGCLatticeWorkflowActionService | MGCLatticeWorkflowServiceGroup |
| MGCLatticeAsyncOperationService | MGCLatticeAsyncOperationServiceGroup |
| MGCLatticeDmfConfigService | MGCLatticeDataManagementServiceGroup |
| MGCLatticeDmfMappingService | MGCLatticeDataManagementServiceGroup |
| MGCLatticeDbAccessService | MGCLatticeDbAccessServiceGroup |
Common envelope fields (present on every request contract)
Defined once here; referenced per-operation as "common envelope" instead of repeating.
| JSON field | X++ type | required? | sample value | notes |
|---|---|---|---|---|
CorrelationId | Guid | optional | {{$guid}} | Tracing only. Empty GUID allowed. |
RequestId | Guid | required | {{$guid}} | Idempotency key. validateCommonRequest rejects empty GUID. A RequestId belongs to the operation that first used it: only a repeat of the same operation replays the cached result; sending it to a different operation, of the same or another service, is refused with DuplicateRequest (not retryable) and the operation does not run. |
LegalEntityId | DataAreaId (str) | required | USMF | The company the operation runs in (changecompany). Must exist and be accessible; it need not be the caller's default company. |
UserContext | UserId (str) | optional | Admin | Informational caller identifier, recorded in the service call log. Never used for authorization: the operation runs with the rights of the authenticated caller. The workflow work-item actions name the user the action is taken as in ActingUserId (see MGCLatticeWorkflowActionService). |
PreviewMode | boolean | optional | false | On every write request. Operations with a preview validate and post nothing when it is true; every other operation refuses true with ErrorCode PreviewUnsupported before it reads or writes anything. |
Mandatory minimum for any call to pass
validateCommonRequest:RequestId(non-empty GUID) andLegalEntityId=USMF. These are implied in every "mandatory minimum" note below. The samples also send"UserContext": "Admin", which is optional.
Response. The posting and action operations answer with
MGCLatticeOrderOperationResponseContract:DocumentIdis the document the request acted on andPostedDocumentIdthe document the operation produced (posted confirmation, packing slip, invoice, journal, voucher or created order), replayed for a repeatedRequestId. See API reference.
PostingDate defaulting
Most posting ops accept PostingDate (X++ TransDate). When omitted/empty the base class effectivePostingDate() defaults it to the user's system date. So PostingDate is optional unless a back-dated/forward-dated posting is required. Sample value used throughout: 2026-05-19 (ISO date string).
Error classification (every operation)
- A request that fails its checks (missing or blank fields, empty or missing lines, invalid quantities or dates, unknown codes or accounts the caller supplied, contract rules) returns
ValidationFailed, or a more specific code:DocumentNotFound,ConfigurationMissing,InvalidStatus,DimensionValueNotFound. - A failure of the business processing after the request is accepted, for example D365 refusing to create or post the document, returns
BusinessRule, not retryable. - Runtime, deadlock and update-conflict failures return
TransientRuntime, retryable. - Any other exception returns
Operation <name> failed due to an unexpected error., classifiedUnexpectedError, not retryable; the RequestId is released so it can be retried. - Batch ops: an empty (null) entry in
_requestsfails as its own item withValidationFailedandRequest item N is empty. Every item in the request list must be a request.; the other items still run.
Line IsSelected
Order-posting line contracts (Sales/Purchase/Transfer) carry IsSelected (boolean, default true). A line sent in Lines posts unless it says "IsSelected": false; a request whose lines are all unselected is refused with ValidationFailed, so a request with lines never posts the whole order.
Cross-reference key members (ExternalSystem / ...ExternalKey)
The contracts below also carry optional cross-reference key members. ExternalSystem (MGCLatticeExternalSystemId, str) sits on the request header; each <Id>ExternalKey (MGCLatticeExternalKey, str) sits next to the id it replaces, and line keys use the header's ExternalSystem. The service resolves a key to the D365 id in the request's legal entity before its own lookups. Only alternate keys resolve; a key that matches no record or more than one, or names a different record than an id sent with it, fails the request as ValidationFailed. When a key is sent, the id it replaces may be omitted. Batch operations take the same members per item. Sample: "ExternalSystem": "SHOP", "SalesOrderIdExternalKey": "WEB-100245". See Cross-reference keys.
| Contract | Header members | Line members |
|---|---|---|
MGCLatticeSalesOrderConfirmRequestContract, ...PackingSlipRequestContract, ...InvoiceRequestContract | ExternalSystem, SalesOrderIdExternalKey | - |
MGCLatticeSalesPackingSlipCancelRequestContract | ExternalSystem, SalesOrderIdExternalKey | (none) |
MGCLatticeCreateSalesOrderRequestContract (MGCLatticeSalesOrderCaptureService.createSalesOrder) | ExternalSystem, CustAccountExternalKey | MGCLatticeSalesOrderCaptureLineContract.ItemIdExternalKey |
MGCLatticePriceInquiryRequestContract | ExternalSystem, CustAccountExternalKey, ItemIdExternalKey | - |
MGCLatticeSetSalesPriceRequest (setSalesPrice, setSalesPriceBatch) | ExternalSystem, AccountRelationExternalKey (only with AccountCode = Table), ItemRelationExternalKey (only with ItemCode = Table) | - |
MGCLatticeFreeTextInvoicePostRequestContract | ExternalSystem, InvoiceAccountExternalKey | - |
MGCLatticeFreeTextInvoiceCancelRequestContract | ExternalSystem, InvoiceRecIdExternalKey | - |
MGCLatticeCreateSalesReturnRequestContract | ExternalSystem, CustAccountExternalKey | MGCLatticeReturnLineContract.ItemIdExternalKey |
MGCLatticeCreatePurchaseReturnRequestContract | ExternalSystem, VendAccountExternalKey | MGCLatticeReturnLineContract.ItemIdExternalKey |
MGCLatticeSalesReturnReceiveRequestContract, MGCLatticeSalesReturnCreditRequestContract | ExternalSystem, SalesOrderIdExternalKey (return order) | - |
MGCLatticePurchaseReturnShipRequestContract, MGCLatticePurchaseReturnCreditRequestContract | ExternalSystem, PurchaseOrderIdExternalKey | - |
MGCLatticePurchaseOrderConfirmRequestContract, ...PackingReceiptRequestContract, ...InvoiceRequestContract | ExternalSystem, PurchaseOrderIdExternalKey | - |
MGCLatticePurchaseProductReceiptCancelRequestContract, MGCLatticePurchasePrepaymentInvoiceRequestContract | ExternalSystem, PurchaseOrderIdExternalKey | (none) |
MGCLatticeVendorInvoiceJournalPostRequestContract | ExternalSystem | MGCLatticeVendorInvoiceJournalLineContract.VendAccountExternalKey |
MGCLatticePendingVendorInvoicePostRequestContract | ExternalSystem, VendorAccountExternalKey | (none) |
MGCLatticeVendorPaymentGenerationRequestContract (generateVendorPayments) | ExternalSystem, JournalNumExternalKey | (none) |
MGCLatticePurchReqActionRequestContract | ExternalSystem, PurchReqIdExternalKey | - |
MGCLatticeInventJournalPostRequestContract | ExternalSystem | MGCLatticeInventJournalLineContract.ItemIdExternalKey |
MGCLatticeInventBOMJournalPostRequestContract | ExternalSystem | MGCLatticeInventBOMJournalLineContract.ItemIdExternalKey, .BOMIdExternalKey |
MGCLatticeInventTagJournalPostRequestContract | ExternalSystem | MGCLatticeInventTagJournalLineContract.ItemIdExternalKey |
MGCLatticeInventOwnershipJournalPostRequestContract | ExternalSystem | MGCLatticeInventOwnershipJournalLineContract.ItemIdExternalKey, .VendAccountExternalKey |
MGCLatticeTransferOrderShipRequestContract, MGCLatticeTransferOrderReceiveRequestContract | ExternalSystem, TransferOrderIdExternalKey | MGCLatticeTransferPostingLineContract.ItemIdExternalKey, .LineNumExternalKey (a line key also fills in the line's item) |
MGCLatticeProductionOrderActionRequestContract, MGCLatticeProductionStartRequestContract, MGCLatticeProductionReportFinishedRequestContract, MGCLatticeProductionEndRequestContract, MGCLatticeProductionRouteCardPostRequestContract | ExternalSystem, ProdIdExternalKey | - |
MGCLatticeProductionPickListPostRequestContract | ExternalSystem, ProdIdExternalKey | MGCLatticeProductionPickListLineContract.ItemIdExternalKey |
MGCLatticePaymentJournalPostRequestContract | ExternalSystem | MGCLatticePaymentJournalLineContract.AccountNumExternalKey (customer or vendor, by operation), .SalesOrderIdExternalKey, .PurchaseOrderIdExternalKey |
MGCLatticeSettlementRequestContract | ExternalSystem, AccountNumExternalKey (customer or vendor, by operation) | - |
MGCLatticePaymentReversalRequestContract | ExternalSystem, AccountNumExternalKey (customer or vendor, by operation) | (none) |
MGCLatticeJournalReversalRequestContract | ExternalSystem, JournalNumExternalKey | (none) |
MGCLatticeGeneralJournalPostRequestContract (postGeneralJournal, postIntercompanyJournal) | ExternalSystem | MGCLatticeGeneralJournalLineContract.AccountNumExternalKey, .OffsetAccountNumExternalKey (customer or vendor accounts only; an offset key resolves in the line's OffsetCompany) |
MGCLatticeLedgerJournalPostingRequestContract (postLedgerJournal) | ExternalSystem, JournalNumExternalKey | (none) |
MGCLatticeFixedAssetAcquisitionRequestContract | ExternalSystem | MGCLatticeFixedAssetAcquisitionLineContract.AssetIdExternalKey |
MGCLatticeFixedAssetDisposalRequestContract | ExternalSystem, AssetIdExternalKey | - |
MGCLatticeFixedAssetTransactionRequestContract (postAssetTransaction) | ExternalSystem | MGCLatticeFixedAssetTransactionLineContract.AssetIdExternalKey |
MGCLatticeFixedAssetTransferRequestContract, MGCLatticeFixedAssetReversalRequestContract (transferAsset, reverseAssetTransaction) | ExternalSystem, AssetIdExternalKey | (none) |
MGCLatticeFixedAssetSplitRequestContract (splitAsset) | ExternalSystem, AssetIdExternalKey, ToAssetIdExternalKey | (none) |
MGCLatticeProjectJournalPostRequestContract | ExternalSystem, ProjIdExternalKey | MGCLatticeProjectJournalLineContract.ProjIdExternalKey, .ItemIdExternalKey |
MGCLatticeProjectInvoiceProposalRequestContract | ExternalSystem, ProjIdExternalKey | - |
MGCLatticeStatusQueryRequestContract (sales, purchase, production, journal and workflow status) | ExternalSystem, DocumentIdExternalKey (getWorkflowStatus: a purchase requisition's key) | - |
getAsyncOperationStatus, the workflow, async, budget, currency revaluation, pending price activation, item cost calculation, vendor payment proposal (generatePaymentProposal), depreciation, journal posting (postInventoryJournal, postProjectJournal, postProductionJournal, postTradeAgreementJournal), expense report, database access and DMF configuration contracts carry no key members.
ACCOUNTS RECEIVABLE
MGCLatticeSalesOrderPostingService
Group: MGCLatticeAccountsReceivableServiceGroup
Line contract: MGCLatticeSalesPostingLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
LineNum | LineNum (real) | one of LineNum/ItemId | 1.0 | The order line to post. Preferred: it names the line directly. |
ItemId | ItemId (str) | one of LineNum/ItemId | D0001 | Without LineNum, names the one line of this item (plus InventDimId) that still has a quantity to post; with LineNum, must match that line. |
InventDimId | InventDimId (str) | optional | 000001 | Inventory dimension combination id. Narrows an ItemId match; must match the line when sent with LineNum. |
Qty | Qty (real) | required | 10.0 | Quantity to post: greater than zero and no more than what is left to post on the line. |
IsSelected | boolean | optional | true | Default true; a line with false is skipped. |
For Sales/Purchase posting ops, an omitted or empty
Linesarray posts the whole order (confirmPurchaseOrdertakes noLinesat all). WithLines, only the selected lines post, each for itsQty; the other order lines are left as they were. All-unselected, empty, unknown, ambiguous (anItemIdthat matches several lines) or duplicated lines, and aQtythat is not positive or exceeds the quantity left, are refused withValidationFailedbefore anything posts. An operation that posts nothing fails. A request that names no order (SalesOrderId/PurchaseOrderIdblank and no external key that resolves) isValidationFailed.Response:
DocumentId= the order;PostedDocumentId= the posted confirmation / packing slip / product receipt / invoice number (replayed for a repeatedRequestId). The three sales posting ops acceptPreviewMode: true(validate only, nothing posts);cancelSalesPackingSlipand the purchase posting ops refuse it withPreviewUnsupported.
confirmSalesOrder (single) / confirmSalesOrderBatch (batch)
- Endpoint: MGCLatticeAccountsReceivableServiceGroup / MGCLatticeSalesOrderPostingService /
confirmSalesOrder|confirmSalesOrderBatch - URL:
POST {{baseUrl}}/api/services/MGCLatticeAccountsReceivableServiceGroup/MGCLatticeSalesOrderPostingService/confirmSalesOrder - Request contract:
MGCLatticeSalesOrderConfirmRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | req/opt | see §0 | ||
SalesOrderId | SalesId (str) | required | SO-000001 | Must reference an existing open sales order. |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticeSalesPostingLineContract | optional | [] | Empty = confirm entire order. The confirmed lines keep their deliver-now quantities. |
PreviewMode | boolean | optional | false | true validates without posting. |
Mandatory minimum: envelope + SalesOrderId.
{ "_request": {
"CorrelationId": "{{$guid}}", "RequestId": "{{$guid}}",
"LegalEntityId": "USMF", "UserContext": "Admin",
"SalesOrderId": "SO-000001", "PostingDate": "2026-05-19",
"Lines": [ { "LineNum": 1.0, "ItemId": "D0001", "Qty": 10.0 } ]
} }
Batch envelope: { "_requests": [ { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "SalesOrderId": "SO-000001" } ] }
Data dependency: existing sales order SO-000001 in USMF.
postSalesPackingSlip (single) / postSalesPackingSlipBatch (batch)
- Request contract:
MGCLatticeSalesOrderPackingSlipRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
SalesOrderId | SalesId (str) | required | SO-000001 | Must reference an existing sales order. The service does not require it to be confirmed first. |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticeSalesPostingLineContract | optional | [] | Empty = everything not yet delivered. |
PreviewMode | boolean | optional | false | true validates without posting. |
The packing slip number comes from the number sequence and is returned as PostedDocumentId.
Mandatory minimum: envelope + SalesOrderId.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"SalesOrderId": "SO-000001", "PostingDate": "2026-05-19",
"Lines": [ { "LineNum": 1.0, "Qty": 5.0 } ] } }
Dependency: existing sales order with quantity left to deliver; the service does not check for a confirmation.
invoiceSalesOrder (single) / invoiceSalesOrderBatch (batch)
- Request contract:
MGCLatticeSalesOrderInvoiceRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
SalesOrderId | SalesId (str) | required | SO-000001 | |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticeSalesPostingLineContract | optional | [] | Empty = an order with packing slips is invoiced for the packing slip quantities not yet invoiced; an order without, for its ordered quantity. |
PreviewMode | boolean | optional | false | true validates without posting. |
The invoice number comes from the number sequence and is returned as PostedDocumentId.
Mandatory minimum: envelope + SalesOrderId.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"SalesOrderId": "SO-000001", "PostingDate": "2026-05-19", "Lines": [] } }
Dependency: packing slip typically posted first (depending on AR setup).
cancelSalesPackingSlip (single) / cancelSalesPackingSlipBatch (batch)
- Request contract:
MGCLatticeSalesPackingSlipCancelRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
SalesOrderId | SalesId (str) | required | SO-000001 | Or SalesOrderIdExternalKey + ExternalSystem. |
PackingSlipId | PackingSlipId (str) | optional | PS-000001 | The packing slip to cancel. Empty = the order's only packing slip that can be canceled; when several can be canceled, it is required (ValidationFailed without it). |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
Cancels the packing slip as Packing slip journal > Cancel does (the standard posting runs as a cancellation: delivery, inventory and ledger postings reversed; the packing slip is kept as a new version with zero quantities). Success only when the packing slip reads as canceled and every order line it delivered is open to deliver again; otherwise the cancellation is rolled back.
Response: DocumentId = the sales order; PostedDocumentId = the canceled packing slip number.
Refusals: no posted packing slip on the order, or a packing slip already canceled, invoiced (fully or in part) or not able to be canceled in the packing slip journal (drop shipment, open warehouse work, project item requirement, order type that cannot be corrected) = InvalidStatus; unknown order or a PackingSlipId not on the order = DocumentNotFound; several packing slips that can be canceled and no PackingSlipId, a packing slip number posted on several delivery dates, or a packing slip that also delivers other sales orders = ValidationFailed; a cancellation D365 refuses = BusinessRule.
Security: high-risk privilege MGCLatticeAccountsReceivablePackingSlipCancelMaintain (in MGCLatticeIntegrationServiceHighRiskDuty); not granted by MGCLatticeAccountsReceivableServiceMaintain.
Mandatory minimum: envelope + SalesOrderId.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"SalesOrderId": "SO-000001", "PackingSlipId": "PS-000001" } }
Dependency: a sales order with a posted packing slip that is not invoiced.
getSalesOrderStatus (single, query)
- Request contract:
MGCLatticeStatusQueryRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
DocumentId | str | required | SO-000001 | The SalesId to query. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "DocumentId": "SO-000001" } }
MGCLatticeSalesOrderCaptureService
Group: MGCLatticeAccountsReceivableServiceGroup
Line contract: MGCLatticeSalesOrderCaptureLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
ItemId | ItemId (str) | required | D0001 | |
Qty | Qty (real) | required | 5.0 | A line without a quantity (or with 0) is refused (ValidationFailed); a quantity is never defaulted. |
UnitId | SalesUnit (str) | optional | - | Empty = the item's sales unit. |
UnitPrice | SalesPrice (real) | optional | - | 0 = the trade agreement or default price. |
SiteId | InventSiteId (str) | optional | 1 | Ship-from site. |
WarehouseId | InventLocationId (str) | optional | 11 | Ship-from warehouse. |
InventDimId | InventDimId (str) | optional | - | A pre-resolved dimension; takes precedence over SiteId/WarehouseId. |
createSalesOrder (single) / createSalesOrderBatch (batch)
- Request contract:
MGCLatticeCreateSalesOrderRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
CustAccount | CustAccount (str) | required | US-001 | A customer that does not exist in the legal entity is DocumentNotFound. |
CurrencyCode | CurrencyCode (str) | optional | USD | Empty = the customer's currency. |
SalesOrderId | SalesId (str) | optional | - | Empty = the number sequence assigns the order number. |
CustomerRef | CustRef (str) | optional | PO-88231 | Customer reference on the header. |
Lines | List of MGCLatticeSalesOrderCaptureLineContract | required (≥1) | see above | |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
Mandatory minimum: envelope + CustAccount + 1 line (ItemId, Qty).
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"CustAccount": "US-001", "CustomerRef": "PO-88231",
"Lines": [ { "ItemId": "D0001", "Qty": 5.0, "SiteId": "1", "WarehouseId": "11" } ] } }
Behavior: creates a sales order (type Sales) through the standard header and line defaulting and validation; DocumentId = PostedDocumentId = the new sales order number. A repeat of the same RequestId returns that order instead of creating a second one.
MGCLatticeFreeTextInvoiceService
Group: MGCLatticeAccountsReceivableServiceGroup
An empty (null) line, a line with neither AmountCur nor UnitPrice, and a line whose AmountCur is not Quantity x UnitPrice (to 0.01) are refused with ValidationFailed. PreviewMode = true is refused with PreviewUnsupported before anything is created.
Line contract: MGCLatticeFreeTextInvoiceLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
Description | Description (str) | optional | Consulting services | Line text. |
MainAccountId | str | optional | 401100 | Revenue main account (USMF). When sent it must be in the legal entity's chart of accounts, otherwise DimensionValueNotFound. |
AmountCur | AmountCur (real) | one of AmountCur/UnitPrice | 1000.00 | Line amount in the invoice currency. When 0 it is Quantity x UnitPrice; when both are sent it must equal Quantity x UnitPrice. |
Quantity | Qty (real) | optional | 1.0 | Defaults to 1. |
UnitPrice | InvoiceUnitPrice (real) | one of AmountCur/UnitPrice | 1000.00 | When 0 it is AmountCur / Quantity. |
SalesTaxGroup | TaxGroup (str) | optional | CA | Customer sales-tax group (USMF). |
ItemSalesTaxGroup | TaxItemGroup (str) | optional | Full | Item sales-tax group (USMF). |
postFreeTextInvoice (single) / postFreeTextInvoiceBatch (batch)
- Request contract:
MGCLatticeFreeTextInvoicePostRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
InvoiceAccount | CustAccount (str) | required | US-001 | Customer to invoice. |
CurrencyCode | CurrencyCode (str) | optional | USD | Defaults from the customer. |
PostingDate | TransDate | optional | 2026-05-19 | |
DueDate | TransDate | optional | 2026-06-19 | |
Lines | List of MGCLatticeFreeTextInvoiceLineContract | required (≥1) | see above | At least one line needed. |
Response: DocumentId and PostedDocumentId = the posted invoice number.
Mandatory minimum: envelope + InvoiceAccount + 1 line with AmountCur or UnitPrice; the sample also sends the line's Description and revenue MainAccountId.
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"InvoiceAccount": "US-001", "CurrencyCode": "USD",
"PostingDate": "2026-05-19", "DueDate": "2026-06-19",
"Lines": [ { "Description": "Consulting services", "MainAccountId": "401100",
"AmountCur": 1000.00, "Quantity": 1.0, "UnitPrice": 1000.00 } ]
} }
Dependency: customer US-001; verify MainAccountId 401100 and tax groups exist in USMF.
cancelFreeTextInvoice (single) / cancelFreeTextInvoiceBatch (batch)
- Request contract:
MGCLatticeFreeTextInvoiceCancelRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
InvoiceRecId | RecId (int64) | one of RecId/InvoiceId | 5637145000 | RecId of the posted FTI (CustInvoiceTable). Wins if both provided. |
InvoiceId | Num (str) | one of RecId/InvoiceId | FTI-000001 | Natural key - the free-text invoice id. Resolves the RecId server-side; InvoiceRecId still takes precedence if also supplied. |
CancelDate | TransDate | optional | 2026-05-19 | |
ReasonCode | str | required | ERROR | Financial reason (ReasonTable, customer-enabled). F&O will not save a correction without one; USMF has no CORR/CANCEL. |
ReasonComment | str | optional | Cancellation |
Response: DocumentId = the canceled invoice; PostedDocumentId = the correcting invoice.
Mandatory minimum: envelope + one of InvoiceRecId / InvoiceId + ReasonCode.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"InvoiceRecId": 5637145000, "InvoiceId": "FTI-000001", "CancelDate": "2026-05-19", "ReasonCode": "ERROR" } }
Natural key: supply
InvoiceIdto have the service resolve theCustInvoiceTableRecId from the invoice id; the RecId remains a fallback (and wins if both are sent).
Dependency: InvoiceRecId is a RecId-only input - not creatable via OData; must be obtained from a posted free-text invoice in USMF. InvoiceId is the natural-key alternative when the posted FTI id is known.
MGCLatticeSalesReturnService
Group: MGCLatticeAccountsReceivableServiceGroup
The receive and credit operations are header-only - their request contracts do not carry a
Linescollection.createSalesReturntakes lines (MGCLatticeReturnLineContract). No return operation has a preview:PreviewMode: trueis refused withPreviewUnsupportedbefore anything runs. A missing order number (after any external key is resolved) fails withValidationFailednaming the member.PostedDocumentIdin the response is the document produced: the created return order, the return packing slip or the credit note number.
createSalesReturn / createSalesReturnBatch
- Request contract:
MGCLatticeCreateSalesReturnRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
CustAccount | CustAccount (str) | required | US-001 | |
ReturnReasonCodeId | ReturnReasonCodeId (str) | required | 21 | The header return reason; it applies to every line. |
ReturnDeadline | ReturnDeadline (date) | optional | 2026-06-19 | |
Lines | List of MGCLatticeReturnLineContract | required (≥1) | see below | |
PreviewMode | boolean | optional | false | true is refused (PreviewUnsupported). |
Line (MGCLatticeReturnLineContract, shared with createPurchaseReturn): ItemId (required), Qty (required: a
missing or 0 quantity, or an empty line, fails the request with ValidationFailed before anything is created; stored
negative), SiteId + WarehouseId or InventDimId, DispositionCode (sales only), ItemIdExternalKey.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"CustAccount": "US-001", "ReturnReasonCodeId": "21",
"Lines": [ { "ItemId": "D0001", "Qty": 1, "DispositionCode": "11" } ] } }
receiveSalesReturn / receiveSalesReturnBatch
- Request contract:
MGCLatticeSalesReturnReceiveRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
SalesOrderId | SalesId (str) | required | 001412 | Existing return order (sales order of type ReturnItem). |
PostingDate | TransDate | optional | 2026-05-19 | |
DispositionCode | ReturnDispositionCodeId (str) | lines without one | 11 | Applied when the receive registers the lines (the return order's Registration step). Its action decides the flow: Credit (USMF 11) = receive into inventory, then credit note; CreditOnly (21) = no receipt; Scrap (61)... Lines that already carry a code keep it. |
PreviewMode | boolean | optional | false | true is refused (PreviewUnsupported). |
The receive performs the standard return flow: every open line still awaiting arrival is registered with its disposition code (InventTransWMS_Register, line → Registered), then the packing slip moves it to Received - the state creditSalesReturn requires. PostedDocumentId is the return packing slip number.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"SalesOrderId": "001412", "PostingDate": "2026-05-19", "DispositionCode": "11" } }
creditSalesReturn / creditSalesReturnBatch
- Request contract:
MGCLatticeSalesReturnCreditRequestContract-SalesOrderIdrequired,PostingDateoptional,PreviewModerefused.PostedDocumentIdis the credit note number.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "SalesOrderId": "SO-RET-0001", "PostingDate": "2026-05-19" } }
Flow: createSalesReturn → receiveSalesReturn → creditSalesReturn.
MGCLatticePriceInquiryService
Group: MGCLatticeAccountsReceivableServiceGroup
resolveSalesPrice (single, read-only)
- Request contract:
MGCLatticePriceInquiryRequestContract. It has noRequestIdorUserContext(a read makes no idempotency claim);CorrelationIdis echoed. Response:MGCLatticePriceInquiryResponseContract, withErrorCodeandErrorson failure (see API reference).
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
CorrelationId | Guid | optional | {{$guid}} | Echoed on the response. |
LegalEntityId | DataAreaId (str) | optional | USMF | The company to price in; empty = the caller's current company. |
CustAccount | CustAccount (str) | required | US-001 | Must exist in the company (DocumentNotFound). |
ItemId | ItemId (str) | required | D0001 | Must exist in the company (DocumentNotFound). |
Qty | Qty (real) | optional | 10.0 | 0 = 1. |
PriceDate | TransDate | optional | 2026-05-19 | Empty = today. |
CurrencyCode | CurrencyCode (str) | optional | USD | Empty = the customer's currency. |
UnitId | UnitOfMeasureSymbol (str) | optional | - | Empty = the item's sales unit. |
SiteId | InventSiteId (str) | optional | - | Site, for site-specific agreements. |
WarehouseId | InventLocationId (str) | optional | - | Warehouse. |
{ "_request": { "LegalEntityId": "USMF", "CustAccount": "US-001", "ItemId": "D0001", "Qty": 10.0, "PriceDate": "2026-05-19" } }
MGCLatticeSalesTradeAgreementService
Group: MGCLatticeAccountsReceivableServiceGroup
setSalesPrice (single) / setSalesPriceBatch (batch)
- Request contract:
MGCLatticeSetSalesPriceRequest(both; the batch takes a_requestslist of it). It has noRequestIdorUserContext(a repeated identical request answers outcomeUnchanged);CorrelationIdis echoed. Response:MGCLatticeSetSalesPriceResult(withErrorCodeandErrorson failure);setSalesPriceBatchreturnsMGCLatticeSetSalesPriceBatchResult(Success,TotalCount,SuccessCount,FailureCount,Message,Results), not the bulk response (see API reference). To read the effective price, useresolveSalesPrice.
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
CorrelationId | Guid | optional | {{$guid}} | Echoed on the result. |
LegalEntityId | DataAreaId (str) | optional | USMF | Empty = the caller's current company. |
AccountCode | PriceDiscPartyCodeType (enum) | required | 0 | Sent as a number: 0 Table (customer), 1 GroupId (price group), 2 All. The name is refused with HTTP 400. |
AccountRelation | CustVendAC (str) | required | US-001 | Customer account or price group, per AccountCode. A customer (0) must exist. |
ItemCode | PriceDiscProductCodeType (enum) | required | 0 | Sent as a number: 0 Table (item), 1 GroupId (item group), 2 All. |
ItemRelation | ItemId (str) | required | D0001 | Item number or item group, per ItemCode. An item (0) must exist. |
CurrencyCode | CurrencyCode (str) | required | USD | |
UnitId | UnitOfMeasureSymbol (str) | optional | - | Empty = the item's sales unit (item code 0). |
FromQty | Qty (real) | optional | 0 | Quantity break "from". |
UnitPrice | Price (real) | required | 42.50 | Unit price to set; must be greater than zero unless AllowZeroPrice is true; never negative. |
AllowZeroPrice | boolean | optional | false | true to set a price of zero. |
PriceUnit | PriceUnit (real) | optional | 1 | Price-per quantity basis. |
FromDate | TransDate | required | 2026-06-01 | Not in the past; decides edit in place versus supersede. |
ToDate | TransDate | optional | - | Empty = open-ended. |
FindNext | boolean | optional | true | Needed for the first price of a key: a key with no single open-ended price (or a FromDate before it) is a complex timeline, answered RejectedComplex (BusinessRule) unless FindNext is true, which creates the price (Created). |
SiteId / WarehouseId | str | optional | - | Site / warehouse pricing dimensions. |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
{ "_request": { "LegalEntityId": "USMF",
"AccountCode": 0, "AccountRelation": "US-001", "ItemCode": 0, "ItemRelation": "D0001",
"CurrencyCode": "USD", "UnitPrice": 42.50, "FromDate": "2026-06-01", "FindNext": true } }
ACCOUNTS PAYABLE
MGCLatticePurchaseOrderPostingService
Group: MGCLatticeAccountsPayableServiceGroup
Line contract: MGCLatticePurchPostingLineContract
Same shape and rules as MGCLatticeSalesPostingLineContract: LineNum (real; the purchase line's line number), ItemId (str), InventDimId (str), Qty (real), IsSelected (bool, default true). Used by product receipt and invoice; confirmPurchaseOrder refuses Lines. Empty Lines posts the whole PO; with Lines, only the selected lines post, each for its Qty. An invoice of a PO that has product receipts is built from the receipts: Lines, if sent, must name every line with a received, uninvoiced quantity, each with exactly that quantity.
confirmPurchaseOrder / confirmPurchaseOrderBatch
- Request contract:
MGCLatticePurchaseOrderConfirmRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
PurchaseOrderId | PurchId (str) | required | PO-000001 | |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticePurchPostingLineContract | do not send | - | A confirmation always covers the whole order; a request with lines is refused (ValidationFailed). |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
PostedDocumentId = the confirmation number.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"PurchaseOrderId": "PO-000001", "PostingDate": "2026-05-19" } }
postPurchasePackingSlip (product receipt) / postPurchasePackingSlipBatch
- Request contract:
MGCLatticePurchaseOrderPackingReceiptRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
PurchaseOrderId | PurchId (str) | required | PO-000001 | |
PackingSlipId | PackingSlipId (str) | required | GRN-000001 | Vendor product-receipt number; returned as PostedDocumentId. |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticePurchPostingLineContract | optional | [] | |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"PurchaseOrderId": "PO-000001", "PackingSlipId": "GRN-000001", "PostingDate": "2026-05-19", "Lines": [] } }
invoicePurchaseOrder / invoicePurchaseOrderBatch
- Request contract:
MGCLatticePurchaseOrderInvoiceRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
PurchaseOrderId | PurchId (str) | required | PO-000001 | |
InvoiceId | Num (str) | required | VINV-000001 | Vendor invoice number; missing = ValidationFailed. Returned as PostedDocumentId. |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticePurchPostingLineContract | optional | [] | |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"PurchaseOrderId": "PO-000001", "InvoiceId": "VINV-000001", "PostingDate": "2026-05-19", "Lines": [] } }
cancelPurchaseProductReceipt / cancelPurchaseProductReceiptBatch
- Request contract:
MGCLatticePurchaseProductReceiptCancelRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
PurchaseOrderId | PurchId (str) | required | PO-000001 | A confirmed purchase order. Or PurchaseOrderIdExternalKey + ExternalSystem. |
ProductReceiptId | PackingSlipId (str) | optional | GRN-000001 | The product receipt to cancel. Empty = the order's only product receipt that can be canceled; when several can be canceled, it is required (ValidationFailed without it). |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
Cancels the receipt as Product receipt journal > Cancel does (receipt, inventory and ledger postings reversed; the receipt is kept as a new version with zero quantities). Success only when the receipt reads as canceled and every order line it received is open to receive again; otherwise the cancellation is rolled back.
Response: DocumentId = the purchase order; PostedDocumentId = the canceled product receipt number.
Refusals: the order not confirmed, no product receipt on the order, or a receipt already canceled, invoiced (fully or in part), matched to a pending vendor invoice, linked to project item requirements or not able to be canceled in the product receipt journal (intercompany direct delivery, consignment order) = InvalidStatus; unknown order or a ProductReceiptId not on the order = DocumentNotFound; several receipts that can be canceled and no ProductReceiptId, a receipt number posted on several delivery dates, or a receipt that also receives other purchase orders = ValidationFailed; a cancellation D365 refuses = BusinessRule.
Security: high-risk privilege MGCLatticeAccountsPayableProductReceiptCancelMaintain (in MGCLatticeIntegrationServiceHighRiskDuty); not granted by MGCLatticeAccountsPayableServiceMaintain.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"PurchaseOrderId": "PO-000001", "ProductReceiptId": "GRN-000001" } }
Dependency: a confirmed purchase order with a posted product receipt that is not invoiced and not on a pending vendor invoice.
postPurchasePrepaymentInvoice / postPurchasePrepaymentInvoiceBatch
- Request contract:
MGCLatticePurchasePrepaymentInvoiceRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
PurchaseOrderId | PurchId (str) | required | PO-000001 | An order of type Purchase order with no posted invoice. Or PurchaseOrderIdExternalKey + ExternalSystem. |
VendorInvoiceNumber | VendInvoiceId (str) | required | PP-0001 | The vendor's invoice number; becomes the posted invoice number (standard duplicate checks apply). |
PrepaymentPercent | Percent (real) | one of percent/amount, when the order has no prepayment | 10 | Greater than 0, at most 100: percentage of the order total. |
PrepaymentAmount | AmountCur (real) | one of percent/amount, when the order has no prepayment | Greater than 0, at most the order total: fixed amount in the order currency. | |
PrepaymentCategoryName | EcoResCategoryName (str) | required when the order has no prepayment | Training | Procurement category of the prepayment; must not be the category of an order line. |
PrepaymentCategoryHierarchyName | EcoResCategoryHierarchyName (str) | optional | Only when the category name is in several procurement category hierarchies. | |
PrepaymentDescription | PurchPrepayDescription (str) | optional | Description of a new prepayment. | |
InvoiceDate | DocumentDate | optional | 2026-05-19 | Invoice date of the prepayment invoice. |
PostingDate | TransDate | optional | 2026-05-19 | |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
Creates the order's prepayment from the request when the order has none (as Purchase > Prepayment does), then posts the amount still available to invoice as a vendor prepayment invoice (vendor advance) to the vendor and the Purchase prepayment inventory posting account, in one transaction (a failed posting leaves neither). On an order that already has a prepayment, send no prepayment members (or the same values): the existing prepayment is invoiced.
Response: DocumentId = the purchase order; PostedDocumentId = the voucher of the posted prepayment invoice; the message names the invoice number, amount, currency and voucher.
Refusals: missing VendorInvoiceNumber, both or neither of percent/amount (order without prepayment), a value not greater than 0, a percent above 100, an amount above the order total, a missing, unknown or ambiguous category, a category used on the order's lines, values that differ from the existing prepayment = ValidationFailed; unknown order = DocumentNotFound; an order not of type Purchase order, in review or finalized, intercompany, already invoiced, with a pending prepayment invoice or nothing left to prepay, or a vendor on hold for invoicing = InvalidStatus; posting definitions enabled in the general ledger parameters = ConfigurationMissing; a posting the standard refuses (duplicate vendor invoice number, no Purchase prepayment posting account) = BusinessRule.
Security: MGCLatticeAccountsPayableServiceMaintain (not high-risk).
Mandatory minimum: envelope + PurchaseOrderId + VendorInvoiceNumber, plus PrepaymentPercent or PrepaymentAmount and PrepaymentCategoryName for an order without a prepayment.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"PurchaseOrderId": "PO-000001", "VendorInvoiceNumber": "PP-0001",
"PrepaymentPercent": 10, "PrepaymentCategoryName": "Training", "PostingDate": "2026-05-19" } }
Dependency: a purchase order of type Purchase order with no invoice yet; a procurement category not used on its lines (USMF Training, hierarchy "Procurement - Office Supplies"); the Purchase prepayment account in the inventory posting setup (USMF: one rule for all items and vendors); posting definitions disabled.
There is no sales prepayment invoice operation. A customer prepayment is a customer payment journal line with
IsPrepayment: true(see MGCLatticePaymentJournalService).
getPurchaseOrderStatus
- Request contract:
MGCLatticeStatusQueryRequestContract-DocumentId= PurchId.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "DocumentId": "PO-000001" } }
Dependency: existing PO PO-000001 in USMF.
MGCLatticePurchaseReturnService
Group: MGCLatticeAccountsPayableServiceGroup
The ship and credit operations are header-only.
createPurchaseReturntakes lines (MGCLatticeReturnLineContract). No return operation has a preview:PreviewMode: trueis refused withPreviewUnsupportedbefore anything runs. A missing order number (after any external key is resolved) fails withValidationFailednaming the member.PostedDocumentIdin the response is the document produced: the created return order, the return packing slip or the credit note number.
createPurchaseReturn / createPurchaseReturnBatch
- Request contract:
MGCLatticeCreatePurchaseReturnRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
VendAccount | VendAccount (str) | required | US-101 | |
ReturnItemNum | PurchReturnItemNum (str, 10) | required | RMA7788 | The vendor's RMA number; F&O does not save a return order without one. |
ReturnReasonCodeId | ReturnReasonCodeId (str) | optional | 21 | |
Lines | List of MGCLatticeReturnLineContract | required (≥1) | see the sales return line | A purchase return ships out of the line's warehouse. |
PreviewMode | boolean | optional | false | true is refused (PreviewUnsupported). |
The standard PurchaseOrderHeadersV2 entity only covers ordinary purchase orders (it neither creates nor lists return
orders), so createPurchaseReturn is the API way to create one.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"VendAccount": "US-101", "ReturnItemNum": "RMA7788",
"Lines": [ { "ItemId": "D0001", "Qty": 1, "SiteId": "1", "WarehouseId": "11" } ] } }
shipPurchaseReturn / shipPurchaseReturnBatch
- Request contract:
MGCLatticePurchaseReturnShipRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
PurchaseOrderId | PurchId (str) | required | 00001000 | Existing return PO (PurchaseType ReturnItem), confirmed (confirmPurchaseOrder); an unconfirmed one is refused. |
PackingSlipId | PackingSlipId (str) | required | RS-00001000 | The return shipment number. |
PostingDate | TransDate | optional | 2026-05-19 | |
PreviewMode | boolean | optional | false | true is refused (PreviewUnsupported). |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "PurchaseOrderId": "00001000", "PackingSlipId": "RS-00001000", "PostingDate": "2026-05-19" } }
creditPurchaseReturn / creditPurchaseReturnBatch
- Request contract:
MGCLatticePurchaseReturnCreditRequestContract-PurchaseOrderIdandInvoiceId(the vendor's credit note number) required,PostingDateoptional,PreviewModerefused. After a return shipment the credit is built from the shipped quantity.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "PurchaseOrderId": "00001000", "InvoiceId": "RC-00001000", "PostingDate": "2026-05-19" } }
Flow: createPurchaseReturn → confirmPurchaseOrder → shipPurchaseReturn → creditPurchaseReturn.
MGCLatticeVendorInvoiceJournalService
Group: MGCLatticeAccountsPayableServiceGroup
Both ops refuse an empty (null) line with ValidationFailed, before any journal is created. postInvoiceRegisterJournal also refuses a line whose VendAccount is not an existing vendor that way; an approval line with an unknown vendor finds no registered invoice and fails with DocumentNotFound. PreviewMode = true is refused with PreviewUnsupported. Success: DocumentId = PostedDocumentId = the journal number; the journal carries the request's Description. Register lines take the vendor's defaults as the journal page does: terms of payment, method of payment (and its bank transaction type), payment specification and id, cash discount (calculated on the line), bank account, the vendor's currency when CurrencyCode is empty, and - when DueDate is empty - the due date from the terms of payment (from InvoiceDate when sent, else the transaction date). An invoice posted outright through a vendor invoice journal is posted approved, so payment proposals and payment journals pick it up.
Line contract: MGCLatticeVendorInvoiceJournalLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
VendAccount | VendAccount (str) | required | US-101 | |
InvoiceId | InvoiceId (str) | approval: required | INV-000001 | Vendor invoice number. Required on an approval line (ValidationFailed without it). |
AmountCurDebit | real | one of debit/credit | 0.00 | Approval: optional; when given it must equal the registered amount. |
AmountCurCredit | real | one of debit/credit | 1000.00 | An invoice is a credit to the vendor. |
CurrencyCode | CurrencyCode (str) | optional | USD | Defaults to the vendor's currency. |
Description | str | optional | Vendor invoice | |
TransDate | TransDate | optional | 2026-05-19 | |
InvoiceDate | TransDate | optional | 2026-05-19 | |
DueDate | TransDate | optional | 2026-06-19 | Defaults from the vendor's terms of payment. |
OffsetMainAccountId | MainAccountNum (str) | see notes | 601500 | Vendor invoice journal: the offset (expense) main account; it must allow manual entry (the AP control account is rejected). Invoice register: leave empty - F&O's default, the posting profile's pending-invoice account, applies. Approval: required, the expense account the invoice is approved to. |
ApproverPersonnelNumber | HcmPersonnelNumberId (str) | optional | 000020 | "Approved by". Register: defaults to the worker of the calling user; one is required. Approval: overrides the approver inherited from the register. |
postInvoiceRegisterJournal / postInvoiceRegisterJournalBatch
- Request contract:
MGCLatticeVendorInvoiceJournalPostRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | LedgerJournalNameId (str) | required | APInvReg | Either an invoice register journal name (type PurchaseLedger, USMF APInvReg): posting parks the invoices in the vendor invoice pool for postInvoiceApprovalJournal. Or a vendor invoice journal name (type VendInvoiceRegister, USMF APInvoice): posts the invoices outright. |
Description | Description (str) | optional | Invoice register journal test | |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticeVendorInvoiceJournalLineContract | required (≥1) | see above |
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "APInvReg", "Description": "Invoice register journal test", "PostingDate": "2026-05-19",
"Lines": [ { "VendAccount": "US-101", "InvoiceId": "INV-000001", "AmountCurCredit": 1000.00,
"CurrencyCode": "USD", "ApproverPersonnelNumber": "000020",
"InvoiceDate": "2026-05-19", "DueDate": "2026-06-19" } ]
} }
For an outright posting through APInvoice, add "OffsetMainAccountId": "601500" (the expense account).
postInvoiceApprovalJournal / postInvoiceApprovalJournalBatch
- Request contract:
MGCLatticeVendorInvoiceJournalPostRequestContract(same as above);JournalNameIdmust be an Approval journal name (USMFAPInvApp). - Each line names a registered invoice (
VendAccount+InvoiceId, posted through an invoice register journal) and its expense account (OffsetMainAccountId, required). The service fetches the invoice from the vendor invoice pool into a new approval journal (what Find vouchers does in the client), adds the expense line for the registered amount and posts;DocumentId= the approval journal number. - Fails without posting when the invoice is unknown, was posted outright (never registered), is already approved, is held by another unposted approval journal, or the given amount differs from the registered one. If posting fails, the invoices go back to the pool.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "APInvApp", "Description": "Invoice approval journal test",
"Lines": [ { "VendAccount": "US-101", "InvoiceId": "INV-000001", "AmountCurCredit": 1000.00,
"CurrencyCode": "USD", "OffsetMainAccountId": "601500" } ] } }
Dependency: vendor US-101; USMF journal names APInvReg (PurchaseLedger), APInvApp (Approval) and APInvoice (VendInvoiceRegister); expense account 601500.
MGCLatticeVendorInvoiceService
Group: MGCLatticeAccountsPayableServiceGroup
postPendingVendorInvoice / postPendingVendorInvoiceBatch
- Request contract:
MGCLatticePendingVendorInvoicePostRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
HeaderReference | TradeLineRefId (str) | one way | <VendorInvoiceHeaders.HeaderReference> | The pending invoice's header reference (key of the VendorInvoiceHeaders entity). |
VendorAccount | VendAccount (str) | other way, with InvoiceNumber | US-101 | The invoice's invoice account or vendor account. Or VendorAccountExternalKey + ExternalSystem. |
InvoiceNumber | VendInvoiceId (str) | other way, with VendorAccount | VINV-000042 | The vendor's invoice number (the pending invoice's Invoice field). |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
Name the invoice by HeaderReference or by VendorAccount + InvoiceNumber, not both. Posts the saved pending invoice the way Pending vendor invoices > Post does (standard matching, invoice policies, approval workflow rule and posting checks), on its own posting and invoice date; completely or not at all (on a refusal the invoice stays pending).
Response: DocumentId = the vendor's invoice number; PostedDocumentId = the voucher of the posted vendor invoice. Posting warnings and information are in Warnings / InformationalMessages.
Refusals: no invoice named, named both ways, VendorAccount without InvoiceNumber or the reverse, unknown vendor or unresolvable vendor key, several pending invoices of the vendor with that number (the message lists their header references) = ValidationFailed; no pending invoice with that header reference or vendor and number = DocumentNotFound; already posted, open for editing or being posted in another session, in automated invoice processing, on hold, in the approval workflow, or a vendor invoice workflow applies and the invoice is not approved = InvalidStatus; a posting the standard refuses (matching discrepancies, invoice policies, closed period, duplicate invoice number, ...) = BusinessRule.
Security: MGCLatticeAccountsPayableServiceMaintain.
Mandatory minimum: envelope + HeaderReference, or envelope + VendorAccount + InvoiceNumber.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"VendorAccount": "US-101", "InvoiceNumber": "VINV-000042" } }
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"HeaderReference": "<VendorInvoiceHeaders.HeaderReference>" } }
Dependency: a pending vendor invoice created in D365 or through the standard VendorInvoiceHeaders + VendorInvoiceLines entities (plus InvoiceSubLinesV2 to match a purchase order line to its product receipts). A non-PO line needs a procurement category with an expense account (USMF ADVERTISING, account 601300); a PO invoice needs a confirmed order with its product receipt posted when the item uses three-way matching.
MGCLatticeVendorPaymentProposalService
Group: MGCLatticeAccountsPayableServiceGroup
generatePaymentProposal / generatePaymentProposalBatch
- Request contract:
MGCLatticeVendorPaymentProposalRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | LedgerJournalNameId (str) | required | VendPay | Vendor payment journal name (type Payment); another type is refused (ValidationFailed). |
FromDueDate | TransDate | optional | 2026-01-01 | Proposal due-date range start; empty = no lower bound. Later than ToDueDate is refused. |
ToDueDate | TransDate | optional | 2026-05-19 | Range end; defaults to today. |
MethodOfPayment | str | optional | CHECK | USMF method of payment. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "VendPay", "FromDueDate": "2026-01-01", "ToDueDate": "2026-05-19", "MethodOfPayment": "CHECK" } }
Behavior: creates the payment journal, runs the standard vendor payment proposal (open, approved vendor transactions due in the window) and transfers it to the journal as payment lines; the journal is not posted. DocumentId = PostedDocumentId = the journal number; the message gives the payment line count. When nothing matches, the empty journal is deleted again (as the standard proposal's "avoid empty journals" does): the operation succeeds with an empty DocumentId and the message says so. A failure after the journal was created deletes it too while it has no lines. PreviewMode = true is refused with PreviewUnsupported.
Dependency: open vendor invoices in the due-date window (for lines); VendPay journal and CHECK method must exist (an unknown method is DocumentNotFound).
generateVendorPayments / generateVendorPaymentsBatch
- Request contract:
MGCLatticeVendorPaymentGenerationRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNum | LedgerJournalId (str) | required | 00698 | An open vendor payment journal (type Payment), for example the one generatePaymentProposal returned. Or JournalNumExternalKey + ExternalSystem. Another journal type = ValidationFailed; unknown = DocumentNotFound. |
MethodOfPayment | PaymMode (str) | optional | CHECK | Only the lines with this method. Empty = every line whose method needs generation before it can post (payment type Check, a check number demanded by the payment control, or payment status Sent demanded). Unknown = ValidationFailed. |
BankAccountId | CompanyBankAccountId (str) | optional | USMF OPER | Only the lines that pay from this bank account; it must exist, be active and have a check layout. |
PostAfterGenerate | boolean | optional | true | true posts the journal after the generation, in the same transaction (a failed posting uses no check). Default false. |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNum": "00698", "MethodOfPayment": "CHECK", "PostAfterGenerate": true } }
Behavior: the standard Generate payments of the vendor payment journal for check payments: each generated line (vendor lines with payment status None or Rejected, filtered as above) gets the next check number of its bank account's check layout as payment reference and payment status Sent, and the check is recorded in the bank account's checks with status Payment. The check document is not printed (print copies from F&O); methods that export a payment file or use an Electronic reporting format are refused. DocumentId = the journal; PostedDocumentId = the first payment voucher when posted, otherwise the first check number; the message lists every check number and InformationalMessages has one line per check.
Refusals: no JournalNum, not a vendor payment journal, unknown method of payment or bank account, inactive bank account, a line that pays from no bank account, a method that exports a payment file or uses Electronic reporting, a journal without lines or without a line to generate = ValidationFailed; unknown journal = DocumentNotFound; journal posted, blocked by the system or another user, not approved under workflow approval, or its payments already generated = InvalidStatus; method without export format, bank account without check layout, fixed check numbering without created checks left = ConfigurationMissing; the standard generation skipped a line or the posting failed = BusinessRule.
Security: MGCLatticeAccountsPayableServiceMaintain.
Dependency: an open VendPay journal with CHECK lines (for example from generatePaymentProposal); method CHECK (payment type Check, export format Check); bank account USMF OPER with a check layout.
MGCLatticePurchaseRequisitionService
Group: MGCLatticeAccountsPayableServiceGroup
Both ops share one contract: MGCLatticePurchReqActionRequestContract. PreviewMode = true is refused with PreviewUnsupported. A requisition is approved through its workflow: submit it, then complete the approver's work item with approveWorkItem.
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
PurchReqId | PurchReqId (str) | required | PR-000001 | Existing purchase requisition; a missing one is DocumentNotFound. |
Comment | str | optional | Submitting purchase requisition for approval | Submit only. |
submitPurchaseRequisition / submitPurchaseRequisitionBatch
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"PurchReqId": "PR-000001", "Comment": "Submitting purchase requisition for approval" } }
Submit runs the document checks of the requisition page's Submit: a draft with no workflow in progress (InvalidStatus), with lines, submitted by its preparer (the calling user must be mapped to the preparer worker) and passing the submission rules (BusinessRule), with an applicable PurchReqReview configuration (ConfigurationMissing). The requisition moves to In review together with the workflow activation; DocumentId = the requisition, and the message names the workflow instance.
convertPurchaseRequisitionToOrder / convertPurchaseRequisitionToOrderBatch
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "PurchReqId": "PR-000001" } }
The requisition must be Approved (InvalidStatus otherwise). No lines left to convert is ValidationFailed; a conversion that creates no purchase order line is BusinessRule. With automatic purchase order creation in the purchasing policy, D365 releases the approved requisition itself (Closed), after which convert answers InvalidStatus. DocumentId = the requisition; PostedDocumentId = the first purchase order created; the message lists all of them.
Dependency: an existing PR PR-000001 in the correct state (submit: Draft; convert: Approved).
INVENTORY
MGCLatticeInventoryJournalPostingService
Group: MGCLatticeInventoryServiceGroup
The movement, adjustment, counting and transfer ops share one request contract: MGCLatticeInventJournalPostRequestContract. The BOM, tag counting and ownership change ops have their own contracts (below), and on them JournalNameId is optional (default: the inventory parameters' journal name for the type; no name and no default = ConfigurationMissing). For the first four, the service validates the JournalNameId's journal type matches the operation (Movement / Adjustment / Counting / Transfer), and every line must name an existing item (an empty line or unknown ItemId is ValidationFailed); DocumentId = PostedDocumentId = the journal number. Success is reported only when the journal is posted. No op has a preview: PreviewMode: true is refused with PreviewUnsupported. When the op fails after creating the journal, the unposted journal is deleted, so a retry with the same RequestId creates it again.
Line contract: MGCLatticeInventJournalLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
ItemId | ItemId (str) | required | D0001 | |
InventDimId | InventDimId (str) | optional | 000001 | Dimension combination. |
Qty | Qty (real) | required | 10.0 | |
CostPrice | CostPrice (real) | optional | 50.00 | Movement/adjustment unit cost. |
CostAmount | CostAmount (real) | optional | 500.00 | |
ToInventDimId | InventDimId (str) | transfer only | 000002 | Destination dim of a transfer journal line; copied to the line only when sent. The service does not validate it: a transfer line without a destination fails later, when D365 posts the journal (BusinessRule). |
postMovementJournal / postMovementJournalBatch
JournalNameIdsample:IMov(must be a Movement-type journal name).
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | InventJournalNameId (str) | required | IMov | Type must = Movement. |
Description | Description (str) | optional | Movement journal test | |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticeInventJournalLineContract | required (≥1) | see above | |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "IMov", "Description": "Movement journal test", "PostingDate": "2026-05-19",
"Lines": [ { "ItemId": "D0001", "InventDimId": "000001", "Qty": 10.0, "CostPrice": 50.00 } ]
} }
postAdjustmentJournal / postAdjustmentJournalBatch
JournalNameIdsample:IAdj(Adjustment type). Same line/body shape as movement.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "IAdj", "Description": "Adjustment journal test", "PostingDate": "2026-05-19",
"Lines": [ { "ItemId": "D0001", "InventDimId": "000001", "Qty": 10.0, "CostPrice": 50.00 } ] } }
postCountingJournal / postCountingJournalBatch
JournalNameIdsample:ICnt(Counting type).Qty= the counted quantity; the line posts the difference between it and the on-hand quantity at the posting date.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "ICnt", "Description": "Counting journal test", "PostingDate": "2026-05-19",
"Lines": [ { "ItemId": "D0001", "InventDimId": "000001", "Qty": 100.0 } ] } }
postTransferJournal / postTransferJournalBatch
JournalNameIdsample:ITrf(Transfer type). SendToInventDimId(the destination) on every line; a missing one is not validated up front and fails at posting asBusinessRule.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "ITrf", "Description": "Transfer journal test", "PostingDate": "2026-05-19",
"Lines": [ { "ItemId": "D0001", "InventDimId": "000001", "ToInventDimId": "000002", "Qty": 5.0 } ] } }
Dependency: item D0001; the four journal names must exist with the matching journal type in USMF (the service rejects a name whose type doesn't match the op). InventDimId/ToInventDimId are InventDim.inventDimId RecId-strings - see open questions.
postBOMJournal / postBOMJournalBatch
- Request contract:
MGCLatticeInventBOMJournalPostRequestContract - Line contract:
MGCLatticeInventBOMJournalLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | InventJournalNameId (str) | optional | IBOM | A BOM journal name; empty = the inventory parameters' BOM journal name (USMF IBOM). Unknown or another type = ValidationFailed. |
Description | Description (str) | optional | BOM journal test | Default: the journal name's description. |
PostingDate | TransDate | optional | 2026-05-19 | The report-as-finished date; also selects the BOM version. |
Lines | List of MGCLatticeInventBOMJournalLineContract | required (≥1) | see below | One line per BOM item. |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
Line fields: ItemId (str, required, or ItemIdExternalKey; a stocked item that can be produced), Qty (real, required, > 0, inventory unit), InventDimId (str, receipt dimensions), SiteId / WarehouseId (str, receipt site and warehouse on top of InventDimId; a warehouse without a site takes its own site; open dimensions are the item's defaults for the site), BOMId (str, or BOMIdExternalKey; must be a BOM of the item; empty = the item's active BOM version for the date, quantity and site).
Each line is reported as finished by the standard Report as finished of the BOM journal (receipt line plus component issue lines, phantoms exploded, cost from the components), then the journal is posted. A journal that was created and could not be posted is deleted again.
Response: DocumentId = PostedDocumentId = the posted BOM journal; the message counts the item lines and the component lines.
Refusals: no lines, an empty line, unknown item, Qty <= 0, unknown dimensions / site / warehouse or a warehouse of another site, an item that cannot be produced or is not stocked, a BOMId that is not a BOM of the item, no active BOM version = ValidationFailed; Report as finished raised warnings (or a circular BOM) so the standard would not post, or the posting is refused (negative inventory, missing ledger accounts) = BusinessRule.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "IBOM", "Description": "BOM journal test", "PostingDate": "2026-05-19",
"Lines": [ { "ItemId": "D0007", "Qty": 1.0, "SiteId": "1", "WarehouseId": "11" } ] } }
Dependency: USMF D0007 has an active, approved BOM (000081, site 1) with components M0023 and M0024 consumed from warehouse 11.
postTagCountingJournal / postTagCountingJournalBatch
- Request contract:
MGCLatticeInventTagJournalPostRequestContract - Line contract:
MGCLatticeInventTagJournalLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | InventJournalNameId (str) | optional | ITag | A tag counting journal name; empty = the inventory parameters' tag counting journal name (USMF ITag). |
Description | Description (str) | optional | Tag counting test | |
PostingDate | TransDate | optional | 2026-05-19 | The counting date: counted quantities are compared with on-hand at this date. |
PostCountingJournal | boolean | optional | false | true also posts the counting journal, in the same transaction as the tags. Default false: left open for review, as in the standard. |
Lines | List of MGCLatticeInventTagJournalLineContract | required (≥1) | see below | One line per tag. |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
Line fields: TagNumber (str, required, unique in the request without regard to case, at most 10 characters: a longer one is ValidationFailed, never shortened), TagStatus (InventJournalTagStatus enum, sent as an integer: 1 Used, 2 Voided, 3 Missing; empty/0 = Used), ItemId (str, or ItemIdExternalKey; required on a used tag, not allowed on a voided or missing one), Qty (real, counted quantity >= 0 in the inventory unit; used tags only), InventDimId, SiteId, WarehouseId (str, where the tag was counted).
Posting the tags creates a counting journal (named by the inventory parameters' counting journal name, USMF ICnt) with one line per item and counted dimensions, counted = the sum of the used tags; the journal counts by the dimensions the tags give.
Response: DocumentId = the posted tag counting journal; PostedDocumentId = the counting journal it created (empty when no tag counted an item); the message says whether that journal was posted or is open for review.
Refusals: no lines, an empty line, no TagNumber, a tag number too long or duplicated, a used tag without item, a voided/missing tag with item or quantity, unknown item, Qty < 0, unknown dimensions = ValidationFailed; no default counting journal name in the inventory parameters = ConfigurationMissing; a tag the standard refuses (stopped item) or a refused posting = BusinessRule.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "ITag", "PostingDate": "2026-05-19", "PostCountingJournal": false,
"Lines": [ { "TagNumber": "T-0001", "ItemId": "D0001", "Qty": 12.0, "SiteId": "1", "WarehouseId": "11" },
{ "TagNumber": "T-0002", "ItemId": "D0001", "Qty": 8.0, "SiteId": "1", "WarehouseId": "11" },
{ "TagNumber": "T-0003", "TagStatus": 2 } ] } }
Dependency: USMF journal names ITag (TagCounting) and ICnt (the parameters' counting journal name).
postOwnershipChangeJournal / postOwnershipChangeJournalBatch
- Request contract:
MGCLatticeInventOwnershipJournalPostRequestContract - Line contract:
MGCLatticeInventOwnershipJournalLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | InventJournalNameId (str) | optional | IOwner | An ownership change journal name; empty = the inventory parameters' one. USMF sets none, so send IOwner. |
Description | Description (str) | optional | Ownership change test | |
PostingDate | TransDate | optional | 2026-05-19 | Date of the ownership change; the purchase order is received on it. |
Lines | List of MGCLatticeInventOwnershipJournalLineContract | required (≥1) | see below | |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
Line fields: ItemId (str, required, or ItemIdExternalKey; must track the Owner dimension), Qty (real, required, > 0), VendAccount (str, or VendAccountExternalKey; the vendor that owns the stock now; required unless InventDimId carries the owner), InventDimId, SiteId, WarehouseId (str, dimensions of the vendor-owned stock; open dimensions are the item's defaults).
Posting moves the quantity from the vendor's owner to the legal entity without a financial impact and creates, confirms and receives a purchase order per vendor for it.
Response: DocumentId = the posted ownership change journal; PostedDocumentId = the purchase order the posting created (the first, when several vendors); the message lists every purchase order.
Refusals: consignment configuration key (ConsignmentInbound) off = ConfigurationMissing; no lines, an empty line, unknown item, Qty <= 0, an item without the Owner dimension, unknown dimensions, unknown vendor, a vendor without an inventory owner, VendAccount and InventDimId naming different owners, no owner, the legal entity as owner = ValidationFailed; a refused posting (not enough vendor-owned stock, purchase order not created) = BusinessRule.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "IOwner", "PostingDate": "2026-05-19",
"Lines": [ { "ItemId": "M9211CI", "Qty": 1.0, "VendAccount": "US-104", "SiteId": "5", "WarehouseId": "51" } ] } }
Dependency: consignment enabled; USMF M9211CI is consignment stock owned by vendor US-104 (owner id US-104) at site 5 / warehouse 51.
Security (all seven inventory journal ops and their batches): MGCLatticeInventoryServiceMaintain.
MGCLatticeTransferOrderPostingService
Group: MGCLatticeInventoryServiceGroup
Line contract: MGCLatticeTransferPostingLineContract
Same shape as the other order-posting line contracts: LineNum (real), ItemId (str), InventDimId (str), Qty (real), IsSelected (bool, default true), plus ItemIdExternalKey / LineNumExternalKey. Optional; empty Lines ships/receives the whole order. With Lines, only the selected lines post, each for its Qty: a selected line with Qty <= 0 and a request whose lines are all unselected are refused (ValidationFailed), so a request with lines never ships/receives the whole order.
Response: DocumentId = the transfer order; PostedDocumentId = the voucher of the shipment/receipt journal posted (replayed for a repeated RequestId). An update that posts no journal fails. A blank TransferOrderId (no resolving key) is ValidationFailed. No preview: PreviewMode: true is refused with PreviewUnsupported.
shipTransferOrder / shipTransferOrderBatch
- Request contract:
MGCLatticeTransferOrderShipRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
TransferOrderId | InventTransferId (str) | required | TO-000001 | |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticeTransferPostingLineContract | optional | [] | |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"TransferOrderId": "TO-000001", "PostingDate": "2026-05-19", "Lines": [] } }
receiveTransferOrder / receiveTransferOrderBatch
- Request contract:
MGCLatticeTransferOrderReceiveRequestContract(same fields as ship).
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"TransferOrderId": "TO-000001", "PostingDate": "2026-05-19", "Lines": [] } }
Dependency: transfer order TO-000001 (USMF warehouses 11→13, item D0001); must be shipped before receive.
MGCLatticeInventoryCostService
Group: MGCLatticeInventoryServiceGroup. activatePendingPrices and its batch take MGCLatticePendingPriceActivationRequestContract and are granted by the high-risk privilege MGCLatticeInventoryCostActivateMaintain (administrator role only). calculateItemCosts and its batch take MGCLatticeItemCostCalculationRequestContract and are granted by MGCLatticeInventoryCostCalculateMaintain (operations duty, not high-risk; see below).
Activates the pending item prices of a costing version (new standard costs), the API equivalent of Activate on the Costing versions page (Activate pending price(s) on an item's Item price page). Runs the standard InventItemPriceActivationJob in one transaction: every eligible pending price is activated or, if one fails, none is. Activating a standard cost revalues on-hand inventory and posts the revaluation to the general ledger. A pending price is eligible when it is the newest one of its item, price type and price dimensions, is dated today or earlier, and passes the standard activation checks; a standard costing version with a fixed From date (DefaultDate) requires its pending prices to carry that date (USMF version 10: 2018-01-01).
activatePendingPrices / activatePendingPricesBatch
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
CostingVersionId | CostingVersionId (str) | required | 10 | Must exist in the legal entity (DocumentNotFound) and not be blocked for activation (InvalidStatus). |
ActivateCostPrice | boolean | optional | true | When none of the three price-type flags is set, cost prices only are activated. |
ActivatePurchasePrice | boolean | optional | false | |
ActivateSalesPrice | boolean | optional | false | |
ActivateCostCategoryPrices | boolean | optional | false | Also activates the version's pending routing cost category prices and cost sheet calculation factors. Whole-version only: with ItemIds the request is ValidationFailed. |
SkipIfEqualPriceExists | boolean | optional | false | A pending price equal to the active one stays pending. |
ItemIds | List of str | optional | ["M0001"] | Limit to these items; empty/absent = every eligible pending price of the version. An unknown item is ValidationFailed. |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported before any other check. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"CostingVersionId": "10", "ActivateCostPrice": true, "ItemIds": [ "M0001" ] } }
Batch: { "_requests": [ { ... }, { ... } ] }, for example one item per legal entity or costing version; each item runs exactly as the single op (empty list → failed with no results; a null item → its own ValidationFailed result).
Response: DocumentId = the costing version; PostedDocumentId = the voucher of the on-hand inventory revaluation (empty when nothing on hand was revalued). Success messages: Activated N pending price(s) in costing version V: <items>., with On-hand inventory was revalued on voucher X. when a revaluation was posted; No item price was activated in costing version V: ... (still a success) when every eligible price equals the active one or only cost category prices and calculation factors were pending. Nothing eligible to activate (and ActivateCostCategoryPrices not set) is BusinessRule: Costing version V has no pending price dated <today> or earlier for the requested price types and items. Idempotent on RequestId. activatePendingPrices (not the batch op) can be queued with submitAsyncOperation (ServiceName MGCLatticeInventoryCostService, OperationName activatePendingPrices).
Dependency: a pending cost price for the item in the version, dated with the version's fixed from date (USMF 10: 2018-01-01); create one with the standard InventItemPendingPricesV2 entity. M0001 (site 1) is a standard cost item with on-hand in USMF, so activating its new cost also posts a revaluation.
calculateItemCosts / calculateItemCostsBatch
- Request contract:
MGCLatticeItemCostCalculationRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
CostingVersionId | CostingVersionId (str) | required | 10 | Must exist (DocumentNotFound), not be blocked (InvalidStatus; blocking activation does not block calculation), not be a standard cost conversion version and allow cost prices (ValidationFailed). |
SiteId | InventSiteId (str) | required when the version has no site | 1 | The site the costs are calculated for. A version restricted to a site calculates for that site (send it or leave it empty; another site = ValidationFailed). |
CalculationDate | TransDate | optional | 2018-01-01 | Calculation date and from date of the pending prices. Empty = the version's fixed date, else today. A version with a fixed date accepts only that date (ValidationFailed). |
ItemIds | List of str | optional | ["D0003"] | Items to calculate; empty/absent = every item of the legal entity. An unknown item is ValidationFailed. |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported before any other check. |
Runs the standard item cost calculation of Costing versions > Calculation with the version's settings (cost prices, and sales prices when the version allows them; profit setting, fallback principle, price models, rounding; single level for a standard costing version; the procurement modes the version calculates), and records each item's result as a pending cost price in the version, dated the calculation date (an existing pending price of the same item, site and date is overwritten). Nothing is activated, revalued or posted: activatePendingPrices makes the prices active. Like the standard it runs outside a transaction: each item is recorded on its own, and a failed item does not stop the others.
Response: DocumentId = the costing version; PostedDocumentId = the calculation number of the first calculated item in item number order. Success message: Calculated N pending price(s) in costing version V for site S on <date>: <items>. (the first 25 items, then how many more). Warnings = the calculation's warnings and the errors of items that could not be calculated.
Refusals: besides the member rules above, the calculation number sequence (BOM parameters) not set up = ConfigurationMissing; a run that recorded no pending price, or an item in ItemIds that got no pending cost price = BusinessRule (the prices calculated for the other items stay recorded; calling again recalculates them).
calculateItemCosts (not the batch op) can be queued with submitAsyncOperation (ServiceName MGCLatticeInventoryCostService, OperationName calculateItemCosts). Batch: one calculateItemCosts per item (empty list → failed with no results; a null item → its own ValidationFailed result).
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"CostingVersionId": "10", "SiteId": "1", "ItemIds": [ "D0003" ] } }
Dependency: USMF costing version 10 (standard, fixed date 2018-01-01, no site); D0003 has an active, approved BOM and route at site 1; the calculation number sequence must be set up.
PRODUCTION
MGCLatticeProductionOrderPostingService
Group: MGCLatticeProductionServiceGroup. All ops require an existing production order ProdId (e.g. P000001) in the appropriate state; a request without ProdId (or ProdIdExternalKey) is ValidationFailed, a missing order is DocumentNotFound. No op has a preview: PreviewMode: true is refused with PreviewUnsupported before anything runs. postPickList, postRouteCard and reportAsFinished return the posted production journal number in PostedDocumentId. When the production control parameters do not allow a status update (estimate, schedule, release, start, report as finished, end) from the order's current status, the op fails with InvalidStatus instead of reporting the skipped update as done. postPickList / postRouteCard report success only when their production journal is posted; a journal whose posting failed is deleted, so it does not block the order and a retry with the same RequestId creates it again. Pick list and route card lines are validated before the journal is created and are posted exactly as sent (no automatic report as finished or picking list from the production parameters).
startProductionOrder / startProductionOrderBatch
- Request contract:
MGCLatticeProductionStartRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
ProdId | ProdId (str) | required | P000001 | |
PostingDate | TransDate | optional | 2026-05-19 | |
StartQty | Qty (real) | optional | 10.0 | Default: the quantity not started yet. The start applies the site's automatic BOM / route consumption parameters. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"ProdId": "P000001", "PostingDate": "2026-05-19", "StartQty": 10.0 } }
reportAsFinished / reportAsFinishedBatch
- Request contract:
MGCLatticeProductionReportFinishedRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
ProdId | ProdId (str) | required | P000001 | |
PostingDate | TransDate | optional | 2026-05-19 | |
GoodQty | Qty (real) | optional | 10.0 | Quantity reported finished. A report without EndJob needs GoodQty or ErrorQty (ValidationFailed otherwise). |
ErrorQty | Qty (real) | optional | 0.0 | Scrap. |
EndJob | boolean | optional | true | The standard "End job". Default false = partial report (status and remaining quantity unchanged); true = the order becomes Reported as finished and its remaining quantity is cleared. |
AcceptError | boolean | optional | true | The form's "Accept error", used with EndJob: end the job even when the route jobs / BOM lines are not reported as finished; false stops with "Job ... has not been reported as finished". |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"ProdId": "P000001", "PostingDate": "2026-05-19", "GoodQty": 10.0, "ErrorQty": 0.0, "EndJob": true, "AcceptError": true } }
endProductionOrder / endProductionOrderBatch
- Request contract:
MGCLatticeProductionEndRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
common envelope + ProdId (required) + PostingDate (opt, the calculation date of the end) | P000001 |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "ProdId": "P000001", "PostingDate": "2026-05-19" } }
estimateProductionOrder / scheduleProductionOrder / releaseProductionOrder (+ Batch)
- Shared request contract:
MGCLatticeProductionOrderActionRequestContract - Fields: common envelope +
ProdId(required,P000001). The actions take no date.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "ProdId": "P000001" } }
(Identical body for estimate, schedule, release - only the operationName in the URL differs.)
postPickList / postPickListBatch
- Request contract:
MGCLatticeProductionPickListPostRequestContract - Line contract:
MGCLatticeProductionPickListLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
ProdId | ProdId (str) | required | P000001 | |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticeProductionPickListLineContract | required (≥1) | see below | A request without lines is refused (ValidationFailed). |
Line fields: ItemId (str; required unless InventTransId is sent), Qty (real, > 0, in the BOM line's unit), InventDimId (str, must exist), InventTransId (str, optional: lot id of the production BOM line to consume against). Without InventTransId the line consumes against the order's only open BOM line for the item; no open line = a new BOM line (unplanned consumption); several open lines = ValidationFailed (send InventTransId).
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"ProdId": "P000001", "PostingDate": "2026-05-19",
"Lines": [ { "ItemId": "M0001", "Qty": 10.0, "InventDimId": "000001" } ] } }
postRouteCard / postRouteCardBatch
- Request contract:
MGCLatticeProductionRouteCardPostRequestContract - Line contract:
MGCLatticeProductionRouteCardLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
ProdId | ProdId (str) | required | P000001 | |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticeProductionRouteCardLineContract | required (≥1) | see below |
Line fields: OprNum (int, 10, required, a primary operation on the order's route), Hours (real, 2.0, process hours), GoodQty (real, 10.0), ErrorQty (real, 0.0); a line needs hours or a quantity. Each line is defaulted as the route card form does (job type Process, resource, cost categories, executed percentage).
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"ProdId": "P000001", "PostingDate": "2026-05-19",
"Lines": [ { "OprNum": 10, "Hours": 2.0, "GoodQty": 10.0, "ErrorQty": 0.0 } ] } }
getProductionOrderStatus
- Request contract:
MGCLatticeStatusQueryRequestContract-DocumentId= ProdId.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "DocumentId": "P000001" } }
Dependency: production order P000001. Each status operation runs the standard update, and the production control parameters decide whether it is allowed from the order's current status (InvalidStatus otherwise); release, start and report as finished run the earlier updates the order has not had yet themselves. Only endProductionOrder requires a status: Reported as finished (InvalidStatus otherwise). Pick/route lines reference real BOM items/operations.
GENERAL LEDGER
MGCLatticeGeneralLedgerJournalService
Group: MGCLatticeGeneralLedgerServiceGroup
A line names its accounts one of two ways: MainAccountId / OffsetMainAccountId (main accounts), or AccountType + AccountNum and OffsetAccountType + OffsetAccountNum (types sent as integers: 0 Ledger, 1 Customer, 2 Vendor, 6 Bank). Both styles on one line = ValidationFailed. An empty (null) line, a main-account line without CurrencyCode and a typed line without AccountNum are refused with ValidationFailed; postGeneralJournal also refuses a line with OffsetCompany (use postIntercompanyJournal). A journal of main-account lines posts in one voucher. A customer, vendor or bank line is filled the way the journal page fills it (currency, terms of payment, method of payment, sales tax group, the AR / AP parameters' posting profile, due date from the terms when the line has an InvoiceId); the values the line sends win. A typed line with an offset account is a voucher of its own; all other lines share one voucher. Unless the GL parameter Allow multiple transactions within one voucher is on, a voucher may hold only one customer or vendor transaction and one bank transaction: a request that breaks this is refused with BusinessRule before anything is created (not checked for a journal name that allocates vouchers at posting), so a bank-to-bank transfer is two bank lines against an interim main account. Success: DocumentId = PostedDocumentId = the journal number; the journal carries the request's Description. The lines carry transaction type General journal (as the general journal page sets them), so the posted journal can be reversed with reverseJournal or the standard Reverse. Both post ops support PreviewMode (validation only, including the accounts and setup records the lines name: nothing is created or posted). The call log and idempotency log record the operation as postGeneralJournal / postIntercompanyJournal.
Line contract: MGCLatticeGeneralJournalLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
MainAccountId | str | required unless the line uses AccountType / AccountNum | 110110 | Account display string. |
OffsetMainAccountId | str | optional | 200110 | Offset (or use balanced line pairs). |
AccountType | int (LedgerJournalACType) | optional | 1 | 0 Ledger (default), 1 Customer, 2 Vendor, 6 Bank; any other value = ValidationFailed. Not with MainAccountId. |
AccountNum | str | with AccountType | US-001 | Main account, customer, vendor or bank account id. Unknown customer / vendor / bank = ValidationFailed; unknown main account = DimensionValueNotFound. |
AccountNumExternalKey | MGCLatticeExternalKey (str) | optional | CRM-C-1001 | Customer or vendor key in the header's ExternalSystem, in place of AccountNum; on a main account or bank account = ValidationFailed. |
OffsetAccountType | int (LedgerJournalACType) | optional | 0 | Same values. Not with OffsetMainAccountId. |
OffsetAccountNum | str | with an offset type other than 0 | 401100 | Empty = the line balances against the other lines of its voucher. On an intercompany line, an account in OffsetCompany. |
OffsetAccountNumExternalKey | MGCLatticeExternalKey (str) | optional | Offset customer or vendor key (resolved in OffsetCompany when sent). | |
AmountCurDebit | real | one of debit/credit | 1000.00 | |
AmountCurCredit | real | one of debit/credit | 0.00 | |
CurrencyCode | CurrencyCode (str) | required on a main-account line | USD | A customer, vendor or bank line takes the account's currency. |
Description | str | optional | Line 1 | |
TransDate | TransDate | optional | 2026-05-19 | |
Dimensions | List of MGCLatticeDimensionValueContract | optional | see below | Financial dimensions: merged into the main account of a ledger line, into the default dimensions of a customer, vendor or bank line. |
OffsetCompany | str | optional | USRT | Intercompany only - offset legal entity; refused by postGeneralJournal. |
InvoiceId | InvoiceId (str) | optional | INV-10045 | A customer or vendor line posts the invoice under it; the due date is calculated only when it is sent. |
DocumentNumber | DocumentNum (str) | optional | DOC-778 | |
DocumentDate | DocumentDate | optional | 2026-05-19 | A vendor invoice line's due date is calculated from it. |
DueDate | DueDate | optional | 2026-06-18 | Customer or vendor line only (else ValidationFailed). Default: from the terms of payment. |
PaymentTermsId | PaymTermId (str) | optional | Net30 | Customer or vendor line only. Default: the account's terms. |
PostingProfile | PostingProfile (str) | optional | GEN | Customer or vendor line only. Default: the AR / AP parameters' posting profile. |
SalesTaxGroup | TaxGroup (str) | optional | CA | Default: the customer's or vendor's, or the main account's. |
ItemSalesTaxGroup | TaxItemGroup (str) | optional | ALL | Default: the ledger account's or the default item sales tax group (customer / vendor line: only with an invoice number). |
MethodOfPayment | str | optional | CHECK | Customer or vendor line only. Default: the account's method of payment. |
PaymentReference | PaymReference (str) | optional | REF-1 | |
BankTransactionType | BankTransactionType (str) | optional | 05 | Line with a bank account only (else ValidationFailed). |
Unknown terms of payment, posting profile, method of payment, sales tax group, item sales tax group or bank transaction type = ValidationFailed (terms of payment, posting profile and method of payment are looked up in the company of the line's customer or vendor). An external key that does not resolve, or a key without ExternalSystem = ValidationFailed.
MGCLatticeDimensionValueContract: DimensionName (str, e.g. Department), DimensionValue (str, e.g. 024).
postGeneralJournal / postGeneralJournalBatch
- Request contract:
MGCLatticeGeneralJournalPostRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | LedgerJournalNameId (str) | required | GenJrn | |
Description | Description (str) | optional | General journal test | |
PostingDate | TransDate | optional | 2026-05-19 | |
ExternalSystem | MGCLatticeExternalSystemId (str) | when a line sends a key | CRM | The external system of the lines' AccountNumExternalKey / OffsetAccountNumExternalKey. |
PreviewMode | boolean | optional | false | true validates the request without creating or posting anything. |
Lines | List of MGCLatticeGeneralJournalLineContract | required (≥1, balanced) | see above |
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "GenJrn", "Description": "General journal test", "PostingDate": "2026-05-19",
"Lines": [
{ "MainAccountId": "110110", "AmountCurDebit": 1000.00, "AmountCurCredit": 0.00, "CurrencyCode": "USD",
"Description": "Debit line",
"Dimensions": [ { "DimensionName": "Department", "DimensionValue": "024" } ] },
{ "MainAccountId": "200110", "AmountCurDebit": 0.00, "AmountCurCredit": 1000.00, "CurrencyCode": "USD",
"Description": "Credit line" }
]
} }
Customer invoice (defaults from US-001) and a vendor adjustment, each a voucher of its own:
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "GenJrn", "Description": "Customer invoice and vendor adjustment", "PostingDate": "2026-05-19",
"Lines": [
{ "AccountType": 1, "AccountNum": "US-001", "OffsetAccountType": 0, "OffsetAccountNum": "401100",
"InvoiceId": "INV-10045", "AmountCurDebit": 1250.00, "Description": "Consulting" },
{ "AccountType": 2, "AccountNum": "US-101", "OffsetAccountType": 0, "OffsetAccountNum": "601500",
"InvoiceId": "ADJ-2026-07", "AmountCurCredit": 300.00, "Description": "Vendor adjustment" }
]
} }
Bank-to-bank transfer (two bank lines through the interim account 110180, bank transaction type 05):
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "GenJrn", "Description": "Bank transfer", "PostingDate": "2026-05-19",
"Lines": [
{ "AccountType": 6, "AccountNum": "USMF OPER", "OffsetAccountType": 0, "OffsetAccountNum": "110180",
"AmountCurCredit": 5000.00, "BankTransactionType": "05" },
{ "AccountType": 6, "AccountNum": "USMF PAYRL", "OffsetAccountType": 0, "OffsetAccountNum": "110180",
"AmountCurDebit": 5000.00, "BankTransactionType": "05" }
]
} }
Refusals (both post ops): the line checks above = ValidationFailed; two customer or vendor transactions, or two bank transactions, in one voucher while the GL parameter is off (for example a single bank-to-bank line) = BusinessRule, before anything is created; a main account, offset main account or dimension value that does not resolve = DimensionValueNotFound; a posting the standard refuses = BusinessRule (the journal is deleted again).
postIntercompanyJournal / postIntercompanyJournalBatch
- Request contract:
MGCLatticeGeneralJournalPostRequestContract(same), but useOffsetCompanyon at least one line. The offset account (main account, or withOffsetAccountTypea customer, vendor or bank account) is in that legal entity, which must exist (ValidationFailed) and have intercompany accounting set up with the request's legal entity. JournalNameIdsample:IntJrn.
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "IntJrn", "Description": "Intercompany journal test", "PostingDate": "2026-05-19",
"Lines": [ { "MainAccountId": "110110", "AmountCurDebit": 1000.00, "AmountCurCredit": 0.00,
"CurrencyCode": "USD", "OffsetMainAccountId": "200110", "OffsetCompany": "USRT" } ]
} }
An expense in USMF against a vendor of USSI:
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "IntJrn", "Description": "Intercompany vendor expense", "PostingDate": "2026-05-19",
"Lines": [ { "AccountType": 0, "AccountNum": "601500", "CurrencyCode": "USD", "AmountCurDebit": 400.00,
"OffsetAccountType": 2, "OffsetAccountNum": "US_SI_000006", "OffsetCompany": "USSI", "InvoiceId": "IC-2026-031" } ]
} }
reverseJournal / reverseJournalBatch
- Request contract:
MGCLatticeJournalReversalRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNum | LedgerJournalId (str) | one of JournalNum / JournalNumExternalKey / Voucher | 00001 | The posted ledger journal (JournalNum, not the journal name). Or JournalNumExternalKey + ExternalSystem. |
Voucher | Voucher (str) | optional | GNJL000001 | One voucher of the journal; alone, it names the journal that contains it (in several journals = ValidationFailed: send JournalNum). Empty = every voucher of the journal. |
ReversalDate | TransDate | optional | 2026-05-19 | Default today; not before a voucher's date (ValidationFailed). |
ReasonCode | ReasonCode (str) | when the AR parameters demand one | ERROR | Must exist (ReasonTable). Required for customer vouchers when Reason code required for transaction reversal is set, and for customer bank payments when it is set for payment cancellation. |
ReasonComment | ReasonComment (str) | optional | Posted twice | |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
Each voucher is reversed by the standard engine the posted journal's Reverse chooses: general ledger only, posted with transaction type General journal, Allocation or Elimination → TransactionReversal_Ledger; a customer or vendor transaction not posted to a bank account → TransactionReversal_Cust / TransactionReversal_Vend; a customer payment posted to a bank account → payment cancellation (BankPaymCancel, which reverses its settlements). Every voucher is checked first, and all are reversed in one transaction (all or none).
Response: DocumentId = the reversed journal; PostedDocumentId = the reversal voucher of the journal's first voucher; the message lists every voucher > reversal voucher; the engines' messages are in InformationalMessages.
Refusals: no journal or voucher, unknown reason code, a reversal date before a voucher's date, a voucher in several journals, a required reason missing = ValidationFailed; unknown journal, a voucher in no journal or not in the named journal = DocumentNotFound; journal not posted, a voucher already reversed (or its reversal revoked) or a customer payment already canceled = InvalidStatus; a voucher not in the general ledger, a voucher no standard reversal covers (any other bank voucher, fixed asset or project transactions: Voucher %1 of journal %2 cannot be reversed by the standard journal reversal. It reverses general journal, allocation and elimination vouchers, customer and vendor transactions, and customer payments posted to a bank account; bank, fixed asset and project transactions are reversed in their own module.), a voucher with several customer payments posted to a bank account, a ledger transaction the standard reversal cannot reverse (posting type, journalized entry, closed year, intercompany account), a settled customer or vendor transaction, a posted journal without vouchers, or a refusal of the standard engine = BusinessRule; the reversal voucher / trace number sequence (or the customer closing voucher sequence for a payment cancellation) not set up = ConfigurationMissing.
Security: high-risk privilege MGCLatticeGeneralLedgerJournalReverseMaintain (in MGCLatticeIntegrationServiceHighRiskDuty); not granted by MGCLatticeGeneralLedgerServiceMaintain. reverseJournal (not the batch op) can be queued with submitAsyncOperation (ServiceName MGCLatticeGeneralLedgerJournalService, OperationName reverseJournal).
Mandatory minimum: envelope + JournalNum (or Voucher).
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNum": "00001", "ReversalDate": "2026-05-19", "ReasonCode": "ERROR", "ReasonComment": "Posted twice" } }
Dependency: a posted general journal (for example from postGeneralJournal); the general ledger parameters' number sequences Reversal voucher and Trace number; reason code ERROR (enabled for ledger, customer, vendor and bank in USMF).
getJournalStatus
- Request contract:
MGCLatticeStatusQueryRequestContract-DocumentId= the ledgerJournalNum(e.g.00001), not the journal name.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "DocumentId": "00001" } }
Dependency: journal names GenJrn/IntJrn; main accounts 110110/200110; dimension Department/024; intercompany company USRT must be configured for IC.
MGCLatticePaymentJournalService
Group: MGCLatticeGeneralLedgerServiceGroup
Line contract: MGCLatticePaymentJournalLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
AccountNum | str | required | US-001 (cust) / US-101 (vend) | Cust/vend account depending on op. |
AmountCurDebit | real | one of debit/credit | 0.00 | |
AmountCurCredit | real | one of debit/credit | 1000.00 | |
CurrencyCode | CurrencyCode (str) | optional | USD | Defaults to the customer's or vendor's currency. |
BankAccountId | CompanyBankAccountId (str) | optional | USMF OPER | The bank account the payment is made from or received into (the line's offset, type Bank); must be an existing bank account. Empty uses the journal name's offset account. |
MethodOfPayment | str | optional | CHECK | |
InvoiceId | InvoiceId (str) | optional | CIV-000001 | Customer payments only: the invoice the payment pays, so settleCustomerTransactions can find the payment by PaymentInvoiceId. Refused on vendor payment lines. |
Description | str | optional | Payment | |
TransDate | TransDate | optional | 2026-05-19 | |
IsPrepayment | boolean | optional | false | true = the line is a prepayment (the payment journal's Prepayment journal voucher). |
SalesOrderId | SalesId (str) | optional | SO-000001 | Customer lines only: the sales order the payment is marked against. Or SalesOrderIdExternalKey + header ExternalSystem. On a vendor line = ValidationFailed. |
PurchaseOrderId | PurchId (str) | optional | PO-000001 | Vendor lines only: the purchase order the payment is marked against. Or PurchaseOrderIdExternalKey + header ExternalSystem. On a customer line = ValidationFailed. |
Prepayments and order marking (both payment ops). Every payment line is approved by the calling user when it is created, as the payment journal page does. A line with IsPrepayment: true posts with the prepayment posting profile of the AR / AP parameters ("Posting profile with prepayment journal voucher"; USMF PRE); without one the default posting profile is used and Warnings says so. When the parameters calculate sales tax on prepayments, the journal is created with Amounts include sales tax and the line takes the account's sales tax group and the default item sales tax group, as the payment journal does. A line with an order (prepayment or not) is checked before the journal is created: the order must exist and be invoiced to the line's account (ValidationFailed otherwise) and be neither invoiced nor canceled (InvalidStatus). After posting, the payment is marked against the order as the order's Settle transactions does (Marked transactions), so the order's invoice settles it; InformationalMessages names the order, and a payment that could not be marked is a warning (the payment is posted).
postCustomerPaymentJournal / postCustomerPaymentJournalBatch
- Request contract:
MGCLatticePaymentJournalPostRequestContract;JournalNameId=CustPay; lineAccountNum= customer. - Request checks (both payment ops): an empty line, an
AccountNumthat is not an existing customer (customer op) / vendor (vendor op), aBankAccountIdthat is not an existing bank account, or anInvoiceIdon a vendor line isValidationFailed, before the journal is created.PreviewMode= true is refused withPreviewUnsupported. Success:DocumentId=PostedDocumentId= the journal number; the journal carries the request'sDescription.
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | LedgerJournalNameId (str) | required | CustPay | |
Description | Description (str) | optional | Customer payment journal test | |
PostingDate | TransDate | optional | 2026-05-19 | |
GeneratePayments | boolean | optional | false | Vendor payments only (true on postCustomerPaymentJournal = ValidationFailed): generate the checks of the lines that need them before posting; see postVendorPaymentJournal. Default false. |
Lines | List of MGCLatticePaymentJournalLineContract | required (≥1) | see above |
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "CustPay", "Description": "Customer payment journal test", "PostingDate": "2026-05-19",
"Lines": [ { "AccountNum": "US-001", "AmountCurDebit": 0.00, "AmountCurCredit": 1000.00,
"CurrencyCode": "USD", "BankAccountId": "USMF OPER", "MethodOfPayment": "CHECK" } ]
} }
Customer deposit (prepayment) marked against a sales order:
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "CustPay", "Description": "Customer deposit", "PostingDate": "2026-05-19",
"Lines": [ { "AccountNum": "US-001", "AmountCurCredit": 500.00, "CurrencyCode": "USD",
"BankAccountId": "USMF OPER", "IsPrepayment": true, "SalesOrderId": "SO-000001" } ] } }
postVendorPaymentJournal / postVendorPaymentJournalBatch
- Same contract;
JournalNameId=VendPay; lineAccountNum=US-101.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "VendPay", "Description": "Vendor payment journal test", "PostingDate": "2026-05-19",
"Lines": [ { "AccountNum": "US-101", "AmountCurDebit": 1000.00, "AmountCurCredit": 0.00, "CurrencyCode": "USD", "BankAccountId": "USMF OPER", "MethodOfPayment": "ELECTRONIC" } ] } }
GeneratePayments. Without it, a line whose method of payment needs Generate payments (USMF CHECK: payment type Check) fails at posting with the standard "Check number must be filled in" (BusinessRule) and the journal is deleted. With "GeneratePayments": true, those lines get their checks first, drawn on the line's BankAccountId with the next numbers of its check layout (the same engine as generateVendorPayments); generation and posting are one transaction. The message lists the check numbers; DocumentId = PostedDocumentId = the journal. Refused before anything is created: a line that needs generation without BankAccountId, or whose method exports a payment file or uses Electronic reporting = ValidationFailed; a method without export format, a bank account without check layout or without created checks left (fixed numbering) = ConfigurationMissing.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "VendPay", "Description": "Vendor check payment", "GeneratePayments": true,
"Lines": [ { "AccountNum": "US-101", "AmountCurDebit": 1000.00, "CurrencyCode": "USD", "BankAccountId": "USMF OPER", "MethodOfPayment": "CHECK" } ] } }
settleCustomerTransactions / settleCustomerTransactionsBatch
- Request contract:
MGCLatticeSettlementRequestContract - Line contract:
MGCLatticeSettlementLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
AccountNum | str | required | US-001 | Customer account. |
PaymentTransRecId | int64 | one of the three | 5637144576 | RecId of the payment CustTrans; it must be a payment of AccountNum (otherwise DocumentNotFound). Wins over the natural keys. |
PaymentVoucher | Voucher (str) | one of the three | PAYM-000001 | Natural key - the voucher of the posted payment; used when PaymentTransRecId is not sent. The way to identify a vendor payment. |
PaymentInvoiceId | str | one of the three | CIV-000001 | Natural key - the invoice number the payment carries (a customer payment posted with a line InvoiceId); used when neither PaymentTransRecId nor PaymentVoucher is sent. |
Lines | List of MGCLatticeSettlementLineContract | required (≥1) | see below |
Settlement line: InvoiceTransRecId (int64, 5637144577) or InvoiceId (str, CIV-000001) - natural-key invoice id of the posted cust/vend transaction; resolves the RecId server-side, RecId wins if both sent. Either way the line must name a transaction of AccountNum that is not a payment (otherwise DocumentNotFound). Plus SettleAmountCur (real, 500.00; 0 = the whole open balance).
Response: DocumentId = the voucher of the settled payment; a settlement produces no document of its own, so PostedDocumentId is empty. PreviewMode = true is refused with PreviewUnsupported.
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"AccountNum": "US-001", "PaymentVoucher": "PAYM-000001",
"Lines": [ { "InvoiceTransRecId": 5637144577, "InvoiceId": "CIV-000001", "SettleAmountCur": 500.00 } ]
} }
Natural key: request-level
PaymentVoucher/PaymentInvoiceIdand per-lineInvoiceIdlet the service resolve the payment/invoiceCustTrans/VendTransRecIds from their document ids; the matching RecId remains a fallback and wins if both are provided.
settleVendorTransactions / settleVendorTransactionsBatch
- Same contract;
AccountNum=US-101; RecIds referenceVendTrans; natural keysPaymentVoucher(payment voucher) + lineInvoiceId(vendor invoice id).
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"AccountNum": "US-101", "PaymentVoucher": "PAYM-000002",
"Lines": [ { "InvoiceTransRecId": 5637144579, "InvoiceId": "VIV-000001", "SettleAmountCur": 750.00 } ] } }
Dependency: PaymentTransRecId / InvoiceTransRecId are RecId-only inputs (CustTrans/VendTrans RecIds) - not creatable/discoverable via OData; obtain from posted transactions in USMF, or supply the natural keys (PaymentVoucher / PaymentInvoiceId / line InvoiceId) and let the service resolve them. Journal names CustPay/VendPay, method CHECK, bank account USMF OPER must exist.
reverseCustomerPayment / reverseVendorPayment (+ Batch)
- Shared request contract:
MGCLatticePaymentReversalRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
AccountNum | CustVendAC (str) | required | US-001 (cust) / US-101 (vend) | Customer (reverseCustomerPayment) or vendor (reverseVendorPayment). Or AccountNumExternalKey + ExternalSystem. Unknown = ValidationFailed. |
Voucher | Voucher (str) | required | PAYM-000001 | The payment voucher (a Payment-type transaction of the account); none on the account = DocumentNotFound. |
ReversalDate | TransDate | optional | 2026-05-19 | Default today; not before the payment date. |
ReasonCode | ReasonCode (str) | when the parameters demand one | ERROR | Must exist. Required when AR "Reason code required" is set for transaction reversal or payment cancellation, or Cash and bank "Require reason for payment reversal" for checks. |
ReasonComment | ReasonComment (str) | optional | Wrong customer | |
ReversalJournalNameId | LedgerJournalNameId (str) | optional | CheckRev | Check reversal under review only: a journal name of type Check reversal. Empty = the legal entity's only one (none = ConfigurationMissing; several = ValidationFailed). Unknown or another type = ValidationFailed. |
PostReversalJournal | boolean | optional | false | Check reversal under review only: true posts the check reversal journal in the same request. Default false (left for review). |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
The standard reversal that covers the payment is used: a payment made by check → check reversal (BankChequeCancel, the Checks page's Payment reversal); when the cash and bank parameters require check reversals to be reviewed ("Use review process for payment reversals"; USMF has it on), it creates a check reversal journal with the canceling line and the check becomes Pending cancellation, and the journal is left for review or, with PostReversalJournal, posted in the same request (which reverses the payment and its settlements and cancels the check); a customer payment posted to a bank account, not by check → payment cancellation (BankPaymCancel, which reopens the invoices it paid); a vendor payment posted to a bank account, not by check → refused (BusinessRule); a payment not posted to a bank account → transaction reversal (TransactionReversal_Cust / _Vend), a settled one refused (BusinessRule: unsettle first). One transaction.
Response: DocumentId = the reversed payment voucher; PostedDocumentId = the voucher of the cancellation or reversal, or the check reversal journal when it is left for review.
Refusals: no account or voucher, unknown customer / vendor / reason code, reversal date before the payment date, a required reason missing, a ReversalJournalNameId that is unknown or not a check reversal journal name, several check reversal journal names and none requested = ValidationFailed; no payment with that voucher on the account = DocumentNotFound; payment already canceled or reversed, check already reversed or pending reversal (a check reversal journal exists), check not in status Payment = InvalidStatus; the BusinessRule cases above, a customer bank payment that cannot be canceled (post-dated check, letter of credit), or a refusal of the standard engine = BusinessRule; the reversal number sequence (ledger reversal voucher / trace number, or the customer / vendor closing voucher) not set up, or for a check reversal under review no check reversal journal name, a journal name without voucher series, or no GL journal number sequence = ConfigurationMissing.
Security: high-risk privilege MGCLatticePaymentReverseMaintain (in MGCLatticeIntegrationServiceHighRiskDuty); not granted by MGCLatticeGeneralLedgerServiceMaintain.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"AccountNum": "US-001", "Voucher": "PAYM-000001", "ReversalDate": "2026-05-19", "ReasonCode": "ERROR" } }
(Same body for reverseVendorPayment, with a vendor account; only the operationName in the URL differs.) A vendor check reversed through a posted check reversal journal:
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"AccountNum": "US-101", "Voucher": "PAYM-000002", "ReversalDate": "2026-05-19",
"ReversalJournalNameId": "CheckRev", "PostReversalJournal": true } }
Dependency: a posted customer payment, for example from postCustomerPaymentJournal with a BankAccountId (canceled with BankPaymCancel); for a vendor payment, one posted without a bank account or by check (for example postVendorPaymentJournal with GeneratePayments); for a check under review, check reversal journal name CheckRev.
MGCLatticeBudgetRegisterService
Group: MGCLatticeGeneralLedgerServiceGroup
Line contract: MGCLatticeBudgetEntryLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
MainAccountId | str | required | 600110 | Budget account. |
Amount | real | required | 10000.00 | Not zero (ValidationFailed). |
CurrencyCode | CurrencyCode (str) | optional | USD | Defaults to the accounting currency. |
TransDate | TransDate | optional | 2026-05-19 | Budget line date; defaults to PostingDate. |
Comment | str | optional | Q2 budget allocation |
postBudgetEntry / postBudgetEntryBatch
- Request contract:
MGCLatticeBudgetEntryPostRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
BudgetTransactionCode | str | required | Original budget | Budget transaction (reason) code. |
BudgetModelId | str | required | FY2026 | Budget model. |
PostingDate | TransDate | optional | 2026-05-19 | Date of the entry; defaults to today in the user's time zone. |
Lines | List of MGCLatticeBudgetEntryLineContract | required (≥1) | see above |
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"BudgetTransactionCode": "Original budget", "BudgetModelId": "FY2026", "PostingDate": "2026-05-19",
"Lines": [ { "MainAccountId": "600110", "Amount": 10000.00, "CurrencyCode": "USD",
"TransDate": "2026-05-19", "Comment": "Q2 budget allocation" } ]
} }
postBudgetTransfer / postBudgetTransferBatch
- Request contract:
MGCLatticeBudgetEntryPostRequestContract(same). Use a Transfer-typeBudgetTransactionCode(USMFExpTransfer) and two offsetting lines (from/to accounts).
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"BudgetTransactionCode": "ExpTransfer", "BudgetModelId": "FY2026", "PostingDate": "2026-05-19",
"Lines": [
{ "MainAccountId": "600110", "Amount": -2000.00, "CurrencyCode": "USD", "Comment": "Transfer from operating" },
{ "MainAccountId": "600120", "Amount": 2000.00, "CurrencyCode": "USD", "Comment": "Transfer to capital" }
]
} }
Behavior: the entry is created as a draft and posted through the standard budget register post (budget balances, budget control, and ledger posting when the budget code requires it). Every line needs a MainAccountId that resolves (otherwise DimensionValueNotFound); postBudgetEntry needs an Original budget code and postBudgetTransfer a Transfer code (otherwise ValidationFailed); transfer lines must net to zero. Success only when the entry is Completed; DocumentId = PostedDocumentId = the entry number (BudgetTransactionHeader.TransactionNumber). If the post fails, the draft entry the request created is deleted (its number is released), so a retry creates a new entry. PreviewMode = true is refused with PreviewUnsupported.
Dependency: budget model FY2026, transaction codes Original budget/ExpTransfer, budget-enabled main accounts must exist in USMF.
MGCLatticeCurrencyRevaluationService
Group: MGCLatticeGeneralLedgerServiceGroup. All three ops share MGCLatticeCurrencyRevaluationRequestContract.
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
RevaluationDate | TransDate | optional | 2026-05-19 | As-of revaluation date; defaults to today. |
FromDate | TransDate | ledger only | 2026-01-01 | Ledger reval only (refused by the customer and vendor ops): range start; defaults to the start of the fiscal year of RevaluationDate (both dates must be in one fiscal year). |
CurrencyCode | str | optional | EUR | Limit to one currency; empty = all (ledger: every currency posted in the period). |
MainAccountFromId | str | ledger only | 110110 | Account range start (ledger reval; refused by the customer and vendor ops). |
MainAccountToId | str | ledger only | 900000 | Account range end (ledger reval; refused by the customer and vendor ops). |
Ledger reval: settings the standard revaluation rejects fail with ValidationFailed; a period with no ledger transactions succeeds with a "nothing to revalue" message and posts nothing.
Response (all three): when the run posted exchange adjustments, DocumentId = PostedDocumentId = the adjustment voucher and the message names it (customer/vendor: with the number of adjusted transactions); when nothing needed an adjustment both are empty and the message says nothing was posted. PreviewMode = true is refused with PreviewUnsupported.
runCustomerRevaluation / runCustomerRevaluationBatch
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"RevaluationDate": "2026-05-19", "CurrencyCode": "EUR" } }
runVendorRevaluation / runVendorRevaluationBatch
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"RevaluationDate": "2026-05-19", "CurrencyCode": "EUR" } }
runLedgerRevaluation / runLedgerRevaluationBatch
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"RevaluationDate": "2026-05-19", "FromDate": "2026-01-01", "CurrencyCode": "EUR",
"MainAccountFromId": "110110", "MainAccountToId": "900000" } }
Dependency: open foreign-currency (e.g. EUR) cust/vend/ledger balances in USMF for the revaluation to produce entries.
JOURNAL POSTING
MGCLatticeJournalPostingService
Group: MGCLatticeJournalPostingServiceGroup. Posts a journal that already exists in the legal entity (entered on its page, imported, or created through the standard journal entities) with the standard posting the journal page's Post runs; it posts completely or not at all and is never deleted. All five ops refuse PreviewMode = true with PreviewUnsupported, and all five (not the batch ops) can be queued with submitAsyncOperation.
Operation (+ ...Batch) | Request contract | Journal member | Journals |
|---|---|---|---|
postLedgerJournal | MGCLatticeLedgerJournalPostingRequestContract | JournalNum (LedgerJournalId) or JournalNumExternalKey + ExternalSystem | General, customer payment, vendor payment, invoice register, vendor invoice, invoice approval, project expense (Cost) and fixed asset journals |
postInventoryJournal | MGCLatticeJournalPostingRequestContract | JournalId (JournalId) | Movement, profit/loss, counting, transfer, BOM, tag counting, ownership change, project item and fixed asset inventory journals |
postProjectJournal | MGCLatticeJournalPostingRequestContract | JournalId (JournalId) | Project hour and fee journals |
postProductionJournal | MGCLatticeJournalPostingRequestContract | JournalId (JournalId) | Picking list, route card, job card and report as finished journals |
postTradeAgreementJournal | MGCLatticeTradeAgreementJournalPostingRequestContract | JournalNum (PriceDiscJournalNum) | Trade agreement journals (sales and purchase prices and discounts) |
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNum | LedgerJournalId / PriceDiscJournalNum (str) | required (postLedgerJournal, postTradeAgreementJournal) | 00512 | The journal number (journal batch number). On postLedgerJournal, or JournalNumExternalKey + ExternalSystem. |
JournalId | JournalId (str) | required (postInventoryJournal, postProjectJournal, postProductionJournal) | 00087 | The journal number. |
PreviewMode | boolean | optional | false | No preview: true is refused with PreviewUnsupported. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "JournalNum": "<LedgerJournalHeaders.JournalBatchNumber>" } }
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "JournalId": "<InventoryMovementJournalHeaders.JournalNumber>" } }
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "JournalNum": "<TradeAgreementJournalHeaders.JournalNumber>" } }
Response: DocumentId = the journal; PostedDocumentId = the first voucher (in voucher order) for a ledger journal, the journal for the others. The ledger message counts the vouchers and lists the first 25; a tag counting journal's message names the counting journal its posting created (left open for review).
Delegated rights. Besides MGCLatticeJournalPostingMaintain, the caller must hold every Lattice operation that would post the journal's content, or the request is AccessDenied naming all the missing operations. By journal type: general journal → postGeneralJournal; customer / vendor payment journal → postCustomerPaymentJournal / postVendorPaymentJournal; invoice register and vendor invoice journal → postInvoiceRegisterJournal; invoice approval journal → postInvoiceApprovalJournal; project expense journal → postExpenseJournal; inventory movement / profit-loss / counting / transfer / BOM / tag counting / ownership change → the matching MGCLatticeInventoryJournalPostingService op; project item journal → postItemJournal; fixed asset inventory journal → postAcquisition; project hour / fee → postHourJournal / postFeeJournal; picking list → postPickList, route card and job card → postRouteCard, report as finished → reportAsFinished; trade agreement journal → MGCLatticeSalesTradeAgreementService.setSalesPrice. In a ledger journal, also by line: an intercompany line → postIntercompanyJournal; a fixed asset line (every line of a fixed asset journal, which has no type operation of its own) → postAcquisition (Acquisition), postDisposal (Disposal - sale / scrap) or postAssetTransaction (any other type); a project line → postExpenseJournal. Customer, vendor and bank lines are covered by postGeneralJournal.
Refusals: no journal named, an unresolvable key, a journal type no Lattice op posts (allocation, elimination, periodic, budget, project beginning balance, ...; the message lists the supported types), a journal without lines = ValidationFailed; unknown journal = DocumentNotFound; missing delegated rights = AccessDenied; already posted, locked by the system or another user or a user group, private to another user, in use, in a workflow approval not yet approved, needing journal-name approval, or a project journal approval status not ready for posting = InvalidStatus; a refusal of the standard posting (also a ledger journal above the line limit posted outside batch: queue it async) = BusinessRule.
Security: MGCLatticeJournalPostingMaintain (in MGCLatticeIntegrationServiceOperationsDuty) plus the delegated rights above.
Dependency: an open journal of a supported type in USMF, for example GenJrn (general journal), IMov (movement), Hour (project hour), Pick (picking list of a started production order) or S_Price (sales price trade agreement journal), created through LedgerJournalHeaders + LedgerJournalLines, InventoryMovementJournalHeaders + InventoryMovementJournalEntriesV2, JournalTables + JournalTrans, ProductionPickingListJournalEntries, or TradeAgreementJournalHeaders + OpenSalesPriceJournalLines.
FIXED ASSETS
MGCLatticeFixedAssetService
Group: MGCLatticeFixedAssetsServiceGroup
postAcquisition / postAcquisitionBatch
An empty (null) line is refused with ValidationFailed.
- Request contract:
MGCLatticeFixedAssetAcquisitionRequestContract - Line contract:
MGCLatticeFixedAssetAcquisitionLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | LedgerJournalNameId (str) | required | FACur | Fixed-asset journal name. |
Description | Description (str) | optional | Fixed asset acquisition test | |
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticeFixedAssetAcquisitionLineContract | required (≥1) | see below |
Acquisition line: AssetId (str, COMP-000001), AssetBookId (str, 200_SLLR), AcquisitionAmount (real, 15000.00), CurrencyCode (str, USD), OffsetMainAccountId (str, 110110), Description (str). AssetId/AssetBookId/AcquisitionAmount (not zero) required; a line without AssetBookId or AcquisitionAmount is ValidationFailed before the journal is created. CurrencyCode defaults to the accounting currency. Success: DocumentId = PostedDocumentId = the journal number; the journal carries the request's Description. Each line posts to its own book only (not to the book's derived books, as a journal page line would): acquire a derived book with a line of its own. The same holds for postDisposal.
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "FACur", "Description": "Fixed asset acquisition test", "PostingDate": "2026-05-19",
"Lines": [ { "AssetId": "COMP-000001", "AssetBookId": "200_SLLR", "AcquisitionAmount": 15000.00,
"CurrencyCode": "USD", "OffsetMainAccountId": "110110" } ]
} }
runDepreciationProposal / runDepreciationProposalBatch
- Request contract:
MGCLatticeFixedAssetDepreciationRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | LedgerJournalNameId (str) | required | FACur | |
AssetBookId | str | optional | 200_SLLR | Limit to one book; empty = all books. |
DepreciationDate | TransDate | optional | 2026-05-19 |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "FACur", "AssetBookId": "200_SLLR", "DepreciationDate": "2026-05-19" } }
Behavior: runs the standard depreciation proposal into a new fixed asset journal (the journal name must be of type Fixed assets, otherwise ValidationFailed; an unknown book is DocumentNotFound); the journal is not posted. DocumentId = PostedDocumentId = the journal number; the message gives the proposed line count, or says nothing was due (the journal then has no lines).
postDisposal / postDisposalBatch
- Request contract:
MGCLatticeFixedAssetDisposalRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | LedgerJournalNameId (str) | required | FACur | |
AssetId | str | required | COMP-000001 | |
AssetBookId | str | required | 200_SLLR | |
IsSale | boolean | optional | true | true = disposal-sale, false = disposal-scrap. |
SaleAmount | real | required if IsSale | 5000.00 | |
OffsetMainAccountId | str | optional | 110110 | Offset main account for the sale proceeds; one that does not resolve fails with DimensionValueNotFound. |
CurrencyCode | CurrencyCode (str) | optional | USD | Defaults to the accounting currency. |
DisposalDate | TransDate | optional | 2026-05-19 |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "FACur", "AssetId": "COMP-000001", "AssetBookId": "200_SLLR",
"IsSale": true, "SaleAmount": 5000.00, "CurrencyCode": "USD", "DisposalDate": "2026-05-19" } }
Behavior: a request without AssetBookId is ValidationFailed; success only when the journal is posted; DocumentId = PostedDocumentId = the disposal journal number. Every FA op refuses PreviewMode = true with PreviewUnsupported.
Dependency: asset COMP-000001 with book 200_SLLR must exist (acquire before depreciate/dispose); USMF fixed asset journal name FACur.
Security: postAcquisition, runDepreciationProposal, postAssetTransaction, transferAsset, splitAsset (+ batch) = MGCLatticeFixedAssetsServiceMaintain; postDisposal (+ batch) = high-risk MGCLatticeFixedAssetsDisposalMaintain; reverseAssetTransaction (+ batch) = high-risk MGCLatticeFixedAssetsReverseMaintain (both in MGCLatticeIntegrationServiceHighRiskDuty). Async (submitAsyncOperation): runDepreciationProposal, postAcquisition, postDisposal, postAssetTransaction.
postAssetTransaction / postAssetTransactionBatch
- Request contract:
MGCLatticeFixedAssetTransactionRequestContract - Line contract:
MGCLatticeFixedAssetTransactionLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
JournalNameId | LedgerJournalNameId (str) | required | FACur | A fixed asset journal name (type Assets) with a voucher series, on the posting layer of every line's book. |
Description | Description (str) | optional | Depreciation from the asset register | |
PostingDate | TransDate | optional | 2026-05-19 | Default line date; defaults to today. |
ExternalSystem | MGCLatticeExternalSystemId (str) | with a line key | FAREG | |
Lines | List of MGCLatticeFixedAssetTransactionLineContract | required (≥1) | see below | Every line is checked before the journal is created. |
| Line field | X++ type | required? | sample | notes |
|---|---|---|---|---|
AssetId | AssetId (str) | required | COMP-000171 | Or AssetIdExternalKey. Unknown = ValidationFailed. |
AssetBookId | AssetBookId (str) | required | 200_SLLR | Must be acquired (not acquired, sold or scrapped = InvalidStatus); another posting layer than the journal name = ValidationFailed. |
TransactionType | str | required | Depreciation | AcquisitionAdj, Depreciation, DepreciationAdj, Revaluation, WriteUpAdj, WriteDownAdj, ExtraordinaryDepreciation, BonusDepreciation (not case-sensitive; a name, not an integer). Acquisition / DisposalSale / DisposalScrap / anything else = ValidationFailed (use postAcquisition / postDisposal). |
DebitAmount | AmountCurDebit (real) | one of the two | Accounting currency; increases the book's value. | |
CreditAmount | AmountCurCredit (real) | one of the two | 250.00 | Decreases the book's value (depreciation, write-down). Both, none or a negative amount = ValidationFailed. |
TransactionDate | TransDate | optional | 2026-05-19 | Defaults to PostingDate. |
OffsetMainAccountId | MainAccountNum (str) | optional | 110110 | Default: the posting profile's offset account; unresolved = DimensionValueNotFound. |
Dimensions | List of MGCLatticeDimensionValueContract | optional | Department/023 | Replace these dimensions of the book's dimensions on the line. |
ConsumptionQuantity | AssetConsumptionQty (real) | optional | Depreciation of a book that depreciates by consumption. | |
ReasonCode | ReasonCode (str) | when the FA parameters demand one | FA-IMPAIR | Unknown = ValidationFailed. |
ReasonComment | ReasonComment (str) | optional | ||
Description | LedgerJournalTransTxt (str) | optional | Defaults to the standard fixed asset text. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"JournalNameId": "FACur", "PostingDate": "2026-05-19",
"Lines": [ { "AssetId": "COMP-000001", "AssetBookId": "200_SLLR", "TransactionType": "Depreciation", "CreditAmount": 250.00 },
{ "AssetId": "COMP-000001", "AssetBookId": "200_SLLR", "TransactionType": "WriteUpAdj", "DebitAmount": 200.00 } ] } }
Behavior: creates the lines with the standard fixed asset journal line logic (asset as account, the book's posting profile offset, the book's dimensions, standard text and voucher; derived books take the transaction except a derived book that is not acquired) and posts the journal; a journal that does not post is deleted. DocumentId = the journal; PostedDocumentId = the voucher of its first line; the message lists every voucher. A depreciation type on a book that does not depreciate, or a posting the standard refuses = BusinessRule; a posting profile without the account or offset account of the type for the book (for example no bonus depreciation accounts), a journal name without voucher series = ConfigurationMissing.
transferAsset / transferAssetBatch
- Request contract:
MGCLatticeFixedAssetTransferRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
AssetId | AssetId (str) | required | COMP-000001 | Or AssetIdExternalKey + ExternalSystem. Unknown = DocumentNotFound. |
AssetBookId | AssetBookId (str) | optional | 200_SLLR | The one book to transfer; empty = every open or closed book with a posting layer. |
Dimensions | List of MGCLatticeDimensionValueContract | one of Dimensions / LocationId | Department/023 | Replace these dimensions of each book's dimensions; unresolved = DimensionValueNotFound. |
LocationId | AssetLocationId (str) | one of Dimensions / LocationId | PROD | The asset's new location; unknown = ValidationFailed. |
TransferDate | TransDate | optional | 2026-05-19 | Defaults to today; outside the fiscal calendar = BusinessRule. |
Comment | TransferComment (str) | optional | Moved to production | Written to the transfer history and transactions. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"AssetId": "COMP-000001", "Dimensions": [ { "DimensionName": "Department", "DimensionValue": "023" } ], "LocationId": "PROD" } }
Behavior: the standard asset transfer (the fixed asset page's Transfer asset): per changed book a general ledger voucher moving the balance to the new dimensions, an asset transfer transaction and the transfer history; the location is set on the asset. One transaction. DocumentId = the asset; PostedDocumentId = the first book's transfer voucher (empty for a location-only move). Nothing to change = ValidationFailed; a book not open or closed = InvalidStatus; a book without transactions to move, a public sector transfer between balancing dimensions = BusinessRule; no transfer number sequence = ConfigurationMissing.
splitAsset / splitAssetBatch
- Request contract:
MGCLatticeFixedAssetSplitRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
AssetId | AssetId (str) | required | COMP-000001 | Or AssetIdExternalKey. Unknown = DocumentNotFound. |
AssetBookId | AssetBookId (str) | required | 200_SLLR | Must be acquired (else InvalidStatus). |
ToAssetId | AssetId (str) | optional | Existing receiving asset (or ToAssetIdExternalKey); empty = a new asset copied from the asset (needs automatic numbering in its group, else ConfigurationMissing). The asset itself = ValidationFailed. | |
ToAssetBookId | AssetBookId (str) | optional | Defaults to AssetBookId. | |
Percent | Percent (real) | one of Percent / Quantity | Greater than 0, at most 100; moves values only. | |
Quantity | AssetQuantity (real) | one of Percent / Quantity | 4 | At most the asset's quantity; moves the quantity too. |
SplitDate | TransDate | optional | 2026-05-19 | Defaults to today. |
JournalNameId | LedgerJournalNameId (str) | required | FACur | Fixed asset journal name on the books' posting layer. |
ExternalSystem | MGCLatticeExternalSystemId (str) | with a key |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"AssetId": "COMP-000001", "AssetBookId": "200_SLLR", "Quantity": 4, "JournalNameId": "FACur" } }
Behavior: the standard asset split (the book's Split asset) and the posting of its split journal, in one transaction (nothing is kept when the journal does not post). DocumentId = the asset split; PostedDocumentId = the receiving asset (new or existing); the message names the split journal. Refusals per the table, plus a split or posting the standard refuses = BusinessRule.
reverseAssetTransaction / reverseAssetTransactionBatch
- Request contract:
MGCLatticeFixedAssetReversalRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
AssetId | AssetId (str) | required | COMP-000001 | Or AssetIdExternalKey + ExternalSystem. Unknown = ValidationFailed. |
AssetBookId | AssetBookId (str) | required | 200_SLLR | |
Voucher | Voucher (str) | required | <LatticeFixedAssetTransactions.Voucher> | No transaction of the book with it = DocumentNotFound. |
TransactionDate | TransDate | optional | Only when the voucher has transactions of the book on several dates (else ValidationFailed). | |
ReversalDate | TransDate | optional | 2026-05-19 | Defaults to today; not before the transaction (ValidationFailed). |
ReasonCode | ReasonCode (str) | optional | ERROR | Unknown = ValidationFailed. |
ReasonComment | ReasonComment (str) | optional |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"AssetId": "COMP-000001", "AssetBookId": "200_SLLR", "Voucher": "<LatticeFixedAssetTransactions.Voucher>", "ReasonCode": "ERROR" } }
Behavior: the standard fixed asset transaction reversal (the asset transactions page's Reverse transaction), in one transaction. DocumentId = the reversed voucher; PostedDocumentId = the reversal voucher. Already reversed, or itself a reversal = InvalidStatus; a voucher with a vendor or customer transaction (reverse it in AP / AR), a later depreciation or transfer, a negative net book value, a closed period = BusinessRule; no reversal voucher or trace number sequence = ConfigurationMissing. High-risk (MGCLatticeFixedAssetsReverseMaintain).
PROJECT
MGCLatticeProjectJournalService
Group: MGCLatticeProjectServiceGroup. All four ops share MGCLatticeProjectJournalPostRequestContract + line MGCLatticeProjectJournalLineContract. The JournalNameId and which line fields matter vary by journal type - and so does the journal table: hour and fee journals are project journals (ProjJournalName of type Hour / Revenue), an expense journal is a ledger journal of type Cost (USMF PrjJrn) and an item journal is an inventory journal of type Project (USMF ProjItem). ProjJournalType has no expense or item member, so a project journal name is never valid for those two ops; the service gates on the journal type and the line's category type (Hour / Cost / Item / Revenue).
Line contract: MGCLatticeProjectJournalLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
ProjId | ProjId (str) | optional | 000184 | Project id (InProcess). Empty = the header ProjId; the resolved project must exist (DocumentNotFound otherwise). |
CategoryId | str | required | Journeyman/Travel/ProjItem/Setup | Project category of the op's type (Hour / Cost / Item / Revenue). |
Qty | real | hour/item | 2.0 | Hours or item qty (expense: multiplies CostPrice, default 1). |
CostPrice | real | optional | 50.00 | Expense: the amount per Qty. |
SalesPrice | real | optional | 100.00 | |
CurrencyCode | CurrencyCode (str) | optional | USD | |
Description | str | optional | Consulting | |
TransDate | TransDate | optional | 2026-05-19 | |
WorkerPersonnelNumber | HcmPersonnelNumberId (str) | hour journal | 000001 | Personnel number of the worker (the line's resource); an unknown number is ValidationFailed. |
ItemId | ItemId (str) | item journal | D0001 | |
InventDimId | InventDimId (str) | item journal, optional | 000031 | Dimension the item is consumed from; empty = the item's default order settings. |
LinePropertyId | ProjLinePropertyId (str) | optional | Billable | Empty = the project line property setup default. |
OffsetMainAccountId | MainAccountNum (str) | expense journal | 110180 | Main account the expense is paid from (credit side). |
ActivityNumber | str | optional | ACT-001 | Project activity. |
Header (all four ops)
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
ProjId | ProjId (str) | optional | 000184 | Header project: the default for lines without their own ProjId. |
JournalNameId | str | required | (per type) | |
Description | Description (str) | optional | ||
PostingDate | TransDate | optional | 2026-05-19 | |
Lines | List of MGCLatticeProjectJournalLineContract | required (≥1) |
postHourJournal / postHourJournalBatch - JournalNameId = Hour (project journal, type Hour), line CategoryId = an Hour category (USMF Journeyman), WorkerPersonnelNumber set
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"ProjId": "000184", "JournalNameId": "Hour", "Description": "Hour journal test", "PostingDate": "2026-05-19",
"Lines": [ { "ProjId": "000184", "CategoryId": "Journeyman", "Qty": 2.0, "WorkerPersonnelNumber": "000007",
"CostPrice": 50.00, "SalesPrice": 100.00, "CurrencyCode": "USD" } ]
} }
postExpenseJournal / postExpenseJournalBatch - JournalNameId = a ledger journal name of type Cost (USMF PrjJrn), CategoryId = a Cost category (Travel), OffsetMainAccountId set
The line debits the project (its ledger account comes from the project group / category posting setup) and credits OffsetMainAccountId for Qty × CostPrice.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"ProjId": "000184", "JournalNameId": "PrjJrn", "Description": "Expense journal test", "PostingDate": "2026-05-19",
"Lines": [ { "ProjId": "000184", "CategoryId": "Travel", "Qty": 1.0, "CostPrice": 250.00, "SalesPrice": 250.00, "CurrencyCode": "USD", "OffsetMainAccountId": "110180" } ] } }
postItemJournal / postItemJournalBatch - JournalNameId = an inventory journal name of type Project (USMF ProjItem), CategoryId = an Item category (ProjItem), ItemId set
The line issues Qty of ItemId from InventDimId (or the item's default order settings) onto the project.
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"ProjId": "000184", "JournalNameId": "ProjItem", "Description": "Item journal test", "PostingDate": "2026-05-19",
"Lines": [ { "ProjId": "000184", "CategoryId": "ProjItem", "ItemId": "D0001", "InventDimId": "000031", "Qty": 2.0, "CostPrice": 50.00, "SalesPrice": 75.00, "CurrencyCode": "USD" } ] } }
postFeeJournal / postFeeJournalBatch - JournalNameId = Fee (project journal, type Revenue), CategoryId = a Revenue category (USMF Setup)
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"ProjId": "000184", "JournalNameId": "Fee", "Description": "Fee journal test", "PostingDate": "2026-05-19",
"Lines": [ { "ProjId": "000184", "CategoryId": "Setup", "Qty": 1.0, "SalesPrice": 500.00, "CurrencyCode": "USD" } ] } }
Behavior: success only when the journal is posted (DocumentId = PostedDocumentId = the journal number; the journal carries the request's Description); PreviewMode = true is refused with PreviewUnsupported; when the op fails after creating the journal, the unposted journal (project, ledger or inventory) is deleted, so a retry with the same RequestId creates it again.
Dependency: an InProcess project (ProjId, for example USMF 000184), journal names Hour/Fee (project journal), PrjJrn (ledger, type Cost) and ProjItem (inventory, type Project), categories Journeyman/Travel/ProjItem/Setup, worker 000001, item D0001.
MGCLatticeProjectInvoiceService
Group: MGCLatticeProjectServiceGroup
createInvoiceProposal / createInvoiceProposalBatch
- Request contract:
MGCLatticeProjectInvoiceProposalRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
ProjId | ProjId (str) | required | 000184 | Project to invoice. Only projects are looked up, not project contracts: an id that names no project (a contract id included) is DocumentNotFound. |
InvoiceDate | TransDate | optional | 2026-05-19 | |
PostAfterCreate | boolean | optional | true | true = create + post; false = create proposal only. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"ProjId": "000184", "InvoiceDate": "2026-05-19", "PostAfterCreate": true } }
Behavior: DocumentId = the proposal; PostedDocumentId = the posted invoice (with PostAfterCreate) or the proposal. PreviewMode = true is refused with PreviewUnsupported. With PostAfterCreate, a failed post deletes the proposal the op created and returns its transactions to invoiceable, so a retry with the same RequestId works.
Dependency: project with billable, on-account transactions and a project contract in USMF.
EXPENSE MANAGEMENT
MGCLatticeExpenseReportService
Group: MGCLatticeExpenseServiceGroup. Both ops (and their batch twins) refuse PreviewMode = true with PreviewUnsupported; neither is registered for async execution. Security: MGCLatticeExpenseReportServiceMaintain (in MGCLatticeIntegrationServiceOperationsDuty); creating a report for a worker also needs the expense delegate rule (the worker's own user, a current delegate, or an expense administrator, expense agent or system administrator), else AccessDenied.
createExpenseReport / createExpenseReportBatch
- Request contract:
MGCLatticeExpenseReportCreateRequestContract - Line contract:
MGCLatticeExpenseReportLineContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
WorkerPersonnelNumber | HcmPersonnelNumberId (str) | optional | 000020 | Empty = the calling user's worker (none = ValidationFailed). Unknown, or not employed in the legal entity = ValidationFailed. |
Purpose | TrvTravelTxtEDT (str) | optional | Customer visit Chicago | |
Description | ItemFreeTxt (str) | optional | ||
Location | TrvDestination (str) | optional | Chicago | |
Dimensions | List of MGCLatticeDimensionValueContract | optional | Report dimensions, merged over the worker's defaults; unresolved = DimensionValueNotFound. | |
Lines | List of MGCLatticeExpenseReportLineContract | required (≥1) | see below | |
SubmitToWorkflow | boolean | optional | true | Submit to the expense report workflow after the create (no workflow applies = ConfigurationMissing; refused submit checks = BusinessRule). |
Comment | WorkflowComment (str) | optional | Chicago trip | Workflow comment of the submit. |
| Line field | X++ type | required? | sample | notes |
|---|---|---|---|---|
CategoryId | TrvCostTypeEDT (str) | required | Taxi | Active expense category; with ProjId it must be a category used in projects. |
TransDate | TransDate | optional | 2026-05-19 | Defaults to today. |
Amount | AmountCur (real) | required | 42.50 | Not zero. |
CurrencyCode | CurrencyCode (str) | optional | USD | Defaults to the accounting currency. |
PaymentMethod | TrvPayMethodEDT (str) | optional | Cash | Defaults to the category's; must be allowed for the category (a category without a usable default needs one). |
Merchant | TrvExpMerchantId (str) | optional | City Cab | |
Description | TrvExpTransDescription (str) | optional | Defaults to the category's description. | |
BusinessPurpose | TrvLinePurposeEDT (str) | optional | ||
AdditionalInformation | ItemFreeTxt (str) | optional | ||
SalesTaxGroup | TaxGroup (str) | optional | Default as the expense line defaults it. | |
ItemSalesTaxGroup | TaxItemGroup (str) | optional | Default: the category's. | |
ProjId | ProjId (str) | optional | 000184 | |
ActivityNumber | ProjActivityNumber (str) | optional | Only with ProjId. | |
Dimensions | List of MGCLatticeDimensionValueContract | optional | Merged over the line's defaulted dimensions. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"WorkerPersonnelNumber": "000020", "Purpose": "Customer visit Chicago",
"Lines": [ { "CategoryId": "Taxi", "Amount": 42.50, "CurrencyCode": "USD", "PaymentMethod": "Cash", "Merchant": "City Cab" },
{ "CategoryId": "Travel", "Amount": 22.25, "PaymentMethod": "Cash", "ProjId": "000184" } ],
"SubmitToWorkflow": true } }
Behavior: creates the report (Draft) and its lines the way the Expense reports page does (categories, payment methods, sales tax defaults, dimensions, project rules, expense policies), then with SubmitToWorkflow submits it (In review). A request that fails after the create deletes the report and its lines again. DocumentId = the expense report number; with SubmitToWorkflow, PostedDocumentId = the workflow correlation id (lower case, no braces) for the workflow service's approveWorkItem / rejectWorkItem / delegateWorkItem / recallWorkflow / getWorkflowStatus.
Refusals: no lines, an empty line, no CategoryId, unknown or inactive category, zero amount, unknown currency / payment method / sales tax group / item sales tax group / project / activity, a payment method the category does not allow, no usable default payment method and none sent, a project on a category not used in projects, ActivityNumber without ProjId, worker problems (above) = ValidationFailed; unresolved dimension = DimensionValueNotFound; the delegate rule = AccessDenied; no expense report number sequence, no workflow for the submit = ConfigurationMissing; the standard line, report or submit checks = BusinessRule.
postExpenseReport / postExpenseReportBatch
- Request contract:
MGCLatticeExpenseReportPostRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
ExpenseReportNumber | TrvExpNumber (str) | required | <createExpenseReport.DocumentId> | An approved expense report of the legal entity; unknown = DocumentNotFound. |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "ExpenseReportNumber": "<createExpenseReport.DocumentId>" } }
Behavior: the report's standard Post, in one transaction: vendor, ledger or bank transactions per line payment method (employee-paid lines to the worker's expense vendor), project cost transactions, sales tax; report and lines Posted. DocumentId = the report; PostedDocumentId = the first line's voucher (USMF posts one voucher per line; the message lists all). Already posted, not approved (the message names the status), a line not approved = InvalidStatus; no expense voucher number sequence = ConfigurationMissing; the standard posting checks or posting refused it = BusinessRule.
Dependency: worker 000020 (Admin's worker in USMF, expense vendor JULIAF), categories Taxi / Travel (project) with payment method Cash, project 000184, an active expense report workflow (USMF 000101) whose approval step the caller can complete. Receipts are attached with the standard ExpAttachedDocuments entity (by ExpTransNumber), not a Lattice entity.
WORKFLOW
MGCLatticeWorkflowActionService
Group: MGCLatticeWorkflowServiceGroup
submitToWorkflow / submitToWorkflowBatch
- Request contract:
MGCLatticeWorkflowSubmitRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
WorkflowTypeName | str | required | PurchReqReview | Workflow type (AOT name). |
RecordRecId | int64 | one of RecId/DocumentNumber | 5637144576 | RecId of the record to submit. Wins if both provided. |
TableName | str | required | PurchReqTable | Table of the record. Supported: PurchReqTable; any other table is ValidationFailed. |
DocumentNumber | str | one of RecId/DocumentNumber | PR-000001 | Natural key - the business document number (e.g. purchase requisition id). Resolves RecordRecId from TableName server-side; RecId still wins if also supplied. |
Comment | str | optional | Submitting for approval |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"WorkflowTypeName": "PurchReqReview", "RecordRecId": 5637144576, "TableName": "PurchReqTable",
"DocumentNumber": "PR-000001", "Comment": "Submitting for approval" } }
Natural key: supply
DocumentNumber(withTableName) to have the service resolve the record RecId from the document number;RecordRecIdremains a fallback and wins if both are sent. Applies identically to each element of thesubmitToWorkflowBatch_requestsarray.
approveWorkItem / rejectWorkItem / delegateWorkItem (+ Batch)
- Shared request contract:
MGCLatticeWorkflowActionRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | UserContext is informational; it never selects the user an action is taken as. | |||
ActingUserId | UserId (str) | required | Inga | The user the action is taken as: the work item's assignee. A work item assigned to anyone else is refused. |
WorkItemRecId | int64 | one of RecId/WorkflowCorrelationId | 5637144577 | RecId of the pending work item (assigned to ActingUserId). Wins if both provided. |
WorkflowCorrelationId | Guid (str) | one of RecId/WorkflowCorrelationId | {{$guid}} | Natural key - the root workflow correlation id (the submit response's DocumentId). The service resolves the pending approval work item of this workflow assigned to ActingUserId; WorkItemRecId still wins if also supplied. |
Comment | str | optional | Approved | |
DelegateToUserId | UserId (str) | delegate only | Sara | Required by delegateWorkItem: an enabled user other than ActingUserId. Not used by approve and reject. |
Behavior: approve and reject complete the work item with the outcome of its workflow element (Approve / Reject on an approval step, Complete on a task) through the platform's external work-item completion, as the assignee; a rejected document goes back to the workflow's originator. Delegate hands the work item to DelegateToUserId, as the assignee. When no work item is found the failure says why: unknown workflow (DocumentNotFound); pending but work items not created yet (InvalidStatus, retryable: try again later); work items assigned to other users (BusinessRule, naming them); workflow no longer pending (InvalidStatus). DocumentId = the work item RecId.
approve:
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "ActingUserId": "Inga", "WorkflowCorrelationId": "{{$guid}}", "Comment": "Approved" } }
reject:
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "ActingUserId": "Inga", "WorkflowCorrelationId": "{{$guid}}", "Comment": "Rejected - missing documentation" } }
delegate:
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "ActingUserId": "Inga", "WorkflowCorrelationId": "{{$guid}}", "Comment": "Delegating for review", "DelegateToUserId": "Sara" } }
Natural key: supply
WorkflowCorrelationId(the correlation id returned bysubmitToWorkflowin the responseDocumentId) to have the service resolve the pending work item ofActingUserId;WorkItemRecIdremains a fallback and wins if both are provided.
recallWorkflow / recallWorkflowBatch
- Request contract:
MGCLatticeWorkflowRecallRequestContract
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
| common envelope | ||||
WorkflowCorrelationId | Guid | required | {{$guid}} | Correlation id of the running workflow instance. |
Comment | str | optional | Recalling for corrections |
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"WorkflowCorrelationId": "00000000-0000-0000-0000-000000000000", "Comment": "Recalling for corrections" } }
DocumentId = the workflow correlation id (lower case, without braces). The platform cancels the instance asynchronously; a purchase requisition returns to Draft when the cancellation is processed.
Only the workflow's originator may recall it (as the document's Recall button allows), or a caller granted the workflow history's Cancel (WorkflowStatusCancel, as that form allows); anyone else is refused with ErrorCode AccessDenied. An unknown correlation id is DocumentNotFound.
getWorkflowStatus
- Request contract:
MGCLatticeStatusQueryRequestContract-DocumentId= the workflow correlation idsubmitToWorkflowreturned, the source record's RecId, or the source document number (purchase requisition number, resolved likesubmitToWorkflow'sDocumentNumber).
{ "_request": { "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "DocumentId": "be1322c8-2be8-4f1a-bc8b-ff5d00e1ab6b" } }
StatusDetails include one PendingWorkItem_<RecId> entry per pending work item of the instance, whose value is its assignee (the ActingUserId of a work-item action). A Faulted instance (it creates no work item) also carries FaultMessage: the fault text the workflow history shows.
ExternalSystem + DocumentIdExternalKey (a purchase requisition's external key) may replace DocumentId.
Dependency: RecordRecId, WorkItemRecId and WorkflowCorrelationId are RecId/GUID-only inputs tied to live workflow state - not creatable via OData. Must come from a real submitted workflow in USMF. WorkItemRecId must be in Pending status (service rejects otherwise).
ASYNC OPERATION
MGCLatticeAsyncOperationService
Group: MGCLatticeAsyncOperationServiceGroup
submitAsyncOperation (single)
- Request contract:
MGCLatticeAsyncOperationRequestContract - Wraps another service operation for asynchronous execution.
| JSON field | X++ type | required? | sample | notes |
|---|---|---|---|---|
CorrelationId | Guid | optional | {{$guid}} | |
RequestId | Guid | required | {{$guid}} | |
LegalEntityId | DataAreaId (str) | optional | USMF | Recorded on the queued operation; defaults to the payload's LegalEntityId. |
UserContext | UserId (str) | optional | Admin | Informational; recorded on the queued operation. |
ServiceName | str | required | MGCLatticeFixedAssetService | Target service to run async. |
OperationName | str | required | runDepreciationProposal | Target operation. |
RequestPayload | str | required | (JSON string) | The inner operation's _request object, serialized as a JSON string. |
Access and payload checks: the caller needs access to the target operation itself (the privilege that grants it for a direct call, e.g.
MGCLatticeFixedAssetsServiceMaintainforrunDepreciationProposal) as well assubmitAsyncOperation; without it the submission is refused. ARequestPayloadthat cannot be read as the target operation's request contract is refused at submit. A refused submission returnsSuccessfalse,Status4 and an all-zeroTrackingId, and queues nothing. Before running, the processor re-checks the submitter's access.
{ "_request": {
"RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin",
"ServiceName": "MGCLatticeFixedAssetService", "OperationName": "runDepreciationProposal",
"RequestPayload": "{\"RequestId\":\"00000000-0000-0000-0000-000000000001\",\"LegalEntityId\":\"USMF\",\"UserContext\":\"Admin\",\"JournalNameId\":\"FACur\",\"AssetBookId\":\"200_SLLR\",\"DepreciationDate\":\"2026-05-19\"}"
} }
getAsyncOperationStatus (single, query)
- Request contract:
MGCLatticeAsyncOperationStatusRequestContract:TrackingId(Guid, required) is the tracking id returned bysubmitAsyncOperation;CorrelationId(Guid, optional) is echoed. No common envelope. Response =MGCLatticeAsyncOperationStatusContract(Successis true when the operation was found;Statusis theMGCLatticeAsyncOperationStatusenum, emitted as an integer: 1 Queued, 2 Processing, 3 Succeeded, 4 Failed, 7 NotFound;DocumentIdandPostedDocumentIdonce Succeeded;ErrorCode,IsRetryableandErrorsonce Failed).
{ "_request": { "TrackingId": "<TrackingId-from-submit>", "CorrelationId": "{{$guid}}" } }
Dependency: TrackingId must be the id returned by a prior submitAsyncOperation call; an unknown id answers Success false, Status 7 and ErrorCode DocumentNotFound.
DATA MANAGEMENT
MGCLatticeDmfConfigService
Group: MGCLatticeDataManagementServiceGroup. These operations do not take the common envelope; see API reference for the specification format and the response.
| Operation | Body | notes |
|---|---|---|
applySpec | { "_request": { "Spec": { … }, "ValidateOnly": false, "PruneMissing": false } } | MGCLatticeDmfSpecApplyRequestContract. ValidateOnly = report what would change and write nothing. A missing request or Spec answers Success = false with a Message. |
captureSpec | { "_projectNamePattern": "", "_jobNamePattern": "" } | Both optional; empty = every data project and recurring data job. |
diffSpec | { "_request": { "Spec": { … }, "PruneMissing": false } } | MGCLatticeDmfSpecDiffRequestContract. Read-only: lists every difference between the specification and the environment (Differences, NotApplicable, Items). Success is false only when the comparison could not be made (no request, no Spec, an unreadable version). |
specFromPackageManifest | { "_manifestXml": "…", "_projectName": "" } | The contents of a data package's Manifest.xml; _projectName optional. |
A specification of version 1.1 can carry each entity line's field mapping in Mapping; see API reference.
MGCLatticeDmfMappingService
Group: MGCLatticeDataManagementServiceGroup. No common envelope; see API reference for the checks and the response.
| Operation | Request | notes |
|---|---|---|
validateMappings | MGCLatticeDmfMappingValidateRequestContract: DataProjectNamePattern (str, pattern such as Cust* or *), RecurringDataJobName (str) | At least one is required. Read-only. A pattern that matches nothing or an unknown job is refused (Success = false). Requires MGCLatticeDmfMappingServiceView. |
refreshMappings | MGCLatticeDmfMappingRefreshRequestContract: DataProjectName (str, required), EntityName (str, optional, data management name; blank = every enabled entity), RegenerateTargetMapping (bool), ValidateOnly (bool) | Changes configuration unless ValidateOnly. An unknown project or entity is refused. Requires MGCLatticeDmfMappingServiceMaintain (high-risk). |
{ "_request": { "DataProjectNamePattern": "Cust*", "RecurringDataJobName": "" } }
{ "_request": { "DataProjectName": "CustomerImport", "EntityName": "Customer groups", "RegenerateTargetMapping": false, "ValidateOnly": true } }
DATABASE ACCESS
MGCLatticeDbAccessService
Group: MGCLatticeDbAccessServiceGroup. High-risk: requires MGCLatticeDbAccessAdminPrivilege (see Security model).
| Operation | Request | notes |
|---|---|---|
requestAccess | MGCLatticeDbAccessRequestContract: IpAddress (str, required, public IPv4), DurationHours (int, optional, default 24, clamped to 1-72) | Returns MGCLatticeDbAccessResponseContract with the generated password and ServerName, the host to connect to (<server>.database.windows.net). No common envelope. |
revokeAccess | none | Revokes the caller's active grants. A failure carries ErrorCode: AccessDenied (caller not authorized), TransientRuntime (the revoke was deferred to the expiry sweep, or a runtime fault), BusinessRule or UnexpectedError. |
{ "_request": { "IpAddress": "203.0.113.42", "DurationHours": 8 } }
STATUS QUERIES (summary)
All five use MGCLatticeStatusQueryRequestContract with DocumentId (str) carrying the lookup key; common envelope otherwise.
| Operation | Service / Group | DocumentId meaning | sample |
|---|---|---|---|
getSalesOrderStatus | MGCLatticeSalesOrderPostingService / AR | SalesId | SO-000001 |
getPurchaseOrderStatus | MGCLatticePurchaseOrderPostingService / AP | PurchId | PO-000001 |
getProductionOrderStatus | MGCLatticeProductionOrderPostingService / Production | ProdId | P000001 |
getJournalStatus | MGCLatticeGeneralLedgerJournalService / GL | ledger JournalNum (not name) | 00001 |
getWorkflowStatus | MGCLatticeWorkflowActionService / Workflow | Workflow correlation id, source RecId, or document number | {BE1322C8-...} / 000031 |
BATCH OPERATIONS (summary)
The posting and action ops have a sibling ...Batch op: 83 batch operations in all (182 operations across 30 services in 13 service groups). The exceptions are the 5 status queries, the 2 async ops, resolveSalesPrice, and the database access, DMF configuration and DMF mapping ops. The batch contract per element is identical to the single op's contract; only the envelope differs: { "_requests": [ {elem1}, {elem2}, ... ] }. Every batch op returns MGCLatticeBulkOperationResponseContract except setSalesPriceBatch, which returns MGCLatticeSetSalesPriceBatchResult (counts plus a Results list of MGCLatticeSetSalesPriceResult). Example (sales confirm batch):
{ "_requests": [
{ "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "SalesOrderId": "SO-000001" },
{ "RequestId": "{{$guid}}", "LegalEntityId": "USMF", "UserContext": "Admin", "SalesOrderId": "SO-000002" }
] }
RECID INPUTS (summary)
Some inputs are record ids (RecIds) of posted records; read them from those records in the target legal entity. Most have an optional natural-key alternative that the service resolves to the RecId (when both are sent, the RecId wins):
MGCLatticeFreeTextInvoiceCancelRequestContract.InvoiceRecId→ natural keyInvoiceId(free-text invoice id).MGCLatticeSettlementRequestContract.PaymentTransRecIdandMGCLatticeSettlementLineContract.InvoiceTransRecId(customer or vendor transaction RecIds; the5637144576-style values in the samples are illustrative) → natural keys request-levelPaymentVoucherorPaymentInvoiceId, and lineInvoiceId.MGCLatticeWorkflowSubmitRequestContract.RecordRecId→ natural keyDocumentNumber(withTableName);MGCLatticeWorkflowActionRequestContract.WorkItemRecId→ natural keyWorkflowCorrelationId;MGCLatticeWorkflowRecallRequestContract.WorkflowCorrelationIdis a GUID input only;getWorkflowStatus.DocumentIdalso accepts the document number.getAsyncOperationStatus.TrackingIdis the id a priorsubmitAsyncOperationreturned.