B2B communication protocols

REST API integration

REST APIs are how most cloud applications, online stores and marketplaces share data. ECOM calls and exposes REST APIs, handles authentication, paging, limits and retries, and maps API data to EDI partners and your ERP.

Style
Resources and HTTP methods
Data
Usually JSON
Authentication
OAuth 2.0, API keys, tokens
Contracts
Often OpenAPI definitions
Where REST APIs fitsA hub diagram: marketplaces, online stores, SaaS apps and partner APIs exchange REST calls and webhooks with the ECOM B2B gateway, which handles tokens, paging, limits and JSON mapping for the ERP, EDI partners, 3PL and finance.Where REST APIs fitsPartners, the ECOM gateway and your systemsAPI PLATFORMSMarketplacesOnline storesSaaS appsPartner APIsYOUR SYSTEMSERPEDI partners3PL and WMSFinanceECOM B2B gatewayREST APIsAuth and tokensPaging and limitsMap JSON
Where REST APIs fitsA hub diagram: marketplaces, online stores, SaaS apps and partner APIs exchange REST calls and webhooks with the ECOM B2B gateway, which handles tokens, paging, limits and JSON mapping for the ERP, EDI partners, 3PL and finance.Where REST APIs fitsPartners, the ECOM gateway and your systemsAPI PLATFORMSMarketplacesOnline storesSaaS appsPartner APIsECOM B2B gatewayREST APIsAuth and tokensPaging and limitsMap JSONYOUR SYSTEMSERPEDI partners3PL and WMSFinance

The gateway handles the mechanics of each API and maps the data to the rest of your business.

Expand diagram Download SVG

Overview

What REST APIs is

A REST API organizes data as resources, such as /orders or /products/123, and uses HTTP methods to work with them: GET to read, POST to create, PUT or PATCH to update, DELETE to remove. Data is usually JSON.

Each API has its own rules: how to authenticate, how many requests per minute are allowed, how long lists are split into pages, and how errors are reported. Integration means handling all of these reliably.

Where businesses use it

  • Marketplaces and online stores

    Orders, inventory, prices and shipments through platform APIs.

  • Cloud ERP and SaaS

    Reading and writing records in cloud ERPs, CRMs and shipping tools.

  • Partner APIs

    Partners that offer APIs in addition to or instead of EDI.

How it works

How a REST integration works

The client obtains a token, for example with OAuth 2.0 client credentials, and calls endpoints with it. Lists come back in pages; the client follows the next-page cursor until it has everything. Responses use HTTP status codes: 2xx success, 4xx client errors, 429 too many requests, 5xx server errors.

APIs can also push events with webhooks, calling your URL when an order is created, which avoids constant polling.

Polling orders from a REST APIA sequence diagram: the gateway requests an OAuth token, calls GET /orders with the token, receives a first page and a cursor, requests the next page, receives a 429 rate limit response, waits and retries.Polling orders from a REST APIToken, pages, limitsECOM gatewayAuth serverREST APIRequest token (OAuth 2.0)Access tokenGET /orders?updatedSince=...200: page 1 + next cursorGET next page429: wait, then retry
Polling orders from a REST APIA sequence diagram: the gateway requests an OAuth token, calls GET /orders with the token, receives a first page and a cursor, requests the next page, receives a 429 rate limit response, waits and retries.Polling orders from a REST APIToken, pages, limitsECOMgatewayAuth serverREST APIRequest token (OAuth 2.0)Access tokenGET/orders?updatedSince=...200: page 1 + next cursorGET next page429: wait, then retry

The token is reused until it expires. Pages are followed to the end, and rate limits are respected by waiting before retrying.

Expand diagram Download SVG

In depth

REST integration in practice

  • Authentication

    OAuth 2.0 flows, API keys and signed requests, with secrets stored securely and tokens refreshed.

  • Pagination

    Cursor, offset and page-number styles are followed to the last page.

  • Rate limits

    429 responses and limit headers are respected with waits and backoff.

  • Idempotency and duplicates

    Idempotency keys or existence checks stop retries from creating duplicates.

  • Change detection

    Updated-since filters or webhooks pick up only new and changed records.

  • Versions

    API version changes are tracked and maps updated before old versions retire.

In practice

Example: marketplace orders to a retailer-style EDI flow

A seller takes orders on a marketplace API and fulfills them through a 3PL that uses EDI.

Example: marketplace orders to a retailer-style EDI flowFive steps: collect orders from the marketplace API, map each to an X12 940, send it to the 3PL by AS2, receive the 945 shipment advice, and post tracking back to the marketplace API.Example: marketplace orders to a retailer-style EDI flowA practical example, step by step1Collect ordersNew orders are readfrom themarketplace API.Step 12Map to EDIEach order becomesan X12 940warehouse order.Step 23Send to the3PLThe 940 goes to the3PL by AS2.Step 34ReceiveshipmentThe 3PL's 945comes back withtracking.Step 45Update theAPITracking is postedto the marketplace.Step 5
Example: marketplace orders to a retailer-style EDI flowFive steps: collect orders from the marketplace API, map each to an X12 940, send it to the 3PL by AS2, receive the 945 shipment advice, and post tracking back to the marketplace API.Example: marketplace orders toa retailer-style EDI flowA practical example, step by step1Collect ordersNew orders are read from themarketplace API.Step 12Map to EDIEach order becomes an X12 940warehouse order.Step 23Send to the 3PLThe 940 goes to the 3PL by AS2.Step 34Receive shipmentThe 3PL's 945 comes back withtracking.Step 45Update the APITracking is posted to the marketplace.Step 5

APIs on one side, EDI on the other, with the gateway mapping between them.

Expand diagram Download SVG

Connections

How REST APIs connects your business

  • Cloud platforms

    Marketplaces, stores and SaaS applications.

  • EDI partners

    API data becomes EDI documents and back.

  • ERP

    Records are created and updated through ERP APIs or files.

  • Events

    Webhooks and queues trigger flows as events happen.

ECOM

How ECOM supports REST APIs

ECOM supports REST APIs with dedicated implementation, mapping, communication and support teams, and with specialists who know the industries your partners work in.

  • Implementation team

    Plans the REST APIs setup with you, configures it on the gateway and runs the tests with your partners and systems.

  • Mapping team

    Builds and maintains the maps, code conversions and validation rules between partner data and your applications.

  • Communication team

    Sets up and monitors partner connections, certificates, keys and credentials, and coordinates changes with each partner.

  • Support team

    Watches the flows, investigates failed or missing documents, and works the issue through with you and your partner.

For REST APIs in particular

  • API clients and endpoints with authentication, paging, rate-limit and retry handling.
  • Mapping between API JSON and EDI, files and your ERP.
  • Partner onboarding for REST APIs: exchanging connection details, testing in both directions and confirming the go-live date with each partner.
  • Monitoring of every connection, with alerts for failed, missing or unacknowledged transfers.

Frequently asked questions

Can REST APIs replace EDI?

Sometimes, when both partners offer APIs. Many partners still require EDI, so most companies run both, and the gateway maps between them.

How do you handle API rate limits?

Requests are paced to stay within limits, and 429 responses are handled by waiting and retrying with backoff.

What authentication methods are supported?

Common methods such as OAuth 2.0, API keys, bearer tokens and client certificates, as each API requires.

Can ECOM expose an API for our partners?

Yes. The gateway can expose REST endpoints and map requests to your systems.

Talk to an EDI/API Expert

Tell us which partners, systems and REST APIs requirements you are working with. An ECOM specialist will review them with you and outline the setup, the maps and the tests.