Skip to main content

ParcelUpload

Upload an EDI file to ECGrid as a parcel for outbound delivery to trading partners.

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

Method Signature

long ParcelUpload(string SessionID, string FileName, int Bytes, base64Binary Content)

Parameters

ParameterTypeRequiredDescription
SessionIDstringYesActive session token from Login()
FileNamestringYesOriginal file name (used for logging and identification)
BytesintYesFile size in bytes
Contentbase64BinaryYesBase64-encoded EDI file content

Response Object — long

Returns the newly assigned ParcelID (long integer) on success.

<!-- Example response XML -->
<ParcelUploadResult>9876545</ParcelUploadResult>

Variants

ParcelUploadEx

Uploads a parcel with an explicit mailbox context, bypassing the session default. Use this when the authenticated session has access to multiple mailboxes and you need to send on behalf of a specific one.

long ParcelUploadEx(string SessionID, int NetworkID, int MailboxID,
string FileName, int Bytes, base64Binary Content)
Additional ParameterTypeDescription
NetworkIDintNetwork ID of the sending mailbox
MailboxIDintMailbox ID to send from

ParcelUploadMft

Uploads a parcel with explicit sender and recipient ECGrid IDs for direct routing. Use when the routing cannot be inferred from the EDI envelope or when overriding the default routing.

long ParcelUploadMft(string SessionID, string FileName, int Bytes,
base64Binary Content, int ECGridIDFrom, int ECGridIDTo)
Additional ParameterTypeDescription
ECGridIDFromintSender ECGrid ID
ECGridIDTointRecipient ECGrid ID

Code Examples

// .NET 10 — dotnet-svcutil generated proxy
// Read a local EDI file and upload it as a parcel
using var client = new ECGridOSPortTypeClient();

var filePath = "/data/edi/outbound/invoice.edi";
var fileBytes = await File.ReadAllBytesAsync(filePath);
var fileName = Path.GetFileName(filePath);

long parcelId = await client.ParcelUploadAsync(
sessionID,
fileName: fileName,
bytes: fileBytes.Length,
content: fileBytes);

Console.WriteLine($"Uploaded parcel ID: {parcelId}");

// Use ParcelUploadEx to send from a specific mailbox
long parcelIdEx = await client.ParcelUploadExAsync(
sessionID,
networkID: 1,
mailboxID: 101,
fileName: fileName,
bytes: fileBytes.Length,
content: fileBytes);

REST Equivalent

See Upload Parcel.