Purchase
Overview
The purchase command allows you to initiate a transaction for an amount equal to the totalAmount specified in the request body.
Additionally you can separate the transaction into several smaller ones which is know as a partial transaction. This can occur when a customer uses a gift card with a remaining balance below the total purchase amount, in which case, subsequent transactions must be initiated until there is no remaining amount in the response. The initial transaction in the partial transaction flow will return a remainingAmount value that will be sent in follow-up transactions to bypass the tip select screen so customers aren't prompted to give a tip for each transaction.
List of coding scenarios that use this endpoint:
NOTE
Each transaction in the partial transaction flow is considered a separate transaction and will have its receipt.
Request Structure
| Element | Type | Description | Size | Required |
|---|---|---|---|---|
| apiVersion | String | API version number | V20 | Required |
| istConfigCode | String | Moneris provided integration configuration code | V25 | Required |
| dataId | String | Merchant defined unique identifier for the data object | V50 | Required |
| dataTimestamp | String | Date and time of the request (YYYY-MM-DD HH:MM:SS) | F19 | Required |
| data | Object | Object that contains all transaction requests | — | — |
| request | Array | Contains data applicable to transaction request | — | — |
| orderId | String | Order ID from Purchase | V50 | Optional |
| idempotencyKey | String | Unique transaction identifier to avoid duplicate request | V50 | Required |
| linkId | String | Id used to group related transactions | V50 | Optional |
| terminalId | String | Destination Terminal ID | F8 | Optional |
| userName | String | Unique identifier for clerk / user | V30 | Optional |
| customIdData | String | Custom field | V50 | Optional |
| action | String | "purchase" | V50 | Required |
| totalAmount | String | Total transaction amount | V9 | Required |
| remainingAmount | String | Amount for partial authorization transactions | V9 | Optional |
| safAllowed | String | Toggle for SAF | V5 | Optional |
| dynamicDescriptor | String | Merchant-defined description | V20 | Optional |
| cashBack | String | If value is "true", terminal will prompt cardholder for cashback | V5 | Optional |
| progressStatus | String | If value is set to "True", terminal will return progress to ECR. Note: This feature is only available on Direct Integration. | V5 | Optional |
| modifier | String | Enum which further classifies transaction | V24 | Optional |
| tipAmount | String | Tip amount from ECR | V9 | Optional |
| language | String | Valid values "EN" and "FR". If value is not provided, the payment app will use the language from TMS. | F2 | Optional |
| subtotalAmount | String | Amount without taxes or fees | V9 | Optional |
| taxes | Array | Maximum of 5 tax objects | — | — |
| taxName | String | Name to be displayed on receipt (hst, gst etc.) | V15 | Optional |
| taxAmount | String | Corresponding amount | V9 | Conditional |
Request example
{
"apiVersion": "3.0",
"istConfigCode": "example_istConfigCode",
"dataId": "example_dataId",
"dataTimestamp": "1969-12-31 23:59:59",
"data": {
"request": [
{
"idempotencyKey": "example_idempotencyKey",
"action": "purchase",
"totalAmount": "example_totalAmount",
"subtotalAmount": "10000",
"taxes": [
{
"taxAmount": "1300",
"taxName": "HST"
},
{
"taxAmount": "200",
"taxName": "Tourist Fee"
},
{
"taxAmount": "100",
"taxName": "Eco Fee"
}
]
}
]
}
}Response Structure
| Element | Type | Description | Size | Required |
|---|---|---|---|---|
| apiVersion | String | API version number | V20 | Required |
| statusCode | String | Status code for the overall transaction request | V4 | Required |
| status | String | Description of the statusCode | V4 | Required |
| dataId | String | Merchant defined unique identifier for the data object | V50 | Required |
| dataTimestamp | String | Date and time of the request (YYYY-MM-DD HH:MM:SS) | F19 | Required |
| data | Object | Object that contains all transaction requests | — | — |
| response | Array | Contains data applicable to transaction request | — | — |
| orderId | String | Terminal will either return the orderId from the request or generate a new unique orderId if no orderId was present in the request | V50 | Required |
| transactionId | String | Unique identifier for this request | V50 | Required |
| idempotencyKey | String | Unique transaction identifier to avoid duplicate request | V50 | Required |
| linkId | String | Id used to group related transactions | V50 | Optional |
| action | String | "purchase" | V50 | Required |
| statusCode | String | Status code for individual request | V4 | Required |
| status | String | Description of the individual statusCode | V50 | Required |
| saf | String | Identifier for SAF Transaction | V5 | Required |
| safCounter | String | Number of unprocessed SAF transactions | V3 | Conditional |
| approvedAmount | String | Payment amount received / approved | V9 | Conditional |
| totalAmount | String | Echo of the Total transaction amount from the request | V9 | Required |
| remainingAmount | String | Remaining amount that is owed | V9 | Required |
| tenderType | String | Payment Type: Credit, Debit, Gift etc | V50 | Required |
| cardType | String | Card Type: V, M, P, AX etc | V2 | Conditional |
| cardName | String | Card Name: Visa, MasterCard, Interac, Amex etc | V25 | Conditional |
| sequenceNum | String | Sequence Number | V18 | Conditional |
| realTimeUniqueId | String | Real Time Moneris Transaction Unique Identifier | F15 | Conditional |
| responseCode | String | Moneris Host Response Code | V3 | Conditional |
| iso | String | ISO response Code | V2 | Conditional |
| authCode | String | Authorization code returned from the issuing institution. | V8 | Conditional |
| formFactor | String | EMV Specific Data | F2 | Conditional |
| maskedPan | String | Masked Primary Account Number (PAN) | V21 | Conditional |
| tipAmount | String | Tip amount entered by user | V9 | Conditional |
| cashBack | String | Cashback amount | V9 | Conditional |
| surcharge | String | Surcharge amount on transaction | V9 | Conditional |
| receipt | String | Financial receipt data sent using ISO-8895-1 encoding | V4000 | Conditional |
| receiptChoice | String | The choices of how the receipt is being returned to the cardholder at the time of transaction. Valid values include: PRINT (Default Option), EMAIL, SMS, NONE. | V10 | Conditional |
| completed | String | "true" or "false" | V5 | Required |
| terminalId | String | Destination Terminal ID | F8 | Required |
| dccOptIn | String | This field indicates a Dynamic Currency Conversion (DCC) transaction. | V5 | Optional |
| installmentOptIn | String | This field indicates an Installment by Visa transaction | V5 | Optional |
| receiptExtension | String | DCC transaction data for compact format receipts | V275 | Conditional |
Response example
{
"apiVersion": "3.0",
"statusCode": "example_statusCode",
"status": "example_status",
"dataId": "example_dataId",
"dataTimestamp": "1969-12-31 23:59:59",
"data": {
"response": [
{
"orderId": "example_orderId",
"transactionId": "example_transactionId",
"statusCode": "example_statusCode",
"status": "example_status",
"idempotencyKey": "example_idempotencyKey",
"completed": "true",
"saf": "false",
"responseCode": "example_responseCode",
"iso": "example_iso",
"approvedAmount": "example_approvedAmount",
"totalAmount": "example_totalAmount",
"tenderType": "example_tenderType",
"cardType": "example_cardType",
"sequenceNum": "example_sequenceNum",
"realTimeUniqueId": "example_realTimeUniqueId",
"authCode": "example_authCode",
"formFactor": "example_formFactor",
"maskedPan": "example_maskedPan",
"action": "purchase",
"receipt": "example_receipt",
"receiptChoice": "PRINT",
"terminalId": "example_terminalId"
}
]
}
}Errors
If your response contains errors, visit the Errors page for a detailed description of each one.

