mjf1143 | 2022-03-08 18:44:48 UTC | #1 Hi All, I new to Epicor's REST API and I am working on a sales order automation project. I have successfully got the format for generating a sales order with multiple lines via /OrderDtls. However, we have a customer that wants one line with many releases. I have tried the below with no success. Any help is appreciated!! ``` { "OpenOrder": true, "Company": "SMI", "OrderNum": 0, "CustNum": 641, "PONum": "OrderReleaseAPItest0001", "OrderRels": [ { "OpenRelease": true, "Company": "SMI", "OrderNum": 0, "OrderLine": 0, "OrderRelNum": 0, "LineType": "PART", "PartNum": "05-8409", "SellingReqQty": "20", "NeedByDate": "2022-03-07", "ReqDate": "2022-03-07" }, { "OpenRelease": true, "Company": "SMI", "OrderNum": 0, "OrderLine": 0, "OrderRelNum": 0, "LineType": "PART", "PartNum": "05-8409", "SellingReqQty": "18", "NeedByDate":"2022-03-07", "ReqDate": "2022-03-07" }, { "OpenRelease": true, "Company": "SMI", "OrderNum": 0, "OrderLine": 0, "OrderRelNum": 0, "LineType": "PART", "PartNum": "05-8409", "SellingReqQty": "10", "NeedByDate":"2022-03-07", "ReqDate": "2022-03-07" } ] } ``` ------------------------- josecgomez | 2022-03-08 18:47:22 UTC | #2 What endpoint are you using? Because of Epicors underlying architecture you are not going to be able to make all those in a single call I don't believe ------------------------- mjf1143 | 2022-03-08 18:50:47 UTC | #3 api/v1/Erp.BO.SalesOrderSvc/SalesOrders - POST I have also tried api/v1/Erp.BO.SalesOrderSvc/OrderDtls - POST Both end up with bad requests. ------------------------- josecgomez | 2022-03-08 18:53:08 UTC | #4 You have to use the OrderRels endpoint /{currentCompany}/Erp.BO.SalesOrderSvc/OrderRels With this input , and it expects the Header and Line to Already Exist. ``` { "Company": "string", "OrderNum": 0, "OrderLine": 0, "OrderRelNum": 0, "LineType": "string", "ReqDate": "2022-03-08T18:50:50.084Z", "OurReqQty": 0, "ShipToNum": "string", "ShipViaCode": "string", "OpenRelease": true, "FirmRelease": true, "Make": true, "OurJobQty": 0, "OurJobShippedQty": 0, "VoidRelease": true, "OurStockQty": 0, "WarehouseCode": "string", "OurStockShippedQty": 0, "PartNum": "string", "RevisionNum": "string", "TaxExempt": "string", "ShpConNum": 0, "NeedByDate": "2022-03-08T18:50:50.084Z", "Reference": "string", "Plant": "string", "SellingReqQty": 0, "SellingJobQty": 0, "SellingJobShippedQty": 0, "SellingStockQty": 0, "SellingStockShippedQty": 0, "SelectForPicking": true, "StagingWarehouseCode": "string", "StagingBinNum": "string", "PickError": "string", "CumeQty": 0, "CumeDate": "2022-03-08T18:50:50.084Z", "Linked": true, "ICPONum": 0, "ICPOLine": 0, "ICPORelNum": 0, "ExtCompany": "string", "ScheduleNumber": "string", "MarkForNum": "string", "DropShipName": "string", "RAN": "string", "DemandReference": "string", "DemandSchedRejected": true, "DatePickTicketPrinted": "2022-03-08T18:50:50.084Z", "ResDelivery": true, "SatDelivery": true, "SatPickup": true, "VerbalConf": true, "Hazmat": true, "DocOnly": true, "RefNotes": "string", "ApplyChrg": true, "ChrgAmount": 0, "COD": true, "CODFreight": true, "CODCheck": true, "CODAmount": 0, "GroundType": "string", "NotifyFlag": true, "NotifyEMail": "string", "DeclaredIns": true, "DeclaredAmt": 0, "ServSatDelivery": true, "ServSatPickup": true, "ServSignature": true, "ServAlert": true, "ServPOD": true, "ServAOD": true, "ServHomeDel": true, "DeliveryType": "string", "ServDeliveryDate": "2022-03-08T18:50:50.084Z", "ServPhone": "string", "ServInstruct": "string", "ServRelease": true, "ServAuthNum": "string", "ServRef1": "string", "ServRef2": "string", "ServRef3": "string", "ServRef4": "string", "ServRef5": "string", "OverrideCarrier": true, "OverrideService": true, "DockingStation": "string", "Location": "string", "TransportID": "string", "ShipbyTime": 0, "ChangedBy": "string", "ChangeDate": "2022-03-08T18:50:50.084Z", "ChangeTime": 0, "TaxConnectCalc": true, "GetDfltTaxIds": true, "TaxRegionCode": "string", "UseOTS": true, "OTSName": "string", "OTSAddress1": "string", "OTSAddress2": "string", "OTSAddress3": "string", "OTSCity": "string", "OTSState": "string", "OTSZIP": "string", "OTSResaleID": "string", "OTSContact": "string", "OTSFaxNum": "string", "OTSPhoneNum": "string", "OTSCountryNum": 0, "SubShipTo": "string", "ShipRouting": "string", "BuyToOrder": true, "VendorNum": 0, "PurPoint": "string", "DropShip": true, "PONum": 0, "POLine": 0, "PORelNum": 0, "OpenOrder": true, "OTSSaveAs": "string", "OTSSaveCustID": "string", "OTSCustSaved": true, "ShipToCustNum": 0, "IUM": "string", "SalesUM": "string", "RelStatus": "string", "ComplianceMsg": "string", "PrevSellQty": 0, "PrevPartNum": "string", "PrevXPartNum": "string", "PrevNeedByDate": "2022-03-08T18:50:50.084Z", "PrevReqDate": "2022-03-08T18:50:50.084Z", "PrevShipToNum": "string", "MFCustNum": 0, "UseOTMF": true, "OTMFName": "string", "OTMFAddress1": "string", "OTMFAddress2": "string", "OTMFAddress3": "string", "OTMFCity": "string", "OTMFState": "string", "OTMFZIP": "string", "OTMFContact": "string", "OTMFFaxNum": "string", "OTMFPhoneNum": "string", "OTMFCountryNum": 0, "ECCPlant": "string", "WIOrderLine": "string", "WIOrder": "string", "WebSKU": "string", "ShipOvers": true, "WIItemPrice": 0, "WIItemShipCost": 0, "SysRevID": 0, "SysRowID": "00000000-0000-0000-0000-000000000000", "EntityUseCode": "string", "PhaseID": "string", "OTSShipToNum": "string", "WasRecInvoiced": true, "ContractID": "string", "LinkToContract": true, "ReadyToFulfill": true, "OTSEMailAddress": "string", "AttributeSetID": 0, "NumberOfPieces": 0, "NumberOfPiecesUOM": "string", "PlanningNumberOfPieces": 0, "AvailableQuantity": 0, "BuyOverride": true, "CreditLimitMessage": "string", "CreditLimitSource": "string", "CurrencyCode": "string", "CustAllowOTS": true, "CustomerAllowShipTo3": true, "CustomerCustID": "string", "CustomerName": "string", "DisablePlantWhse": true, "DocSelfAssessTax": 0, "DocTotalTax": 0, "DocWithholdTax": 0, "DropShipOverride": true, "DspInvMeth": "string", "DspRevMethod": "string", "EnableBuyToOrder": true, "EnableMake": true, "EntryProcess": "string", "ExistPOSugg": true, "HdrOTS": true, "IntExternalKey": "string", "InvtyUOM": "string", "KitDisable": true, "LinkToPONum": true, "MakeOverride": true, "MarkForAddrFormatted": "string", "MarkForAddrList": "string", "MFCustID": "string", "NoRelTaxRgnChange": true, "NotCompliant": true, "OnHandQuantity": 0, "OTSSaved": true, "OTSTaxRegionCode": "string", "PartExists": true, "PhaseWasRecInvoiced": true, "ProjectID": "string", "ReleaseStatus": "string", "RemoveManAdTax": true, "Rpt1SelfAssessTax": 0, "Rpt1TotalTax": 0, "Rpt1WithholdTax": 0, "Rpt2SelfAssessTax": 0, "Rpt2TotalTax": 0, "Rpt2WithholdTax": 0, "Rpt3SelfAssessTax": 0, "Rpt3TotalTax": 0, "Rpt3WithholdTax": 0, "SalesOrderLinked": true, "SelfAssessTax": 0, "SellingFactor": 0, "SellingFactorDirection": "string", "ShipToAddressFormatted": "string", "ShipToAddressList": "string", "ShipToContactEMailAddress": "string", "ShipToContactName": "string", "ShipToSelected": true, "SNEnable": true, "ThisRelInvtyQty": 0, "TotalJobStockShipped": 0, "TotalTax": 0, "UpdateMarkForRecords": true, "VoidOrder": true, "WithholdTax": 0, "AllowTaxCodeUpd": true, "EnableDynAttrButton": true, "AttributeMismatch": true, "BitFlag": 0, "DynAttrValueSetShortDescription": "string", "DynAttrValueSetDescription": "string", "MFCustNumInactive": true, "OrderLineLineDesc": "string", "OrderNumCurrencyCode": "string", "OrderNumCardMemberName": "string", "OTMFCountryDescription": "string", "OTSCntryDescription": "string", "PartNumTrackInventoryAttributes": true, "PartNumAttrClassID": "string", "PartNumPricePerCode": "string", "PartNumTrackDimension": true, "PartNumIUM": "string", "PartNumTrackSerialNum": true, "PartNumPartDescription": "string", "PartNumTrackLots": true, "PartNumSellingFactor": 0, "PartNumSalesUM": "string", "PlantName": "string", "PurPointAddress3": "string", "PurPointZip": "string", "PurPointName": "string", "PurPointCountry": "string", "PurPointAddress1": "string", "PurPointState": "string", "PurPointCity": "string", "PurPointAddress2": "string", "PurPointPrimPCon": 0, "ShipViaCodeWebDesc": "string", "ShipViaCodeDescription": "string", "TaxRegionCodeDescription": "string", "TPShipToName": "string", "TPShipToBTName": "string", "TPShipToCustID": "string", "VendorNumState": "string", "VendorNumZIP": "string", "VendorNumName": "string", "VendorNumAddress2": "string", "VendorNumCountry": "string", "VendorNumCurrencyCode": "string", "VendorNumCity": "string", "VendorNumAddress3": "string", "VendorNumVendorID": "string", "VendorNumDefaultFOB": "string", "VendorNumTermsCode": "string", "VendorNumAddress1": "string", "WarehouseCodeDescription": "string", "RowMod": "string", "UD_SysRevID": "string", "sgcCloseReason_c": "string", "ShipRef1_c": "string", "ShipRef2_c": "string", "OrderRelTaxes": [ { "Company": "string", "TaxCode": "string", "ReportableAmt": 0, "DocReportableAmt": 0, "TaxableAmt": 0, "DocTaxableAmt": 0, "Percent": 0, "TaxAmt": 0, "DocTaxAmt": 0, "Manual": true, "ChangedBy": "string", "ChangeDate": "2022-03-08T18:50:50.084Z", "ChangeTime": 0, "ReverseCharge": true, "OrderNum": 0, "OrderLine": 0, "OrderRelNum": 0, "Discount": 0, "DocDiscount": 0, "Rpt1Discount": 0, "Rpt2Discount": 0, "Rpt3Discount": 0, "Rpt1ReportableAmt": 0, "Rpt2ReportableAmt": 0, "Rpt3ReportableAmt": 0, "Rpt1TaxableAmt": 0, "Rpt2TaxableAmt": 0, "Rpt3TaxableAmt": 0, "Rpt1TaxAmt": 0, "Rpt2TaxAmt": 0, "Rpt3TaxAmt": 0, "RateCode": "string", "CollectionType": 0, "Timing": 0, "ExemptType": 0, "ExemptPercent": 0, "ResolutionNum": "string", "ResolutionDate": "2022-03-08T18:50:50.084Z", "TaxRateDate": "2022-03-08T18:50:50.084Z", "DefTaxableAmt": 0, "DocDefTaxableAmt": 0, "Rpt1DefTaxableAmt": 0, "Rpt2DefTaxableAmt": 0, "Rpt3DefTaxableAmt": 0, "DefTaxAmt": 0, "DocDefTaxAmt": 0, "Rpt1DefTaxAmt": 0, "Rpt2DefTaxAmt": 0, "Rpt3DefTaxAmt": 0, "ManAdd": true, "DedTaxAmt": 0, "DocDedTaxAmt": 0, "Rpt1DedTaxAmt": 0, "Rpt2DedTaxAmt": 0, "Rpt3DedTaxAmt": 0, "ECAcquisitionSeq": 0, "FixedAmount": 0, "DocFixedAmount": 0, "Rpt1FixedAmount": 0, "Rpt2FixedAmount": 0, "Rpt3FixedAmount": 0, "TextCode": "string", "SysRevID": 0, "SysRowID": "00000000-0000-0000-0000-000000000000", "SalesTaxDescDescription": "string", "DocDisplaySymbol": "string", "CurrencySwitch": true, "CurrencyCode": "string", "CollectionTypeDescription": "string", "DisplaySymbol": "string", "NoChangeManual": true, "EntryProcess": "string", "BitFlag": 0, "RateCodeDescDescription": "string", "RowMod": "string" } ] } ``` ------------------------- josecgomez | 2022-03-08 18:55:24 UTC | #5 Oh wait you are using V1 Then use Erp.BO.SalesOrderSvc/OrderRels With a Single Release at a time again Line and Header should already exist ``` { "ShipRef1_c": "string", "Company": "C001", "OrderNum": 0, "OrderLine": 0, "OrderRelNum": 0, "LineType": "string", "ReqDate": "2022-03-08T18:54:02.915Z", "OurReqQty": "0", "ShipToNum": "string", "ShipViaCode": "string", "OpenRelease": true, "FirmRelease": true, "Make": true, "OurJobQty": "0", "OurJobShippedQty": "0", "VoidRelease": true, "OurStockQty": "0", "WarehouseCode": "string", "OurStockShippedQty": "0", "PartNum": "string", "RevisionNum": "string", "TaxExempt": "string", "ShpConNum": 0, "NeedByDate": "2022-03-08T18:54:02.915Z", "Reference": "string", "Plant": "string", "SellingReqQty": "0", "SellingJobQty": "0", "SellingJobShippedQty": "0", "SellingStockQty": "0", "SellingStockShippedQty": "0", "SelectForPicking": true, "StagingWarehouseCode": "string", "StagingBinNum": "string", "PickError": "string", "CumeQty": "0", "CumeDate": "2022-03-08T18:54:02.915Z", "Linked": true, "ICPONum": 0, "ICPOLine": 0, "ICPORelNum": 0, "ExtCompany": "string", "ScheduleNumber": "string", "MarkForNum": "string", "DropShipName": "string", "RAN": "string", "DemandReference": "string", "DemandSchedRejected": true, "DatePickTicketPrinted": "2022-03-08T18:54:02.915Z", "ResDelivery": true, "SatDelivery": true, "SatPickup": true, "VerbalConf": true, "Hazmat": true, "DocOnly": true, "RefNotes": "string", "ApplyChrg": true, "ChrgAmount": "0", "COD": true, "CODFreight": true, "CODCheck": true, "CODAmount": "0", "GroundType": "string", "NotifyFlag": true, "NotifyEMail": "string", "DeclaredIns": true, "DeclaredAmt": "0", "ServSatDelivery": true, "ServSatPickup": true, "ServSignature": true, "ServAlert": true, "ServPOD": true, "ServAOD": true, "ServHomeDel": true, "DeliveryType": "string", "ServDeliveryDate": "2022-03-08T18:54:02.915Z", "ServPhone": "string", "ServInstruct": "string", "ServRelease": true, "ServAuthNum": "string", "ServRef1": "string", "ServRef2": "string", "ServRef3": "string", "ServRef4": "string", "ServRef5": "string", "OverrideCarrier": true, "OverrideService": true, "DockingStation": "string", "Location": "string", "TransportID": "string", "ShipbyTime": 0, "ChangedBy": "string", "ChangeDate": "2022-03-08T18:54:02.915Z", "ChangeTime": 0, "TaxConnectCalc": true, "GetDfltTaxIds": true, "TaxRegionCode": "string", "UseOTS": true, "OTSName": "string", "OTSAddress1": "string", "OTSAddress2": "string", "OTSAddress3": "string", "OTSCity": "string", "OTSState": "string", "OTSZIP": "string", "OTSResaleID": "string", "OTSContact": "string", "OTSFaxNum": "string", "OTSPhoneNum": "string", "OTSCountryNum": 0, "SubShipTo": "string", "ShipRouting": "string", "BuyToOrder": true, "VendorNum": 0, "PurPoint": "string", "DropShip": true, "PONum": 0, "POLine": 0, "PORelNum": 0, "OpenOrder": true, "OTSSaveAs": "string", "OTSSaveCustID": "string", "OTSCustSaved": true, "ShipToCustNum": 0, "IUM": "string", "SalesUM": "string", "RelStatus": "string", "ComplianceMsg": "string", "PrevSellQty": "0", "PrevPartNum": "string", "PrevXPartNum": "string", "PrevNeedByDate": "2022-03-08T18:54:02.915Z", "PrevReqDate": "2022-03-08T18:54:02.915Z", "PrevShipToNum": "string", "MFCustNum": 0, "UseOTMF": true, "OTMFName": "string", "OTMFAddress1": "string", "OTMFAddress2": "string", "OTMFAddress3": "string", "OTMFCity": "string", "OTMFState": "string", "OTMFZIP": "string", "OTMFContact": "string", "OTMFFaxNum": "string", "OTMFPhoneNum": "string", "OTMFCountryNum": 0, "ECCPlant": "string", "WIOrderLine": "string", "WIOrder": "string", "WebSKU": "string", "ShipOvers": true, "WIItemPrice": "0", "WIItemShipCost": "0", "SysRevID": "0", "SysRowID": "00000000-0000-0000-0000-000000000000", "EntityUseCode": "string", "PhaseID": "string", "OTSShipToNum": "string", "WasRecInvoiced": true, "ContractID": "string", "LinkToContract": true, "ReadyToFulfill": true, "OTSEMailAddress": "string", "AttributeSetID": 0, "NumberOfPieces": 0, "NumberOfPiecesUOM": "string", "PlanningNumberOfPieces": 0, "AvailableQuantity": "0", "BuyOverride": true, "CreditLimitMessage": "string", "CreditLimitSource": "string", "CurrencyCode": "string", "CustAllowOTS": true, "CustomerAllowShipTo3": true, "CustomerCustID": "string", "CustomerName": "string", "DisablePlantWhse": true, "DocSelfAssessTax": "0", "DocTotalTax": "0", "DocWithholdTax": "0", "DropShipOverride": true, "DspInvMeth": "string", "DspRevMethod": "string", "EnableBuyToOrder": true, "EnableMake": true, "EntryProcess": "string", "ExistPOSugg": true, "HdrOTS": true, "IntExternalKey": "string", "InvtyUOM": "string", "KitDisable": true, "LinkToPONum": true, "MakeOverride": true, "MarkForAddrFormatted": "string", "MarkForAddrList": "string", "MFCustID": "string", "NoRelTaxRgnChange": true, "NotCompliant": true, "OnHandQuantity": "0", "OTSSaved": true, "OTSTaxRegionCode": "string", "PartExists": true, "PhaseWasRecInvoiced": true, "ProjectID": "string", "ReleaseStatus": "string", "RemoveManAdTax": true, "Rpt1SelfAssessTax": "0", "Rpt1TotalTax": "0", "Rpt1WithholdTax": "0", "Rpt2SelfAssessTax": "0", "Rpt2TotalTax": "0", "Rpt2WithholdTax": "0", "Rpt3SelfAssessTax": "0", "Rpt3TotalTax": "0", "Rpt3WithholdTax": "0", "SalesOrderLinked": true, "SelfAssessTax": "0", "SellingFactor": "0", "SellingFactorDirection": "string", "ShipToAddressFormatted": "string", "ShipToAddressList": "string", "ShipToContactEMailAddress": "string", "ShipToContactName": "string", "ShipToSelected": true, "SNEnable": true, "ThisRelInvtyQty": "0", "TotalJobStockShipped": "0", "TotalTax": "0", "UpdateMarkForRecords": true, "VoidOrder": true, "WithholdTax": "0", "AllowTaxCodeUpd": true, "EnableDynAttrButton": true, "AttributeMismatch": true, "BitFlag": 0, "DynAttrValueSetShortDescription": "string", "DynAttrValueSetDescription": "string", "MFCustNumInactive": true, "OrderLineLineDesc": "string", "OrderNumCurrencyCode": "string", "OrderNumCardMemberName": "string", "OTMFCountryDescription": "string", "OTSCntryDescription": "string", "PartNumTrackInventoryAttributes": true, "PartNumAttrClassID": "string", "PartNumPricePerCode": "string", "PartNumTrackDimension": true, "PartNumIUM": "string", "PartNumTrackSerialNum": true, "PartNumPartDescription": "string", "PartNumTrackLots": true, "PartNumSellingFactor": "0", "PartNumSalesUM": "string", "PlantName": "string", "PurPointAddress3": "string", "PurPointZip": "string", "PurPointName": "string", "PurPointCountry": "string", "PurPointAddress1": "string", "PurPointState": "string", "PurPointCity": "string", "PurPointAddress2": "string", "PurPointPrimPCon": 0, "ShipViaCodeWebDesc": "string", "ShipViaCodeDescription": "string", "TaxRegionCodeDescription": "string", "TPShipToName": "string", "TPShipToBTName": "string", "TPShipToCustID": "string", "VendorNumState": "string", "VendorNumZIP": "string", "VendorNumName": "string", "VendorNumAddress2": "string", "VendorNumCountry": "string", "VendorNumCurrencyCode": "string", "VendorNumCity": "string", "VendorNumAddress3": "string", "VendorNumVendorID": "string", "VendorNumDefaultFOB": "string", "VendorNumTermsCode": "string", "VendorNumAddress1": "string", "WarehouseCodeDescription": "string", "RowMod": "string", "sgcCloseReason_c": "string", "UD_SysRevID": "", "ShipRef2_c": "string" } ``` ------------------------- gpayne | 2022-03-08 19:39:39 UTC | #6 @josecgomez Won't release 1 also exist since it is made at the time the line is added? ------------------------- mjf1143 | 2022-03-08 19:46:53 UTC | #7 Thanks @josecgomez. I was able to successfully add an additional release. I didn't know that they would have to be separate calls and that you can only add one at a time. Now, time to figure how to make sequential calls. ------------------------- josecgomez | 2022-03-08 19:46:59 UTC | #8 [quote="gpayne, post:6, topic:88215, full:true"] @josecgomez Won’t release 1 also exist since it is made at the time the line is added? [/quote] Yes sir! ------------------------- Mark_Wonsil | 2022-03-08 20:15:24 UTC | #9 [quote="mjf1143, post:7, topic:88215"] I didn’t know that they would have to be separate calls and that you can only add one at a time. Now, time to figure how to make sequential calls. [/quote] There is another potential solution and that is calling a single Epicor Function (via REST) with your payload and having the function add the order and releases (one at a time) but then it's not so chatty on the wire. ------------------------- AMD-EpicorTech | 2024-05-22 18:50:02 UTC | #10 I am trying to execute this in the API HELPER PAGE. "Try it Out". I keep getting the following error: { "HttpStatus": 400, "ReasonPhrase": "REST API Exception", "ErrorMessage": "Part is required.\r\nPart Description is required.", "ErrorType": "Ice.Common.BusinessObjectException", "ErrorDetails": [ { "Message": "Part is required.\r\nPart Description is required.", "Type": "Error", "Table": "OrderDtl", "Program": "Epicor.RESTApi.dll", "Method": "ThrowUpdateExtException", "ColumnNumber": 17, "LineNumber": 47 } ] } THis is my data: { Company: "XYZ", OrderNum: "1234567", OpenRelease: true, PartNum: "123456", OrderLineLineDesc: "SOME DESC", PartNumPartDescription: "SOME DESC" } URL: api/v1/Erp.BO.SalesOrderSvc/OrderRels -------------------------