Moneris REST gateway guide
Quick Start
New to integrating Moneris REST with Spreedly? Here's your setup guide:
- Retrieve your Moneris REST credentials
- Contact the Moneris REST support team to obtain API credentials
- Get familiar with the Spreedly API
- Review Spreedly API basics
- Understand the core concepts: Gateways, Payment Methods, and Transactions
- Add Moneris REST gateway to Spreedly in sandbox mode
Review this documentation to understand more about how to test transactions.
| Additional notes |
|---|
Required credentials: Endpoints: Test API version: Region / country: North America, Canada ( Default currency: Supported card brands: Visa, Mastercard, American Express, Diners Club, Discover. Supported payment methods: credit card, third-party token (Moneris Vault), Apple Pay, Google Pay.
Capture completes an authorization via Void cancels an authorization/purchase via Refund (credit) and general credit (unreferenced refund) post to Verify performs a 0-amount validation via Store / Remove vault a card via Inquire re-syncs a transaction's status via Apple Pay / Google Pay are supported as decrypted wallet payloads (device token + 3DS cryptogram, or PAN_ONLY for Google Pay). |
Adding a Moneris REST Gateway
REQUEST
curl https://core.spreedly.com/v1/gateways.xml \
-u 'EnvironmentKey:AccessSecret' \
-H 'Content-Type: application/xml' \
-d '<gateway>
<gateway_type>moneris_rest</gateway_type>
<client_id>your_client_id</client_id>
<client_secret>your_client_secret</client_secret>
<merchant_id>your_merchant_id</merchant_id>
</gateway>'RESPONSE
<gateway>
<token>XXXXXXXXXXXXXXXXXXXXXXXXXX</token>
<gateway_type>moneris_rest</gateway_type>
<name>Moneris REST</name>
<description nil="true"/>
<merchant_id>your_merchant_id</merchant_id>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_partial_capture type="boolean">true</supports_partial_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_partial_credit type="boolean">true</supports_partial_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_verify type="boolean">true</supports_verify>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_3dsecure_2_mpi_purchase type="boolean">true</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">true</supports_3dsecure_2_mpi_authorize>
<supports_inquire_by_gateway_transaction_id type="boolean">true</supports_inquire_by_gateway_transaction_id>
</characteristics>
<credentials>
<credential>
<name>client_id</name>
<value>your_client_id</value>
</credential>
<credential>
<name>merchant_id</name>
<value>your_merchant_id</value>
</credential>
</credentials>
<gateway_specific_fields>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>invoice_number</gateway_specific_field>
<gateway_specific_field>dynamic_descriptor</gateway_specific_field>
<gateway_specific_field>ecommerce_indicator</gateway_specific_field>
<gateway_specific_field>cust_id</gateway_specific_field>
<gateway_specific_field>reason</gateway_specific_field>
<gateway_specific_field>store_payment_method</gateway_specific_field>
<gateway_specific_field>payment_indicator</gateway_specific_field>
<gateway_specific_field>payment_information</gateway_specific_field>
<gateway_specific_field>network_transaction_id</gateway_specific_field>
<gateway_specific_field>wallet_indicator</gateway_specific_field>
<gateway_specific_field>final_completion</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>google_pay</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">true</sandbox>
</gateway>Required Credentials
client_id: OAuth2 client id for the client-credentials grant.client_secret: OAuth2 client secret (stored encrypted).merchant_id: Your Moneris merchant id, sent as the X-Merchant-Id header on every request.
Purchase
curl https://core.spreedly.com/v1/gateways/[gateway_token]/purchase.json \
-u 'EnvironmentKey:AccessSecret' \
-H "Content-Type: application/json" \
-d '{
"transaction": {
"payment_method_token": "payment_method_token",
"amount": 1000,
"currency_code": "CAD",
"order_id": "ABC123",
"retain_on_success": true,
"gateway_specific_fields": {
"moneris_rest": {
"cust_id": "test1234",
"invoice_number": "INV001"
}
}
}
}'
Note
order_idis mapped to Moneris'sorderId.amountis sent in cents underamount.amountwithamount.currency=CAD.
Gateway Specific Fields
<gateway_specific_fields>
<moneris_rest>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>invoice_number</gateway_specific_field>
<gateway_specific_field>dynamic_descriptor</gateway_specific_field>
<gateway_specific_field>ecommerce_indicator</gateway_specific_field>
<gateway_specific_field>cust_id</gateway_specific_field>
<gateway_specific_field>reason</gateway_specific_field>
<gateway_specific_field>store_payment_method</gateway_specific_field>
<gateway_specific_field>payment_indicator</gateway_specific_field>
<gateway_specific_field>payment_information</gateway_specific_field>
<gateway_specific_field>network_transaction_id</gateway_specific_field>
<gateway_specific_field>wallet_indicator</gateway_specific_field>
<gateway_specific_field>final_completion</gateway_specific_field>
</moneris_rest>
</gateway_specific_fields>- payment_indicator / payment_information / network_transaction_id: credential-on-file fields, used together to chain a stored credential (see Stored Credentials (via Gateway Specific Fields)). Only forwarded when transacting against a stored (vault) token.
- store_payment_method: controls how the card is vaulted on a
store(defaults toMERCHANT_INITIATED). - idempotency_key: safe-retry key; Spreedly auto-generates one when omitted.
- wallet_indicator: Apple Pay / Google Pay channel (
IN_APPLICATIONorIN_BROWSER). - final_completion: on a partial
capture, marks the final capture of a multi-capture authorization (finalCompletion).
The Moneris request field each maps to is shown in parentheses.
| Field Name | Type | Required | Applies To | Description | Example Value |
|---|---|---|---|---|---|
| idempotency_key | String | No | All | Merchant-supplied idempotency key (idempotencyKey). Spreedly auto-generates one when omitted. | abc-123 |
| invoice_number | String | No | Purchase, Authorize, Capture | Merchant invoice number (invoiceNumber). | INV001 |
| dynamic_descriptor | String | No | Purchase, Authorize, Verify | Descriptor shown on the cardholder statement (dynamicDescriptor). | Booking1 |
| ecommerce_indicator | String | No | Purchase, Authorize, Verify | E-commerce indicator enum (ecommerceIndicator), e.g. SSL_MERCHANT. For 3DS transactions Spreedly derives this automatically. | SSL_MERCHANT |
| cust_id | String | No | Purchase, Authorize, Store | Merchant customer id (customerId). | test1234 |
| reason | String | No | Void, Refund, Credit | Reason code for the operation (reason), typically used on void/refund. | CUSTOMER_CANCELLATION |
| store_payment_method | String | No | Store | Vault storage intent (paymentMethod.storePaymentMethod); defaults to MERCHANT_INITIATED. | CARDHOLDER_INITIATED |
| payment_indicator | String | No | All | Credential-on-file indicator (credentialOnFileInformation.paymentIndicator), e.g. MERCHANT_INITIATED, UNSCHEDULED_CREDENTIAL_ON_FILE. | MERCHANT_INITIATED |
| payment_information | String | No | All | Credential-on-file sequence (credentialOnFileInformation.paymentInformation), e.g. FIRST, SUBSEQUENT. | SUBSEQUENT |
| network_transaction_id | String | No | All | Network transaction id / issuer id from the initial credential-on-file transaction (credentialOnFileInformation.issuerId). | 306224132220497 |
| wallet_indicator | String | No | Apple Pay / Google Pay | Wallet channel (walletIndicator): IN_APPLICATION or IN_BROWSER (default IN_BROWSER). | IN_BROWSER |
| final_completion | Boolean | No | Capture | Marks the final capture of a multi-capture authorization (finalCompletion). | true |
Gateway Specific Response Fields
<gateway_specific_response_fields>
<moneris_rest>
<auth_code>180294</auth_code>
<response_code>027</response_code>
<network_transaction_id>306224132220000</network_transaction_id>
</moneris_rest>
</gateway_specific_response_fields>- auth_code: issuer authorization code returned on an approved transaction.
- response_code: issuer / host response code.
- network_transaction_id: store this value and pass it back as the
network_transaction_idgateway specific field on subsequent credential-on-file transactions.
| Field Name | Type | Description | Example Value |
|---|---|---|---|
| auth_code | string | Issuer authorization code (transactionDetails.authorizationCode). | 180294 |
| response_code | string | Issuer / host response code (transactionDetails.responseCode). | 027 |
| network_transaction_id | string | Network transaction id (credentialOnFileResponse.issuerId) to store and reuse for subsequent credential-on-file transactions. | 306224132220497 |
NoteSpreedly's
gateway_transaction_idis the MonerispaymentId/refundId/validationId/ storedpaymentMethodIdreturned on the response (authorization).
Stored Credentials (via Gateway Specific Fields)
Moneris REST does not use Spreedly's first-class stored credential fields (
stored_credential_initiator/stored_credential_reason_type). Credential-on-file (Card on File) is driven entirely by the gateway specific fieldspayment_indicator,payment_information, andnetwork_transaction_id.
The typical flow is: store the card (cardholder-initiated), capture network_transaction_id from the store response, then send it back on subsequent merchant-initiated transactions against the stored payment method token.
| Scenario | Fields to send (gateway specific fields) |
|---|---|
| Initial - cardholder-initiated (store) | store transaction; Spreedly applies paymentIndicator = UNSCHEDULED_CREDENTIAL_ON_FILE, paymentInformation = FIRST. Optionally set store_payment_method (e.g. CARDHOLDER_INITIATED). |
| Subsequent - merchant-initiated | Transact against the stored token with payment_indicator = MERCHANT_INITIATED, payment_information = SUBSEQUENT, network_transaction_id = <issuerId from the initial response>. |
Credential-on-file data is only forwarded when transacting against a stored payment method (a vault token).
Transaction Sync (Inquire)
Spreedly can re-query a transaction's current status at Moneris via inquire_by_gateway_transaction_id. Inquire is supported for purchase, authorize, refund (credit), and general_credit.
3DS2 (Global)
Moneris REST supports Spreedly 3DS2 Global for purchase and authorize (3dsecure_2_mpi_purchase / 3dsecure_2_mpi_authorize; implemented via MPI / externally-authenticated pass-through). Spreedly forwards the authentication result as Moneris's threeDSecureData object and maps the ECI to Moneris's ecommerceIndicator enum:
| Spreedly 3DS field | Moneris field | Example Value |
|---|---|---|
| authentication_value (cavv) | threeDSecureAuthenticationValue | AAABCZIhcQAAAABZlyFxAAAAAAA |
| three_ds_version | threeDSecureVersion | 2.2.0 |
| three_ds_server_trans_id | threeDSecureServerTransactionId | 9f3a2b1c-4d5e-4f6a-8b7c-0d1e2f3a4b5c |
| directory_server_transaction_id | threeDSecureDirectoryServerTransactionId | f38e6948-5388-41a6-bca4-b49723c19437 |
| ecommerce_indicator (eci) | ecommerceIndicator | AUTHENTICATED_ECOMMERCE |
ECI mapping: 2/02/5/05 -> AUTHENTICATED_ECOMMERCE; 1/01/6/06 -> NON_AUTHENTICATED_ECOMMERCE; otherwise SSL_MERCHANT.
Additional resources
If you need support with this gateway, please contact Support at [email protected].
Moneris Unified API Developer Portal: https://developer.moneris.com/
Homepage: https://www.moneris.com/
API Endpoint (Production): https://api.moneris.io
API Endpoint (Test/Sandbox): https://api.sb.moneris.io
API Version: 2025-08-14 (Api-Version header)
Updated about 2 hours ago

