EML Transaction Simulator API
Overview
The Transaction Simulator API is used to simulate transaction activity for cardholder accounts and is only available in our Beta Environment
https://beta.emerchants.com.au/3.0/
.
You are able to simulate the following transaction scenarios:
- Transaction Authorisation
- Advice
- Reversal
- Clearing
- Clearing Reversal
Accounts
In order to use the transaction simulator you will be required to have active accounts setup and verified that these accounts:
- Are in an Active state
- Have been set to Plastic Enabled
Refer to the EML Account API documentation for more information on creating and managing accounts used to simulate transactions.
The Transaction Simulator API is provided by EML and can be used to simulate and test transaction activity on active accounts. If an account is invalid you will get an invalid account response or account is closed.
Authentication
An access token is required to consume the methods for the Transaction Simulator API. Refer to the Authentication documentation for further details on OAuth 2.0 and use the EML Token API documentation as a reference to obtaining an access token.
Important Usage Note
All JSON sent to and from the API must be sent with the Content-Type HTTP header set to application/vnd.eml+json. This is to prevent any confusion caused by intermediate proxies and gateways which may send application/json under some conditions.
REST Method Overview
The following methods are available for the Transaction Simulator REST API.
POST
/simulation/transact
- Create a transaction to return an authorisation response.
POST
/simulation/advice
- Create an advice to return an authorisation advice response.
POST
/simulation/reverse
- Create a reversal to return an authorisation reversal response.
POST
/simulation/clear
- Create clearing to return an transaction clearing response.
POST
/simulation/reverse_clear
- Create clearing reversal to return an transaction clearing reversal response.
Transact
Transact is the simulation endpoint where we perform a Transaction Purchase, Withdrawal and POS Credit.
API Endpoint
POST
https://beta.emerchants.com.au/3.0/simulation/transact
Example request
The transaction_type
can be set as either and will generate the transactions listed beside them
Purchase
- POS Authorisation Purchase (1118)Withdrawal
- ATM Cash Authorisation (1141) a valid ATM MCC like 6011 needs to be used for simulating WithdrawalsPosCredit
- POS Credit (1116)
The transaction_type
field is case sensitive and needs to match the above examples
It is recommended that you wait approx 30-90 seconds before attempting further transactions that are related to this request to allow backend processing to complete.
{
"transaction_type" : "Purchase",
"account_id": "Z8ZKW0TMA",
"amount": "0.05",
"bank_name" : "Westpac",
"location" : "Brisbane",
"location_code" : "AUS",
"currency_code" : "AUD",
"acquirer_id" : "584002598",
"merchant_id" : "123",
"terminal_id" : "456",
"mcc" : "0564"
}
200
Example response {
"transaction_reference": "5CE4A16509",
"authorization_id": "349078",
"success": true,
"message": "Authorisation succeeded with response code 00 (Approved)"
}
Advice
Advice is the simulation endpoint for when an adjustment is to be made to an existing POS Authorisation Purchase transaction that has occurred. This will generate POS Authorisation Purchase Reversal (1120) and a POS Authorisation Purchase (1118) Advice message if a POS Auth transaction exists with the provided attributes. If the transaction doesn't exist only a POS Authorisation Purchase (1118) Advice will be triggered
It is recommended that you wait approx 30-90 seconds before attempting further transactions that are related to this request to allow backend processing to complete.
API Endpoint
POST
https://beta.emerchants.com.au/3.0/simulation/advice
Example request
The authorization_id
is set from the /transact
response and the transaction_type
needs to match the original /transact
request
{
"account_id": "Z8ZKW0TMA",
"transaction_type" : "Purchase",
"amount": "0.01",
"bank_name" : "Westpac",
"location" : "Brisbane",
"location_code" : "AUS",
"currency_code" : "AUD",
"acquirer_id" : "584002598",
"merchant_id" : "123",
"terminal_id" : "456",
"mcc" : "0564",
"authorization_id": "349078"
}
200
Example response {
"authorization_id": "349078",
"success": true,
"message": "AuthAdvice succeeded with response code 00 (Approved)"
}
Reversal
Reversal is the simulation endpoint where we reverse the transaction that did not transact. This will generate a POS Authorisation Purchase Reversal (1120) if there is an existing POS Authorisation Purchase on record for the account with the attributes requested.
API Endpoint
POST
https://beta.emerchants.com.au/3.0/simulation/reverse
Example request
The authorization_id
is set from the /transact
response and the transaction_type
needs to match the original /transact
request
{
"transaction_type" : "Purchase",
"account_id": "Z8ZKW0TMA",
"amount": "0.51",
"bank_name" : "Westpac",
"location" : "Brisbane",
"location_code" : "AUS",
"currency_code" : "AUD",
"acquirer_id" : "584002598",
"merchant_id" : "123",
"terminal_id" : "456",
"mcc" : "0564",
"authorization_id": "349078"
}
200
Example response {
"authorization_id": "349078",
"success": true,
"message": "AuthReverse succeeded with response code 00 (Approved)"
}
Clearing
Clearing is the simulation endpoint where we settle the transaction from the /transact
endpoint response. This will generate a Clearing Credit Back (1117) and a POS Clearing (1115) transaction if there is an existing POS Authorisation Purchase on record for the account with the attributes requested. Otherwise if the transaction doesn't exist only a "Forced Post" POS Clearing (1115) will be generated.
Please note: /clearing
endpoint is an asynchronous process and may take a while to complete.
It is recommended that you wait approx 30-90 seconds before attempting further transactions that are related to this request.
API Endpoint
POST
https://beta.emerchants.com.au/3.0/simulation/clear
Example request
The authorization_id
is set from the /transact
response and the transaction_type
needs to match the original /transact
request
{
"account_id": "Z8ZKW0TMA",
"transaction_type" : "Purchase",
"amount": 0.12,
"authorization_id": "349078",
"mcc" : "0564",
"acquirer_id" : "584002598",
"merchant_id" : "123",
"terminal_id" : "456"
}
200
Example response {
"success": true,
"message": "Clearing Succeed"
}
Clearing Reversal
Clearing Reversal is the simulation endpoint where we reverse the cleared transaction that occurred from the /clear
endpoint response. This will generate a POS Clearing Reversal (1125) transaction
Please note: /reverse_clear
endpoint is an asynchronous process and may take a while to complete.
API Endpoint
POST
https://beta.emerchants.com.au/3.0/simulation/reverse_clear
Example request
The authorization_id
is set from the /transact
response and the transaction_type
needs to match the original /transact
request
{
"account_id": "Z8ZKW0TMA",
"transaction_type" : "Purchase",
"amount": 0.12,
"authorization_id": "349078",
"mcc" : "0564",
"acquirer_id" : "584002598",
"merchant_id" : "123",
"terminal_id" : "456"
}
200
Example response {
"success": true,
"message": "Clearing Reversal Succeed"
}
Errors
The Transaction Simulator API is used to simulate transactions for the various transaction scenarios as described above. Each scenario returns a series of response codes and ISO 8583 financial transaction messaging, please refer to our Error documentation for further details on the HTTP and transaction response codes you can expect.