Path A — Priority Terminal API

Process card-present payments through Priority-supported terminals using the Terminal API — authentication, terminal discovery, transaction initiation, polling, and final record retrieval.

Use the Priority Terminal API when your software needs to drive a Priority-supported terminal directly — initiating transactions, polling for outcomes, and retrieving payment records through a single API surface. The API handles device communication on your behalf, so you don't integrate against the terminal vendor's SDK.

📌

Who this is for — ISVs and developers building point-of-sale software for merchants using Priority-supported terminal devices. Partners and merchants should start with Choose Your Integration Path.


Supported Devices

The Priority Terminal API currently supports the following device families:

ManufacturerDevices
DejavooZ3, Z6, Z8, Z9, Z11
DejavooQD2, QD3, QD4, QD5
DejavooP12
DejavooP1, P3, P8 [verify]
AnywhereCommerceNomad (WP3s) [verify]

For devices not on this list — including PAX, Clover, Ingenico, Valor, and standalone variants — see Vendor-Direct Integrations or Standalone Terminals.


Before You Begin

RequirementWhere to get it
Active PCE merchant account (approved through underwriting)Priority Account Management
Registered terminal device with MID and T-number issuedPriority File Build Team (via the provisioning lifecycle)
Consumer Key and Consumer SecretPriority Account Management
Stable network on the terminal (Wi-Fi or Ethernet)Merchant network environment

Environments

EnvironmentAPI Base URLPortal
Sandboxhttps://sandbox-api2.mxmerchant.com/terminal/v1/https://sandbox.mxmerchant.com/
Productionhttps://api2.mxmerchant.com/terminal/v1/https://mxmerchant.com/

The Five-Step Workflow

Every Priority Terminal API transaction runs through the same five sequential steps. Each step depends on the previous step's output — store the values you receive immediately so they are available for the next call.

  1. Authenticate — Obtain a JWT bearer token.
  2. Retrieve terminals — Fetch the list of registered terminals and pick an enabled one.
  3. Create a transaction — Send a transaction request to the terminal. Capture devicePaymentAuditId.
  4. Poll for status — Poll every 2 seconds until the transaction reaches a final state.
  5. Retrieve the payment record — Fetch the authoritative payment record from the Checkout API using your replayId.

Step 1 — Authenticate

Obtain a JWT bearer token using your Consumer Key and Consumer Secret. Every other Terminal API call requires this token in the Authorization header.

Endpoint

POST https://api2.mxmerchant.com/security/v1/application/authorize

Request

curl --request POST \
  --url 'https://api2.mxmerchant.com/security/v1/application/authorize' \
  --header 'content-type: application/json' \
  --data '{
    "consumerKey": "{your_consumer_key}",
    "consumerSecret": "{your_consumer_secret}"
  }'

Parameters

ParameterRequiredDescription
consumerKeyYour Consumer Key, issued by Priority Account Management.
consumerSecretYour Consumer Secret, issued by Priority Account Management.

Store the returned token and include it as a Bearer token on every subsequent request:

Authorization: Bearer {your_jwt_token}
⚠️

JWT tokens expire. Implement token refresh logic so long-running terminal sessions don't fail mid-transaction.


Step 2 — Retrieve Available Terminals

Fetch every terminal registered to the merchant account and pick one to use for the transaction.

Endpoint

GET https://api2.mxmerchant.com/terminal/v1/merchantid/{merchantId}

Parameters

ParameterRequiredDescription
merchantIdPath parameter — the MID assigned during merchant onboarding.

Choosing a terminal — check these fields on each record

FieldWhat to check
idUnique identifier for the terminal. You'll pass this as terminalId in Step 3.
enabledMust be true. Disabled terminals cannot accept transactions.
statusShould be Active for a fully provisioned terminal.

Only terminals with enabled: true and an Active status are valid targets for a transaction.


Step 3 — Create a Transaction

Send the transaction to the terminal. The terminal prompts the customer for card entry and runs the authorization.

Endpoint

POST https://api2.mxmerchant.com/terminal/v1/transaction/merchantid/{merchantId}/terminalid/{terminalId}

Body parameters

ParameterRequiredDescription
merchantIdPath — the MID.
terminalIdPath — the id of an enabled terminal from Step 2.
replayIdClient-generated UUID for idempotency. This is the only value that links the terminal transaction to the final payment record in Step 5 — store it immediately.
amountTransaction amount in USD.
transactionTypeOne of Sale, Refund, or Authorization (see below).

Supported transaction types

TypeBehavior
SaleAuthorizes and captures the amount in a single step.
AuthorizationReserves funds without capturing. Requires a Manager Approval code on the terminal by default — unless the file build is configured otherwise during Stage 4 of the provisioning lifecycle.
RefundReturns funds to the cardholder. Requires a Manager Approval code on the terminal by default — unless the file build is configured otherwise.
📌

posData is auto-populated for Terminal API transactions. You do not send posData fields in the request body — the terminal supplies them automatically based on the file build. For card-present transactions without a terminal, see Card Present (Keyed) Transactions, where posData is required.

Initial response

The response returns a status of SENTTOTERMINAL and a devicePaymentAuditId.

FieldWhat to do with it
status: SENTTOTERMINALConfirms the transaction was dispatched to the terminal. This is not a final state. Move to Step 4.
devicePaymentAuditIdStore immediately. This becomes your transactionId for polling in Step 4.

Step 4 — Poll for Transaction Status

Poll the status endpoint every 2 seconds until the transaction reaches a final state, or until your 2-minute cap is hit.

Endpoint

GET https://api2.mxmerchant.com/terminal/v1/transaction/merchantid/{merchantId}/transactionid/{transactionId}

Parameters

ParameterRequiredDescription
merchantIdPath — the MID.
transactionIdPath — the devicePaymentAuditId from Step 3.

Polling cadence

  • Begin polling ~2 seconds after creating the transaction in Step 3.
  • Poll once every 2 seconds.
  • Cap at 2 minutes total. If no final state is reached, surface a timeout error and investigate via the terminal portal.

Final states — proceed to Step 5

StatusMeaning
approvedTransaction completed successfully.
declinedIssuer declined the transaction.
errorA processing error occurred. Check the response for details.

Failed states — do not proceed

StatusMeaning
canceled / cancelledTransaction was canceled. Check the message field.
failedTransaction failed. Check the message field.
⚠️

Cancel operations are not currently implemented for Dejavoo terminals. Polling will not return a canceled state from a programmatic cancel call — only from a terminal-side or manager-initiated cancel. Plan your error handling accordingly.

Any status not listed above should be treated as in-progress — continue polling.


Step 5 — Retrieve the Payment Record

Once a final state is reached, fetch the authoritative payment record from the Checkout API. The Terminal API does not return full payment details — only status.

Endpoint

GET https://api2.mxmerchant.com/checkout/v3/payment

Parameters

ParameterRequiredDescription
merchantIdThe MID.
replayIdThe same UUID you submitted in Step 3 — character-for-character match.

Key fields in the response

FieldDescription
approvalStatusFinal approval status.
paymentTypeCard type (credit, debit, etc.).
amountFinal transaction amount.
cardInformationTokenized card details. Raw PAN is never returned.
authorizationDetailsAuthorization code and network response codes.
timestampsCreated and completed timestamps.

Treat the Checkout API response as the system of record for the transaction.


Best Practices

PracticeWhy it matters
Generate a new replayId per transactionIt's your only link to the final payment record. Reusing a UUID will mis-route record retrieval.
Store devicePaymentAuditId immediately on Step 3 responseYou cannot poll without it. It is not recoverable after the fact.
Implement JWT refresh logicTokens expire mid-session and silent failures are hard to debug.
Validate enabled: true before sending a transactionA disabled terminal will return an immediate failure.
Cap polling at 2 minutesAvoid runaway loops on stalled transactions. Surface a timeout to your operator.
Always retrieve the final record from Checkout APIThe Terminal API only confirms state — the payment object lives in Checkout.
Validate the full workflow in Sandbox firstAuth → terminal selection → transaction → polling → record retrieval — end-to-end before going live.

Common Issues

SymptomLikely causeAction
Authentication returns 401JWT expired or invalid credentialsRe-authenticate. Confirm Consumer Key/Secret are for the correct environment.
Terminal not appearing in Step 2 responseDevice not yet provisioned, or not linked to this MIDCheck Stage 7 in the provisioning lifecycle with the File Build Team.
enabled: false on the terminal recordDevice is inactiveContact Priority Account Management.
Transaction stuck on SENTTOTERMINALDevice offline or disconnectedVerify the terminal displays Ready and has network.
Polling never reaches a final state within 2 minutesCustomer did not present a card, or device prompt was missedSurface a timeout error to the operator. Investigate via the terminal portal.
Step 5 returns no record for the replayIdreplayId does not match the value sent in Step 3Confirm the value was stored before Step 3 was sent and is being passed unchanged.

Where to Go Next


.readme-logo { display: none !important; }