Terminal Payment API
Start a payment or refund on a terminal and retrieve the final result.
Quick Start
{
"TERMID": "12345",
"PASS": "abc123",
"TYPE": "W",
"ACTION": "StartSession",
"INV": "INV1001",
"AMT": "11.00",
"REQUESTID": "4736823",
"DEVICEID": "DEV001",
"SUCCESSURL": "https://merchant.com/success"
}
How it Works
StartSession → Terminal → Callback → Final Result
- Call
StartSession - The terminal processes the transaction
- The gateway calls your
SUCCESSURL - Your system retrieves the final result
⚠️ Important: How Responses Work
This is an asynchronous API. Do not assume immediate transaction results.
If the request fails (CODE ≠ 0000), no callback will be triggered.
Each transaction has one or two responses, depending on the initial result.
1. StartSession Response (Immediate)
Returned right after calling StartSession.
CODE = 0000→ Request successfully sent to terminalCODE ≠ 0000→ Request failed (terminal did not receive it)
2. Final Transaction Result (Only if StartSession CODE = 0000)
If StartSession returns 0000, the terminal will process the transaction.
You will then receive a second response via callback with the final result:
CODE = 0000→ Transaction approvedCODE = 8509→ Declined (NSF, fraud, etc.)
Key Behavior
-
If
StartSession CODE ≠ 0000
→ Transaction failed immediately
→ No further response -
If
StartSession CODE = 0000
→ Transaction sent to terminal
→ Wait for final result
Think of StartSession as "request delivery" and the final result as "transaction outcome".
StartSession
Start a payment or refund.
Required Parameters
| Param | Description |
|---|---|
| TERMID | Terminal ID |
| PASS | Terminal password |
| TYPE | Must be W |
| ACTION | StartSession |
| SUCCESSURL | Callback URL for approved transactions |
| FAILUREURL | Callback URL for declined or failed transactions |
| AMT | Amount |
| REQUESTID | Unique ID per request |
| DEVICEID | Device ID |
| CUSTEMAIL | Customer email |
Optional Parameters
| Param | Description |
|---|---|
| SUCCESSURL | Callback URL for approved transactions //terminals setup with a default URL, but can be passed dynamically if configured for your platform |
| FAILUREURL | Callback URL for declined or failed transactions //terminals setup with a default URL, but can be passed dynamically if configured for your platform |
| INV | Invoice number |
| REFUND | Refund instead of sale |
| NOTERMPRINT | Disable receipt printing |
| JSON | Return JSON response |
| LANG | E (English), F (French) |
| DESC | Description |
Refer to Terminal Payment API
Example Request
Sale
{
"TERMID": "12345",
"PASS": "abc123",
"TYPE": "W",
"ACTION": "StartSession",
"INV": "INV1001",
"CUSTEMAIL": "[email protected]",
"AMT": "11.00",
"REQUESTID": "4736823",
"DEVICEID": "DEV001",
"SUCCESSURL": "https://merchant.com/success",
"FAILUREURL": "https://merchant.com/failure"
}
Refund
{
"TERMID": "12345",
"PASS": "abc123",
"TYPE": "W",
"ACTION": "StartSession",
"INV": "INV1001",
"CUSTEMAIL": "[email protected]",
"AMT": "11.00",
"REQUESTID": "4736823",
"DEVICEID": "DEV001",
"SUCCESSURL": "https://merchant.com/success",
"FAILUREURL": "https://merchant.com/failure",
"REFUND": "Y"
}
No Terminal Receipt
{
"TERMID": "12345",
"PASS": "abc123",
"TYPE": "W",
"ACTION": "StartSession",
"INV": "INV1001",
"CUSTEMAIL": "[email protected]",
"AMT": "11.00",
"REQUESTID": "4736823",
"DEVICEID": "DEV001",
"SUCCESSURL": "https://merchant.com/success",
"FAILUREURL": "https://merchant.com/failure",
"NOTERMPRINT": "Y"
}
StartSession Response
| Field | Description |
|---|---|
| CODE | 0000 = request sent to terminal |
| TEXT | Status message |
| SECUREID | Session ID (save this) |
| CANCELURL | URL to cancel the active terminal session (optional use) |
| HOST | N/A - Used for ecommerce transactions only |
| USERFEE | N/A - Used for ecommerce transactions only |
| DATE | Date of the request |
| TIME | Time of the request |
| DUR | Duration of the request |
Do not treat this as payment success. This indicates the request was accepted. You must now wait for the final transaction result via callback.
CANCELURLcan be used to cancel an in-progress transaction on the terminal if needed. If used after the transaction has been processed but before the batch has been settled, it will Void the transaction.
Store the SECUREID
- Save the
SECUREIDfrom the StartSession response. - The same
SECUREIDwill be returned in the final transaction result - This is required to match the final transaction result to the original request.
Example StartSession Response
{
"TEXT": "SENT TO TERMINAL",
"CODE": "0000",
"SECUREID": "abc123",
"CANCELURL": "https://svra.interpaypos.com/api/TERMPAY/cancel/?SecureID=abc123",
"HOST": "https://devgate.interpaypos.com",
"USERFEE": "0.00",
"DATE": "2026-03-25",
"TIME": "15:45:52",
"DUR": "3.737"
}Callback
After the terminal completes the transaction, the gateway will call one of your URLs:
SUCCESSURL→ Transaction approvedFAILUREURL→ Transaction declined or failed
The callback indicates that processing is complete.
You must use the response data to determine the final result.
Final Transaction Result
| Field | Description |
|---|---|
| TEXT | APPROVED, DECLINED, VOIDED, or Description of decline |
| CODE | Final result code (refer to status codes below) |
| AMT | Transaction amount |
| SECUREID | Session ID |
| REFNUM | Transaction reference number provided by the terminal |
| REQUESTID | Original request ID |
| INV | Invoice |
| ACK | Y (confirms payment was captured) |
| RECEIPTS | Merchant and Customer copy of receipt from the terminal in HTML |
| REFUND | Y (only included if transaction was a Refund) |
| AUTH | Authorization Code (sent only if transaction was APPROVED) |
| CARDTYPE | Type of card used for the transaction (sent only if transaction was APPROVED) |
| CARDMASK | The masked card number - only last 4 digits available (sent only if transaction was APPROVED) |
| CUSTEMAIL | Customers email address (sent only if transaction was APPROVED) |
Refer to Terminal Transaction Callback Specs
Approved
{
"CODE": "0000",
"TEXT": "APPROVED",
"SECUREID": "ur32e7683kmr5y6o853d",
"AMT": "1.23",
"REQUESTID": "2082440",
"REFNUM": "WP5420PQ23000423",
"INV": "",
"AUTH": "182886",
"CARDTYPE": "I",
"CARDMASK": "****3259",
"CUSTEMAIL": "[email protected]",
"ACK": "Y",
"RECEIPTS": {
"Customer": "<IMG src=\"\"/><BR/><LG><C>Merchant Name</C></LG><BR/><BR/><L>03/27/2026</L><R>15:55</R><BR/><BR/><LG><C>Sale</C></LG><BR/><BR/><LG><L>Trans #: 3</L><R>Batch #: 1</R></LG><BR/><BR/><L>DEBIT</L><R>CHIP Contactless</R><BR/><L>************3259</L><R>**/**</R><BR/><L>Account Type:</L><R>Default</R><BR/><L>Reference Id:</L><R>ur32e7683kmr5y6o853d</R><BR/><BR/><LG><L>TOTAL AMT:</L><R>$1.23</R></LG><BR/><BR/><LG><C>APPROVED</C></LG><BR/><BR/><L>Resp:</L><R>APPROVAL</R><BR/><L>Code:</L><R>182886</R><BR/><L>Ref #:</L><R>518</R><BR/><L>Trace Number</L><R>000005</R><BR/><BR/><L>App Name:</L><R>Interac</R><BR/><L>AID:</L><R>A00000027710100100000002</R><BR/><L>TVR:</L><R>0080008000</R><BR/><BR/><BR/><BR/><B><C>CUSTOMER COPY</C></B><BR/><BR/><BR/><BR/><BR/><BR/>",
"Merchant": "<IMG src=\"\"/><BR/><LG><C>Merchant Name</C></LG><BR/><BR/><L>03/27/2026</L><R>15:55</R><BR/><BR/><LG><C>Sale</C></LG><BR/><BR/><LG><L>Trans #: 3</L><R>Batch #: 1</R></LG><BR/><BR/><L>DEBIT</L><R>CHIP Contactless</R><BR/><L>************3259</L><R>**/**</R><BR/><L>Account Type:</L><R>Default</R><BR/><L>Reference Id:</L><R>ur32e7683kmr5y6o853d</R><BR/><BR/><LG><L>TOTAL AMT:</L><R>$1.23</R></LG><BR/><BR/><LG><C>APPROVED</C></LG><BR/><BR/><L>Resp:</L><R>APPROVAL</R><BR/><L>Code:</L><R>182886</R><BR/><L>Ref #:</L><R>518</R><BR/><L>Trace Number</L><R>000005</R><BR/><BR/><L>App Name:</L><R>Interac</R><BR/><L>AID:</L><R>A00000027710100100000002</R><BR/><L>TVR:</L><R>0080008000</R><BR/><BR/><BR/><B><C>MERCHANT COPY</C></B><BR/><BR/><BR/><BR/><BR/><BR/>"
}
}Declined
{
"CODE": "8514",
"TEXT": "Force(Ticket) Transaction Disabled",
"SECUREID": "8j0310lxej7jrp0aruje",
"REFUND": "Y",
"AMT": "1.23",
"REQUESTID": "3718563",
"REFNUM": "",
"INV": "",
"ACK": "Y",
"RECEIPTS": {
"Customer": "<INV><B><LG><C>* CANCELED </C></LG></B></INV><BR/><BR/><IMG src=\"\"/><BR/><BR/><L>00/00/0000</L><R> 0:00</R><BR/><BR/><LG><C></C></LG><BR/><BR/><LG><L>Trans #: 0</L><R>Batch #: 2</R></LG><BR/><BR/><L>EBT</L><R>Swipe</R><BR/><L>************</L><R>**/**</R><BR/><L>Reference Id:</L><R>8j0310lxej7jrp0aruje</R><BR/><BR/><LG><L>AMOUNT:</L><R>$1.23</R></LG><BR/><LG><L>TOTAL AMT:</L><R>$1.23</R></LG><BR/><BR/><INV><B><L>Resp:</L><R></R></B></INV><BR/><L>Trace Number</L><R></R><BR/><INV><B><LG><C> CANCELED *</C></LG></B></INV><BR/><BR/><B><C>CUSTOMER COPY</C></B><BR/><BR/><BR/><BR/><BR/><BR/>",
"Merchant": "<INV><B><LG><C>* CANCELED </C></LG></B></INV><BR/><BR/><IMG src=\"\"/><BR/><BR/><L>00/00/0000</L><R> 0:00</R><BR/><BR/><LG><C></C></LG><BR/><BR/><LG><L>Trans #: 0</L><R>Batch #: 2</R></LG><BR/><BR/><L>EBT</L><R>Swipe</R><BR/><L>************</L><R>**/**</R><BR/><L>Reference Id:</L><R>8j0310lxej7jrp0aruje</R><BR/><BR/><LG><L>AMOUNT:</L><R>$1.23</R></LG><BR/><LG><L>TOTAL AMT:</L><R>$1.23</R></LG><BR/><BR/><INV><B><L>Resp:</L><R></R></B></INV><BR/><L>Trace Number</L><R></R><BR/><INV><B><LG><C> CANCELED *</C></LG></B></INV><BR/><BR/><B><C>MERCHANT COPY</C></B><BR/><BR/><BR/><BR/><BR/><BR/>"
}
}Status Codes
| Code | Meaning (StartSession) | Meaning (Final Result) |
|---|---|---|
| 0000 | Request sent to terminal | Approved |
| 8501 | Device not found | — |
| 8502 | Device not supported | — |
| 8503 | Fee not allowed | — |
| 8504 | Device not responding | — |
| 8505 | Terminal busy | — |
| 8506 | Not found | — |
| 8507 | Gateway configuration error | — |
| 8508 | Not allowed | — |
| 8509 | Declined (pre-check possible) | Declined |
| 8510 | Terminal configuration error | — |
| 8511 | Format error | — |
| 8512 | Terminal not connected | — |
| 8513 | Gateway error | — |
| 8514 | Other terminal response | — |
Recap
Sequence:
- Call StartSession
- If CODE ≠ 0000 → stop (request failed)
- If CODE = 0000 → wait for callback
- Read final result
- If CODE = 0000 → approved
Rules:
REQUESTIDmust be unique per transaction- Always store
SECUREID - Do not treat StartSession response of
0000as success for the transaction; always rely on the final result via callback - Use
REFUNDfor refunds - Use
NOTERMPRINTto disable receipt printing
Mental Model
StartSession = "Request delivered to terminal"
Final Result = "Transaction outcome"
Updated 7 days ago
