API – VAN business process flow
- Full list of our API calls with usage examples and notes: API Calls · LorenData/ECGrid-API Wiki · GitHub
- URL to try the API calls to see result sets against your network and/or mailbox: https://os.ecgrid.io/v4.1/prod/
Outbound from your network – Upload Document
- ParcelUploadExA - Post an EDI document to ECGrid. It will return the parcelID of the document successfully uploaded. This parcel ID can be used to retrieve additional information.
- InterchangeInfo – Return the metadata about a specific interchange – including the document status.
- InterchangeManifest – returns the audit information which shows the step/process it went through on ECGrid.
Inbound to your network – Download Document
Batch Method
- Get list of parcels in network
- ParcelInBoxEx – use SessionID (API Key of network Admin), NetworkID, and -1 (ALL) for rest to capture all parcels for all mailboxes.
- Loop through ParcelIDInfo to get each document and get ParcelID value.
- Get document in base64String: Call ParcelDownloadA using SessionID and the ParcelID.
- Call ParcelDownloadConfirm to remove the file from the pending download list.
Callback – Webhook
- CallBackAddEx – Once you create this callback request, it will send a response to the URL provided with the parcelID of the document that arrived in the inbox.
- Get document in base64String: Call ParcelDownloadA using SessionID and the ParcelID.
- Call ParcelDownloadConfirm to remove the file from the pending download list.
Look up Transactions
- InterchangeInBoxEx – able to search by date range and interchange control number. The date needs to be in YYYY-MM-DDTHH:mm:ss in UTC format. The times can take an offset as well: Ex – 2023-02-01T00:00:00-05:00 where the UTC offset is -05:00. The InterchangeControlID can be an empty string and ECGridIDTo, ECGridIDFrom and Mailbox can have a -1 to get “ALL”.
- InterchangeOutBoxEx – able to search by date range and interchange control number. The date needs to be in YYYY-MM-DDTHH:mm:ss in UTC format. The times can take an offset as well: Ex – 2023-02-01T00:00:00-05:00 where the UTC offset is -05:00. The InterchangeControlID can be an empty string and ECGridIDTo, ECGridIDFrom and Mailbox can have a -1 to get “ALL”.
- To view the actual document, you can call the ParcelDownload function.
Document Error Checks
- CallBackAddEx
- Set SystemObject (network, mailbox, parcel)
- Set ObjectStatus – Invoke Callback for each parcel status that would need investigation. So, if parcel reaches error status, Callback will hit specified URL to act on a specific parcel. For outbound errors, a Callback would need to be set for the outbox. For inbound errors, a Callback would need to be set for the inbox.
- Call InterchangeManifest for specific parcel to get audit information for the errors. This will show each step/process through the ECGrid network.
Snippet from return set:
<ManifestInfo>
<ManifestDate>2022-11-09T15:03:33.09</ManifestDate>
<NetworkID>47</NetworkID>
<NetworkName>Loren Data Corp. - ECGrid Testing</NetworkName>
<Type>ECGridOS</Type>
<ParcelID>1416918926</ParcelID>
<InterchangeID>0</InterchangeID>
<StatusCode>M2000</StatusCode>
<StatusMessage>NETWORK-IN: Parcel Ready for Grid Processing</StatusMessage>
<StatusColor>blue</StatusColor>
</ManifestInfo>
Administration
- TPAddEx - Add new IDs to a mailbox. RoutingGroup is mandatory and usually ProductionA
- MailboxAddEx – Add new mailbox to network. User needs to exist before creating mailbox
- To setup an interconnect/Trading partnership
- Call TPSearch – this will search the ECGrid network for the trading partner IDs to see if they are currently set up on our network. Make sure -1 is set for NetworkID and MailboxID to search the entire ECGrid Network, not just a specific network node or mailbox. This will need to be called for each set of qualifiers and IDs you want to setup the partnership.
- Capture the ECGridIDs (internal UUIDs for the qualifier and IDs)
- Call InterconnectAdd with the ECGridIDs captured with the TPSearch function
- Resend Interchange – You need the ECGrid internal Interchange ID to resend an interchange.
- InterchangeInboxEx or InterchangeOutboxEx– Search for the interchange you want using one of these calls and the ISA control number.
- Find the InterchangeID element value.
- Call InterchangeResend with the InterchangeID value.
Find Trading Partner IDs on ECGrid Network
- TPFindEX – Search the ECGrid Network by description. -1 on NetworkID and MailboxID will allow a search across all our networks and mailboxes. % at the beginning/end of the description will wildcard the entry.
- When using GET, you need to have %25 in front of the ID so it is accepted in the HTTP request. Ex: %25DEMO%
- If using POST with the parameters in the body, no need for the %25 in front. Ex: %DEMO%
- TPSearchEx – Search the ECGrid Network by qualifier and ID. % at the beginning/end of the qualifier and/or ID will wildcard the entry.