Hi thanks for having me! I had a C# program in 9.05.702 that was triggered from the form that shows you a list of invoices in a given batch. Customer Service would click GO, a text file would be generated and handed to the program. Then The C# program would:
- Grab an Epicor session.
- Ask Epicor to Generate an invoice for that invoice number, wait for the task ID to be posted back to the task manager table then snatch up that XML file from the /reports directory.
- Use C# to trigger Crystal to generate that report and save it as a PDF on the network.
- Locate the correct customer number from the Invoice ID for that specific ship to address and find the correct contact in Epicor to send it to.
- Email out the invoice and add the success or failure to a log.
- Lather, Rinse, repeat for the list of invoices
- Send out a final summary to customer service in an HTML email that highlighted if any invoice wasnāt sent or wasnāt generated correctly.
- Release the license that it was using.
A bit slow at the Crystal phase but it did itās jobā¦ But we just went live with 10.2.500.2 and have said our final goodbyes to Crystal. I think I can take a much much easier approach now and I am looking that API but I canāt find documentation with a few questions and a nudge in the right direction would really help me out. Basically if I may give an example:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
"ds": { \
"ARInvFormParam": [ \
{ \
"InvoiceNum": 206106, \
"CurGroup": "string", \
"PrintNPost": true, \
"Vouchering": true, \
"AssignLegalNumber": true, \
"Description": "string", \
"DocTypeOption": "string", \
"EnableAssignLegalNumber": true, \
"PrintStatusOption": "string", \
"TranDocTypeID": "string", \
"TransOptions": "string", \
"ARInvFormReportID": "string", \
"THPlaceOfBusiness": "string", \
"TWCompInvPart1": true, \
"TWCompInvPart2": true, \
"TWCompInvPart3Front": true, \
"TWCompInvPart3Back": true, \
"TWEInvTransDetails": true, \
"TWEInvPrizeCollection": true, \
"CalledFrom": "string", \
"EnableUseCopyNumInARInv": true, \
"DraftCopy": true, \
"DspDocCopyNum": "string", \
"SysRowID": "00000000-0000-0000-0000-000000000000", \
"AutoAction": "SSRSPREVIEW", \
"PrinterName": "string", \
"AgentSchedNum": "0", \
"AgentID": "SystemTaskAgent", \
"AgentTaskNum": 0, \
"RecurringTask": false, \
"RptPageSettings": "string", \
"RptPrinterSettings": "string", \
"RptVersion": "string", \
"ReportStyleNum": 2, \
"WorkstationID": "string", \
"TaskNote": "string", \
"ArchiveCode": 0, \
"DateFormat": "string", \
"NumericFormat": "string", \
"AgentCompareString": "string", \
"ProcessID": "string", \
"ProcessCompany": "string", \
"ProcessSystemCode": "string", \
"ProcessTaskNum": 0, \
"DecimalsGeneral": 0, \
"DecimalsCost": 0, \
"DecimalsPrice": 0, \
"GlbDecimalsGeneral": 0, \
"GlbDecimalsCost": 0, \
"GlbDecimalsPrice": 0, \
"FaxSubject": "string", \
"FaxTo": "string", \
"FaxNumber": "string", \
"EMailTo": "string", \
"EMailCC": "string", \
"EMailBCC": "string", \
"EMailBody": "string", \
"AttachmentType": "string", \
"ReportCurrencyCode": "string", \
"ReportCultureCode": "string", \
"SSRSRenderFormat": "PDF", \
"UIXml": "string", \
"PrintReportParameters": true, \
"SSRSEnableRouting": true, \
"DesignMode": true, \
"RowMod": "string" \
} \
], \
"ReportStyle": [ \
{ \
"Company": "CMX100", \
"ReportID": "string", \
"StyleNum": 0, \
"StyleDescription": "string", \
"RptTypeID": "string", \
"PrintProgram": "string", \
"PrintProgramOptions": "string", \
"RptDefID": "string", \
"CompanyList": "string", \
"ServerNum": 0, \
"OutputLocation": "string", \
"OutputEDI": "string", \
"SystemFlag": true, \
"CGCCode": "string", \
"SysRevID": "0", \
"SysRowID": "00000000-0000-0000-0000-000000000000", \
"RptCriteriaSetID": "string", \
"RptStructuredOutputDefID": "string", \
"StructuredOutputEnabled": true, \
"RequireSubmissionID": true, \
"AllowResetAfterSubmit": true, \
"HasBAQOrEI": true, \
"BitFlag": 0, \
"ReportRptDescription": "string", \
"RptDefRptDescription": "string", \
"RptTypeRptTypeDescription": "string", \
"RowMod": "string" \
} \
]}, \
"agentID": "SystemTaskAgent", \
"agentSchedNum": 0, \
"agentTaskNum": 0, \
"maintProgram": "string" \
}' 'https://cmxepicorapp5/epicor102/api/v1/Erp.RPT.ARInvFormSvc/SubmitToAgent
I get a 200 response back which is nice but - can I get the PDF back? I saw another post where they were getting a datastream of the pdf back but maybe I am misunderstanding. Iād be happiest with the datastream but saving the PDF someplace works tooā¦ Also obviously there is something I havenāt read - any points to docs would be awesome. Also I know I must have extra parameters in there I donāt need, I was going from the example text in the /api/help/v1/methods stuff
Thanks in advance! So happy weāre finally 102500 and I am loving this API.
EDIT: I found v2 API and am using that now but similar results with out knowing what parameters to include