Skip to main content

Upload Parcel

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

Endpoint

POST /v2/parcels/upload

Request Body

FieldTypeRequiredConstraintsDescription
fileNamestringYesNon-emptyName of the EDI file being uploaded
contentstringYesBase64-encodedEDI file content encoded as a Base64 string
bytesintNoSize of the file in bytes
ecGridIdFromintNoSender ECGrid ID; overrides ISA sender qualifier if provided
ecGridIdTointNoRecipient ECGrid ID; overrides ISA receiver qualifier if provided
mailboxIdintNoMailbox to send from; defaults to the authenticated user's mailbox

:::info Routing Behavior When ecGridIdFrom and ecGridIdTo are omitted, ECGrid automatically routes the parcel based on the ISA segment sender and receiver qualifiers embedded in the EDI content. :::

{
"fileName": "po_batch_20260507.edi",
"content": "SVFU4OiogU2VuZGluZyBFREkgZGF0YSB2aWEgRUNHcmlk...",
"bytes": 4096,
"ecGridIdFrom": 112233,
"ecGridIdTo": 445566,
"mailboxId": 1001
}

Response

Returns the parcelId (long) of the newly created outbound parcel.

{
"success": true,
"data": 987654322
}

Code Examples

curl -X POST "https://rest.ecgrid.io/v2/parcels/upload" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "fileName": "po_batch_20260507.edi", "content": "SVFU4OiogU2VuZGluZyBFREkgZGF0YSB2aWEgRUNHcmlk...", "bytes": 4096, "ecGridIdFrom": 112233, "ecGridIdTo": 445566, "mailboxId": 1001 }'

See Also