Skip to main content

MGCLatticePurchaseReturnService.createPurchaseReturn

Creates a purchase return order (PurchaseType::ReturnItem) to a vendor with one or more return lines, via the AxPurchTable / AxPurchLine business-document framework so the order and lines are defaulted and validated the standard way - the purchase counterpart of createSalesReturn. Every line needs a quantity (its size is used; a line without one is refused), and return quantities are stored negative. The standard purchase order entity cannot do this: it only covers PurchaseType::Purch. Idempotent by RequestId.

  • HTTP method: POST
  • Route: /api/services/MGCLatticeAccountsPayableServiceGroup/MGCLatticePurchaseReturnService/createPurchaseReturn
  • Service class: MGCLatticePurchaseReturnService

Parameters​

NameTypeOptionalDescription
_requestMGCLatticeCreatePurchaseReturnRequestContractNoRequest with VendAccount, ReturnItemNum (the vendor's RMA number), optional ReturnReasonCodeId, and lines (ItemId, Qty, and SiteId / WarehouseId or InventDimId).

Returns​

MGCLatticeOrderOperationResponseContract

An MGCLatticeOrderOperationResponseContract carrying the created PurchId, or a failure.

Security​

  • Requires privilege MGCLatticeAccountsPayableServiceMaintain