Skip to main content

REST vs SOAP — Choosing the Right API

ECGrid exposes two APIs covering the same EDI platform. This guide helps you decide which one to use for your integration.

At a Glance

FeatureREST API (v2.6)SOAP API (v4.1)
StatusActiveEstablished
ProtocolHTTPS + JSONHTTPS + XML
AuthenticationAPI Key (X-API-Key header) or Bearer JWTSessionID string from Login() or API Key
Client generationAny HTTP client or OpenAPI code generatordotnet-svcutil or manual HttpClient
Endpoint count121 endpoints across 16 resource groups~242 methods across comparable groups
Error formatJSON ApiErrorResponseSOAP Fault + ECGridOSSOAPErrorCode
New featuresYes — actively developedNo — Critical only
OpenAPI / SwaggerYes — https://rest.ecgrid.io/swagger/v2/swagger.jsonNo
Response formatJSONXML

Use the REST API When…

  • Starting a new integration from scratch
  • Building a web application, mobile app, or microservice
  • You want standard HTTP tooling (Postman, curl, OpenAPI generators)
  • You need access to newer capabilities (Portals, enhanced reporting, etc.)
  • You want predictable JSON error responses and HTTP status codes

Use the SOAP API When…

  • You have an existing SOAP integration and the cost of migration outweighs the benefit
  • Your workflow depends on a specific established SOAP method that has no direct REST equivalent
  • You are in a regulated environment that has already certified against the SOAP interface and cannot change

Feature Parity Overview

The two APIs cover the same core resources. The table below maps top-level resource groups.

ResourceRESTSOAPNotes
Auth / SessionsPOST /v2/auth/loginLogin()Different auth model — see below
Networks/v2/networksNetworkInfo(), etc.Full parity
Mailboxes/v2/mailboxesMailboxInfo(), etc.Full parity
IDs (Trading Partners)/v2/idsTPInfo(), etc.Full parity
Partners (Interconnects)/v2/partnersInterconnectXxx()Full parity
Parcels/v2/parcelsParcelXxx()Full parity
Interchanges/v2/interchangesInterchangeXxx()Full parity
Callbacks/v2/callbacksCallBackXxx()Full parity
Carbon Copies/v2/carbon-copiesCarbonCopyXxx()Full parity
Certificates/v2/certificatesCertificateXxx()Full parity
Comms/v2/commsCommXxx()Full parity
Users/v2/usersUserXxx()Full parity
Keys/v2/keysKeyXxx()Full parity
Portals/v2/portalsREST only
Reports/v2/reportsReportXxx()Full parity
Status Lists/v2/status-listsStatusList()Full parity

Authentication Differences

REST and SOAP use fundamentally different authentication models.

REST uses a stateless, header-based approach:

X-API-Key: your-api-key-here

Or a short-lived JWT obtained from POST /v2/auth/login:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

SOAP uses a stateful session token:

// Every SOAP method takes a SessionID as its first parameter
var parcelList = await client.ParcelInBoxAsync(sessionID, mailboxID, ...);

Sessions must be explicitly created (Login()) and destroyed (Logout()). They expire after inactivity.

See Authentication & Session Management for a full deep-dive.

Migrating from SOAP to REST

If you have an existing SOAP integration and want to move to REST, see the Migration Guide. It includes a method mapping table and before/after C# examples.