Access Gateway Outbound Host API
Getting Started
Configuration & Go-live

Configuration & Go-live

Routing from the Access Gateway is based on profiles. A profile holds the merchant details and one or more acceptances; an acceptance holds the routing values for one host, such as MID and TID. To receive messages from MineSec, you create a profile with an acceptance whose message format is STD_JSON, through the Profile Management API. The same steps run first in UAT, then in production.

Overview

Steps

Prepare your adapter

Deploy your adapter on an HTTPS endpoint reachable from the internet, and check it against Security & Conventions. Use a separate base URL and credential for UAT and production.

Submit the onboarding information

Send MineSec the following through your account manager:

ItemExample
UAT and production base URLshttps://uat-api.your-host.com/api/v1
ScopeCard, QR, or both
Card schemes / QR walletsVISA, MASTERCARD; ALIPAY, WECHAT
QR modesMPQR, CPQR
Card optionsRequest signing, sign-on, host settlement, installments
QR optionsVoids and closing of expired MPQR orders, refunds, notify

Card options are enabled by MineSec for your account and confirmed with you before UAT. QR options are set in the acceptance of your profile; see below.

Exchange credentials and keys

Credentials never go through email or chat. MineSec provides a secure channel during onboarding.

SecretIssued byUsed for
Bearer credentialYouAuthorization header on signed requests (all QR; card when signing is on)
HMAC keyShared, agreed during onboardingx-signature on signed requests MineSec sends you
Notify keyMineSecSigning the QR notifies you send to MineSec
PIN key / Track2 keyKey ceremonyTranslating PIN blocks and encrypting Track2 (card)
Profile Management API accessMineSecCreating and updating your profiles

Create the profile

Create a profile with a STD_JSON acceptance through the Profile Management API. MineSec gives you its base URL and a bearer token for each environment. The token is bound to your account, allows profile management and has an expiry date; when a request answers 401 with "Token is not valid or has expired", ask MineSec for a new one.

Create a profile
POST {baseUrl}/api/v1/pos/profiles
Authorization: Bearer {token}
Content-Type: application/json
 
{
  "profileName": "HostAPI-Example",
  "providerReference": "your-merchant-0001",
  "merchantName": "ACME",
  "merchantAddr": "No. 7, Park Avenue, Sunset Beach",
  "mcc": "5999",
  "countryCode": "HK",
  "currency": "HKD",
  "acceptances": [
    {
      "acptName": "Host API",
      "acptReference": "your-merchant-0001-card",
      "hostMessageFormat": "STD_JSON",
      "supportedPayments": ["VISA", "MASTERCARD"],
      "primaryMid": "100000000000001",
      "primaryTid": "10000001",
      "extraParams": {
        "hostUrl": "https://uat-api.your-host.com/api/v1",
        "hostAuth": "<bearer credential>",
        "hmacKey": "<HMAC key, hex>",
        "pinDestKeyAlias": "<PIN key alias from MineSec>",
        "track2DestKeyAlias": "<Track2 key alias from MineSec>"
      }
    }
  ]
}

A successful create answers 201 Created with the profile and its acceptances. Keep the profileId and each acptId; you need them to update the profile.

Profile Management API reference

All paths are under the base URL MineSec gives you, with Authorization: Bearer {token}:

MethodPathPurposeSuccess
POST/api/v1/pos/profilesCreate a profile with its acceptances201
GET/api/v1/pos/profiles/{profileId}Read a profile with its acceptances200
GET/api/v1/pos/profiles/providerReference/{providerReference}Find a profile by your own reference200
PUT/api/v1/pos/profiles/{profileId}Update a profile and its acceptances200

The request and response bodies are the same as in the Profile & Acceptance API: ProfileRequest and AcceptanceUpsertRequest in, ProfileWithAcpt out. Use the paths above, not the {customerNamespace}/api/v1/profiles paths shown on that page.

The Host API also uses these optional fields, which that page does not list:

FieldObjectTypeUse
acptReferenceAcceptancestringYour own ID for the acceptance; see References and safe retries
merchantCityProfilestringMerchant city. Set it for QR: it is sent as merchantCity (EMVCo MPM tag 60)
merchantPostalCodeProfilestringMerchant postal code, sent on QR requests
shopIdProfilestringShop ID, sent on QR requests
shopNameProfilestringShop name, sent on QR requests
providerMchIdProfilestringThe merchant ID in your own system, sent on QR requests

References and safe retries

  • providerReference is your own ID for the profile, unique in your account. A POST with a providerReference that already exists updates that profile instead of creating a second one, so a create that timed out can be sent again.
  • acptReference is your own ID for the acceptance. Keep it unique in your account: an acceptance sent without acptId is matched by acptReference, and a match on another profile is moved to this one.

Updating a profile

A PUT (or a POST that matches an existing providerReference) replaces the profile as a whole:

  • Send all profile fields. They replace the stored values.
  • Send every acceptance the profile should keep, each with its acptId. An acceptance left out of acceptances, or all of them when acceptances is left out, is detached from the profile and no longer receives transactions.
  • An acceptance without acptId is matched by acptReference; if none matches, a new acceptance is created.
  • Within an acceptance, all fields are replaced except extraParams, which is merged: the keys you send overwrite the stored ones, and keys you leave out keep their values. Leaving a key out does not remove it.
  • When host settlement is enabled, an update is rejected while the profile has a batch with approved transactions that is not settled yet. Settle first, then update.

Errors

StatusMeaning
400The request is invalid, for example a missing required field, STD_JSON not enabled for your account, a MID and TID already used by another acceptance, or an unsettled batch on update
401The token is missing, invalid or expired
404No profile or acceptance with the given profileId or acptId
504MineSec could not complete the request. Retry it; a POST with providerReference is safe to retry

Set the acceptance as follows:

Config paramRequiredDescription
hostMessageFormatYesSTD_JSON
supportedPaymentsYesCard schemes and QR wallets routed to your host, e.g. ["VISA", "MASTERCARD"]
primaryMidYesMID sent to your host
primaryTidYesTID sent to your host
extraParams.subMid, extraParams.subTidNoSub MID and sub TID sent to your host
extraParams.hostUrlYesBase URL MineSec calls. Must start with https://
extraParams.hostAuthQR; card when signing is enabledBearer credential in the Authorization header
extraParams.hmacKeyQR; card when signing is enabledHex HMAC key for x-signature
extraParams.qrModesQRMPQR, CPQR or MPQR,CPQR
extraParams.qrSupportsCancelNo, "true" to enableQR voids and closing of expired MPQR orders. Cancellations for device reversals are sent even when it is off
extraParams.qrSupportsRefundNo, "true" to enableQR refunds
extraParams.notifyProfile, extraParams.notifyKeyNo, set both to enableQR notify: notifyProfile is std-v1, notifyKey is the hex notify key
extraParams.pinDestKeyAliasCardAlias of your PIN key from the key ceremony. PIN is sent in pinBlock
extraParams.track2DestKeyAliasNoAlias of your Track2 key from the key ceremony. Track2 is sent in track2Data
extraParams.pinDestBlockFormatNo0 or 4. Defaults to the key algorithm (TDES: 0, AES: 4); a mismatch is rejected
  • All extraParams values are strings. Any key you add that is not in this table is forwarded to your host in posExtra on every request of the acceptance.
  • For QR, also set merchantCity on the profile: it is sent as EMVCo tag 60. merchantPostalCode, shopId, shopName and providerMchId are optional profile fields that are forwarded on QR requests when set.
  • Always set pinDestKeyAlias on a card acceptance; without it, PIN transactions are declined. See PIN and Track2.
  • A profile can carry several acceptances, for example one for card and one for QR. Do not let two acceptances of the same profile support the same payment method: the transaction is then rejected unless the device sends a matching acceptance tag.

MineSec routes each transaction of the profile to the acceptance that supports its payment method, and sends that acceptance's MID, TID, sub MID and sub TID to your host.

⚠️

hostAuth, hmacKey and notifyKey are secrets. Send them only to the Profile Management API, keep the API token in a secrets manager, and never log the request body.

Test in UAT

Run the test cases from MineSec with a UAT device and test cards or wallets. A typical set:

AreaCases
CardSale (contactless, PIN), refund, void, reversal on timeout; sign-on and settlement if enabled
MPQRPaid, failed, expired, cancelled, notify received
CPQRPaid, failed, timeout followed by cancellation
SecurityWrong signature rejected, repeated request not processed twice, reversal of an unknown transaction answered 00

Go live

After UAT sign-off, repeat the credential exchange and profile creation in production, with production values. Start with a pilot merchant and one low-value transaction before you roll out.

To add more merchants later, create one profile per merchant. Your adapter stays the same.