add partner icon

Partner Types: Test vs. Production

Version: latest

This feature caters for a very specific use case; if you are simply setting up a connection for directly exchanging production messages, you can most probably ignore this entire section.
If the partner already maintains two AS2 IDs for the two environments, the test/prod feature being discussed here is no longer applicable.

Use case scenario

Some trading partners prefer to maintain their test/UAT and production (prod) messages separate. This is usually achieved by having two AS2 partner configurations on their systems, which corresponds to having two trading stations on AS2 Gateway side.

  • However, for obvious reasons, these two remotely defined partners often have identical configurations - including messaging settings (encryption, signing etc.), partner certificates, and AS2 IDs.

  • Trading systems often send messages to both these endpoints from the same AS2 station on their side - again for obvious reasons of maintaining similar configurations on both test and production channels.

As such, the only difference between test and prod might be the endpoint/URL to which each message type would be sent.

This poses two problems for AS2 Gateway users:

  • AS2 Gateway needs each of its AS2 stations to have a unique AS2 ID (because it has to uniquely associate each incoming message with exactly one station). Hence it is not possible to create a "test station" and "prod station" corresponding to the two remote partners that are present in the partner system.

  • With both test and prod messages coming in, from the same source AS2 ID (AS2-From, i.e. station AS2 ID on remote system), to the same target ID (AS2-To, i.e. partner AS2 ID configured on remote system), AS2 Gateway has no way of distinguishing test and prod messages.

Test/Production partner types

To mitigate the above problems, AS2 Gateway provides a mechanism to distinguish test and prod messages based on the incoming URL. Messages sent to the test URL will get associated with a "test" partner on the AS2 Gateway side, and those hitting the production URL will go under a "production" partner.

  • This way, the remote partner only has to vary the destination URL in his side, and AS2 Gateway will correctly identify and separate out incoming test and production messages.

  • Since AS2 Gateway now has two distinct partner configurations, you have the flexibility to configure outgoing messages for the two environments in whatever desired combination - either maintain identical configurations, or allow for variations (e.g. endpoint/URL and certificates).

Configuring test and/or production partners

Each type involves the same steps. Following are for a test partner; for prod, follow the same steps by interpreting "test" as "prod".

  • Your trading partner sends you his partner configuration or profile (details of a local trading station defined on their side)

  • You define a test-type trading partner on AS2 Gateway, using the above information

  • You define a trading station on AS2 Gateway, in the usual manner

  • You send the partner configuration (profile) of this trading station to your trading partner, and instruct them to send messages to the test URL mentioned in it

Once testing is complete, you can either:

  • change the partner type to production: this would be applicable for most cases, where you would usually run in "production" mode once the setting up is complete - so that there would be no more "test" messages; or,

  • define a new partner of type production, probably with an identical configuration to the existing test partner: this would be useful if you intend to continue to exchange test messages alongside production traffic (for sanity purposes etc.)

In either case, in order to receive messages under the prod partner, you need to instruct your trading partner to start sending messages to the prod URL.


If your partner on AS2 Gateway is defined with type test but the partner system is sending messages to the prod URL (or vice versa), AS2 Gateway will reject these messages with HTTP 422 (unprocessable entry) errors; containing the plaintext response:

A PROD type AS2 Partner with the AS2 identifier <partner AS2 ID> is not found. Please try the TEST URL.

In such cases, the simplest solution is to switch the partner’s type on AS2 Gateway from test to production. Once you do that, your partner should be able to send messages to you, without making any changes to the current (prod) URL configured on their side.

Alternatively, you can also instruct your trading partner to switch the partner URL on their side, from test (with hostname to prod (with hostname

Difference between test and production partners and messages

From AS2 Gateway perspective, test and prod are two distinct partners - even though they have the same AS2 ID.

Accordingly, there is no specific distinction between test and prod messages; they are simply messages received under two trading partners.

However, since both partners have the same AS2 ID, your inbox/outbox will display messages from both partners - even when you filter them by the AS2 ID. To mitigate this, AS2 Gateway provides a Partner Type filter. Using this, you can choose to view either test or production messages only.

Message Filter button on inbox header

From the billing perspective as well, there is no "test" vs "production" messages distinction; both will count towards your monthly quota (and excess).

In this topic
In this topic