B2B communication protocols

AS4: B2B messaging with web services security

AS4 is an OASIS standard for secure, reliable B2B messages using web services. It is used by e-invoicing and e-procurement networks, energy markets and government exchanges. ECOM sets up AS4 connections, certificates and receipts and maps the documents they carry.

Specification
OASIS AS4 profile of ebMS 3.0
Transport
SOAP over HTTPS
Message security
WS-Security signatures and encryption
Receipts
Signed receipts (non-repudiation)
Where AS4 fitsA hub diagram: e-invoicing networks, energy operators, government bodies and direct partners exchange AS4 messages with the ECOM B2B gateway, which handles WS-Security, push and pull, and signed receipts, passing mapped documents to your systems.Where AS4 fitsPartners, the ECOM gateway and your systemsAS4 COUNTERPARTIESE-invoicing networksEnergy operatorsGovernmentDirect partnersYOUR SYSTEMSERPWarehouse (WMS)FinanceOther partnersECOM B2B gatewayAS4SOAP + WS-SecurityPush and pullSigned receipts
Where AS4 fitsA hub diagram: e-invoicing networks, energy operators, government bodies and direct partners exchange AS4 messages with the ECOM B2B gateway, which handles WS-Security, push and pull, and signed receipts, passing mapped documents to your systems.Where AS4 fitsPartners, the ECOM gateway and your systemsAS4 COUNTERPARTIESE-invoicing networksEnergy operatorsGovernmentDirect partnersECOM B2B gatewayAS4SOAP +WS-SecurityPush and pullSigned receiptsYOUR SYSTEMSERPWarehouse (WMS)FinanceOther partners

AS4 counterparties exchange secure, receipted messages with the gateway.

Expand diagram Download SVG

Overview

What AS4 is

AS4 is a profile of the ebXML Messaging Services 3.0 standard. It packages business documents as attachments to a SOAP message, signs and encrypts them with WS-Security, and returns a signed receipt. It adds reliability features such as retries and duplicate detection.

Unlike AS2, AS4 supports both push, where the sender delivers the message, and pull, where the receiver collects waiting messages, which helps partners that cannot accept incoming connections. Networks build their own profiles on top of AS4, specifying algorithms, identifiers and processes.

Where businesses use it

  • E-invoicing networks

    Some e-invoicing and e-procurement networks, such as Peppol, use AS4 between their access points.

  • Energy markets

    Gas transmission operators in Europe exchange data using AS4 profiles.

  • Government and customs

    Public-sector exchanges that require web services security.

How it works

How an AS4 exchange works

The sender builds a SOAP envelope with an ebMS header naming the parties, service and action, attaches the business document, signs it and encrypts the attachment, and posts it over HTTPS. The receiver verifies, decrypts and returns a signed receipt as a signal message.

With pull, the sender places the message on its server, and the receiver sends a pull request to collect it. Retries and duplicate detection make delivery reliable even when a connection drops.

An AS4 push message and receiptA sequence diagram: the sender builds a SOAP message with an ebMS header, signs and encrypts it with WS-Security, posts it over HTTPS, the receiver verifies and decrypts it and returns a signed receipt; on failure the sender retries.An AS4 push message and receiptSign, encrypt, send, receiptSenderHTTPSReceiverSOAP + ebMS header, WS-SecurityUser message (push)Verify, decrypt, check duplicatesSigned receipt (signal message)Retry if no receipt
An AS4 push message and receiptA sequence diagram: the sender builds a SOAP message with an ebMS header, signs and encrypts it with WS-Security, posts it over HTTPS, the receiver verifies and decrypts it and returns a signed receipt; on failure the sender retries.An AS4 push message andreceiptSign, encrypt, send, receiptSenderHTTPSReceiverSOAP + ebMS header,WS-SecurityUser message (push)Verify, decrypt, checkduplicatesSigned receipt (signalmessage)Retry if no receipt

The receipt proves delivery. If none arrives, the sender retries; the receiver discards duplicates.

Expand diagram Download SVG

In depth

AS4 security and reliability

  • WS-Security

    XML signatures protect integrity and origin; encryption protects the payload. Network profiles set the algorithms.

  • TLS

    HTTPS protects the connection; WS-Security protects the message itself, so both layers apply.

  • Receipts

    Signed receipts give non-repudiation of receipt, much like signed MDNs in AS2.

  • Push and pull

    Pull lets partners without a public endpoint collect their messages.

  • Reliability

    Retries, duplicate elimination and error signals are part of the profile.

  • Network profiles

    Each network defines identifiers, certificates and processes; some require registered or certified participants, confirmed during scoping.

In practice

Example: exchanging documents on an AS4-based network

A company exchanges documents with partners on a network whose profile is based on AS4.

Example: exchanging documents on an AS4-based networkFive steps: confirm the network profile, set up the AS4 endpoint, map the documents, test with receipts, and operate with monitoring.Example: exchanging documents on an AS4-based networkA practical example, step by step1Confirm theprofileIdentify thenetwork's profile,certificates andparticipation rules.Step 12Set up theendpointConfigure the AS4endpoint, keys andpartner details.Step 23Map thedocumentsMap the network'sdocument format toyour ERP.Step 34TestExchange testmessages andverify receipts.Step 45OperateMonitor receipts,retries andcertificate dates.Step 5
Example: exchanging documents on an AS4-based networkFive steps: confirm the network profile, set up the AS4 endpoint, map the documents, test with receipts, and operate with monitoring.Example: exchanging documentson an AS4-based networkA practical example, step by step1Confirm the profileIdentify the network's profile,certificates and participation rules.Step 12Set up the endpointConfigure the AS4 endpoint, keys andpartner details.Step 23Map the documentsMap the network's document format toyour ERP.Step 34TestExchange test messages and verifyreceipts.Step 45OperateMonitor receipts, retries and certificatedates.Step 5

The network's profile decides most technical settings; mapping decides how documents reach your ERP.

Expand diagram Download SVG

Connections

How AS4 connects your business

  • Networks and partners

    AS4 connections to networks and direct partners.

  • Document formats

    The XML documents carried, such as e-invoices, are mapped to your systems.

  • ERP

    Invoices and orders reach your ERP.

  • Monitoring

    Receipts and errors are tracked.

ECOM

How ECOM supports AS4

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

  • Implementation team

    Plans the AS4 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 AS4 in particular

  • AS4 endpoint, certificate and receipt setup to the network or partner profile.
  • Mapping of the documents AS4 carries, such as XML invoices, to your ERP.
  • Partner onboarding for AS4: 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

What is the difference between AS2 and AS4?

Both send business documents securely with receipts. AS2 uses S/MIME over HTTP. AS4 uses SOAP web services with WS-Security, supports pull as well as push, and has built-in reliability features.

Who uses AS4?

Networks and markets that adopted it in their profiles, such as some e-invoicing networks, European energy operators and government exchanges.

Can ECOM connect us to an AS4 network?

ECOM confirms the network's profile and participation rules during scoping, including whether a registered or certified participant is required, and sets up the connection accordingly.

Does AS4 replace AS2?

Not generally. AS2 remains common in supply chains; AS4 is used where a network or market requires it.

Talk to an EDI/API Expert

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