Skip to main content

ParcelDownload

Download the raw EDI content of an inbound parcel by its ID.

:::caution Established API The SOAP API is in maintenance mode. For new integrations use the REST equivalent. :::

:::tip Confirm After Every Download Always call ParcelDownloadConfirm after successfully saving the file. Without confirmation, ECGrid treats the parcel as undelivered and will re-deliver it on the next poll cycle. :::

Method Signature

base64Binary ParcelDownload(string SessionID, long ParcelID)

Parameters

ParameterTypeRequiredDescription
SessionIDstringYesActive session token from Login()
ParcelIDlongYesUnique identifier of the parcel to download

Response Object — base64Binary

Returns the raw EDI file content encoded as a Base64 binary string. Decode the bytes and write them to disk before calling confirm.

<!-- Example response XML (content truncated) -->
<ParcelDownloadResult>SVNBKjAwKjAwMDAwMDAwMDAq...</ParcelDownloadResult>

Code Examples

// .NET 10 — dotnet-svcutil generated proxy
// Download a parcel, save to disk, then confirm receipt
using var client = new ECGridOSPortTypeClient();

// Fetch the file bytes (returned as base64Binary / byte[])
byte[] content = await client.ParcelDownloadAsync(sessionID, parcelId: 9876543L);

// Persist to the local outbound staging directory
var outputPath = Path.Combine("/data/edi/inbound", $"{parcelId}.edi");
await File.WriteAllBytesAsync(outputPath, content);

Console.WriteLine($"Saved {content.Length} bytes to {outputPath}");

// Always confirm immediately after a successful save
bool confirmed = await client.ParcelDownloadConfirmAsync(sessionID, parcelId: 9876543L);
if (!confirmed)
{
// Log warning — the parcel will be re-delivered on the next poll
Console.Error.WriteLine("Warning: confirmation failed for parcel {parcelId}");
}

REST Equivalent

See Download Parcel.