Moneris GO PHPReaction API Specification
API Specification for the PHPReaction Moneris GO.
Summary of the process and the feature
PHPReaction itself does not process any transaction requests, but instead use the moneris-go-integration middleware to process them. PHPReaction is simply used because it stores the API Token, removing the responsibility from the frontend and potentially increasing security because then the token is hidden from everyone, including the employees of the merchant. PHPReaction also generates the postback url for the transaction, so that the payment is created in the right ERP and the right invoice. Using the PHPReaction API backend also allows for access control.
Requirements
To use the API, you should always make a request to the NextJS backend, which will make the authenticated request to PHPR. The Moneris GO
request endpoint requires a valid JWT Token and that the user has the ROLE_MOD_INVOICE_PAYMENT_ADD role. Moneris GO feature should also
be enabled by KVS in the ERP. The call to the Next JS backend on payment form submission must have CSRF protection.
Supported transactions
As of 2025-03-27, only these transactions are supported by the PHPReaction Moneris GO middleware:
-
Financial transactions
- Purchase
- Void
- Refund
- Independent Refund
-
Gift Cards
- Balance Inquiry
- Activate card
- Deactivate card
Notes: This will be updated with the transactions we are allowed by Moneris to make. For now it lists everything the middleware itself can do, not what we are authorized to do.
Transactions requests
All transactions requests to the PHPReaction API.
Request endpoint
The endpoint for the request is the following: https://\{tenant\}.phpreaction.com/open-api/v3/moneris-go/request.
Request headers
These are the common headers for all requests to the Moneris GO endpoint:
Authorization: Bearer token authorization (User’s JWT).X-Store-ID: Merchant’s store ID.X-Terminal-ID: Merchant’s terminal ID.
Context data
The contextData field in the request contains all parameters necessary for the context of the transaction. This is a custom field only for PHPR.
Everything in this custom field will be sent back to PHPR on transaction’s completion. It will be used to create the payment.
Mandatory context params:
invoiceId: Invoice IDpaymentTypeId: Payment type IDemployeeId: Logged in employee ID
Purchase request
Purchase (payment) request.
{
"action": "purchase",
"amount": "0.01",
"contextData": {
"invoiceId": 1,
"paymentTypeId": 1,
"employeeId": 1
},
"employeeCode": "E1",
"linkId": "I99"
}Void request
Void request. This transaction needs the purchase transaction reference.
{
"action": "void",
"orderId": "orderId",
"transactionId": "transactionId",
"contextData": {
"invoiceId": 1,
"paymentTypeId": 1,
"employeeId": 1
},
"employeeCode": "E1",
"linkId": "I99"
}Refund request
Refund request. This transaction needs the purchase transaction reference.
{
"action": "refund",
"amount": "0.01",
"orderId": "orderId",
"transactionId": "transactionId",
"contextData": {
"invoiceId": 1,
"paymentTypeId": 1,
"employeeId": 1
},
"employeeCode": "E1",
"linkId": "I99"
}Independent Refund request
Independent Refund request. This is a refund but without any reference. Might need a specific parameter for Visa cards, TBD.
{
"action": "independentRefund",
"amount": "0.01",
"contextData": {
"invoiceId": 1,
"paymentTypeId": 1,
"employeeId": 1
},
"employeeCode": "E1",
"linkId": "I99"
}Balance Inquiry request
Balance inquiry request. This only output the remaining amount of a gift card on the terminal.
{
"action": "balanceInquiry",
"contextData": {
"invoiceId": 1,
"paymentTypeId": 1,
"employeeId": 1
},
"employeeCode": "E1",
"linkId": "I99"
}Activate Gift Card request
Activate Gift Card request.
Will trigger a getTrack request on the terminal to get the cardNumber, which will demand to swipe the card.
{
"action": "activate",
"amount": "10.00",
"cvc": "123",
"contextData": {
"invoiceId": 1,
"paymentTypeId": 1,
"employeeId": 1
},
"employeeCode": "E1",
"linkId": "I99"
}Deactivate Gift Card request
Deactivate Gift Card request.
Will trigger a getTrack request on the terminal to get the cardNumber, which will demand to swipe the card.
{
"action": "deactivate",
"cvc": "123",
"contextData": {
"invoiceId": 1,
"paymentTypeId": 1,
"employeeId": 1
},
"employeeCode": "E1",
"linkId": "I99"
}