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:
| Item | Example |
|---|---|
| UAT and production base URLs | https://uat-api.your-host.com/api/v1 |
| Scope | Card, QR, or both |
| Card schemes / QR wallets | VISA, MASTERCARD; ALIPAY, WECHAT |
| QR modes | MPQR, CPQR |
| Card options | Request signing, sign-on, host settlement, installments |
| QR options | Voids 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.
| Secret | Issued by | Used for |
|---|---|---|
| Bearer credential | You | Authorization header on signed requests (all QR; card when signing is on) |
| HMAC key | Shared, agreed during onboarding | x-signature on signed requests MineSec sends you |
| Notify key | MineSec | Signing the QR notifies you send to MineSec |
| PIN key / Track2 key | Key ceremony | Translating PIN blocks and encrypting Track2 (card) |
| Profile Management API access | MineSec | Creating 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.
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}:
| Method | Path | Purpose | Success |
|---|---|---|---|
POST | /api/v1/pos/profiles | Create a profile with its acceptances | 201 |
GET | /api/v1/pos/profiles/{profileId} | Read a profile with its acceptances | 200 |
GET | /api/v1/pos/profiles/providerReference/{providerReference} | Find a profile by your own reference | 200 |
PUT | /api/v1/pos/profiles/{profileId} | Update a profile and its acceptances | 200 |
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:
| Field | Object | Type | Use |
|---|---|---|---|
acptReference | Acceptance | string | Your own ID for the acceptance; see References and safe retries |
merchantCity | Profile | string | Merchant city. Set it for QR: it is sent as merchantCity (EMVCo MPM tag 60) |
merchantPostalCode | Profile | string | Merchant postal code, sent on QR requests |
shopId | Profile | string | Shop ID, sent on QR requests |
shopName | Profile | string | Shop name, sent on QR requests |
providerMchId | Profile | string | The merchant ID in your own system, sent on QR requests |
References and safe retries
providerReferenceis your own ID for the profile, unique in your account. APOSTwith aproviderReferencethat already exists updates that profile instead of creating a second one, so a create that timed out can be sent again.acptReferenceis your own ID for the acceptance. Keep it unique in your account: an acceptance sent withoutacptIdis matched byacptReference, 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 ofacceptances, or all of them whenacceptancesis left out, is detached from the profile and no longer receives transactions. - An acceptance without
acptIdis matched byacptReference; 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
| Status | Meaning |
|---|---|
400 | The 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 |
401 | The token is missing, invalid or expired |
404 | No profile or acceptance with the given profileId or acptId |
504 | MineSec could not complete the request. Retry it; a POST with providerReference is safe to retry |
Set the acceptance as follows:
| Config param | Required | Description |
|---|---|---|
hostMessageFormat | Yes | STD_JSON |
supportedPayments | Yes | Card schemes and QR wallets routed to your host, e.g. ["VISA", "MASTERCARD"] |
primaryMid | Yes | MID sent to your host |
primaryTid | Yes | TID sent to your host |
extraParams.subMid, extraParams.subTid | No | Sub MID and sub TID sent to your host |
extraParams.hostUrl | Yes | Base URL MineSec calls. Must start with https:// |
extraParams.hostAuth | QR; card when signing is enabled | Bearer credential in the Authorization header |
extraParams.hmacKey | QR; card when signing is enabled | Hex HMAC key for x-signature |
extraParams.qrModes | QR | MPQR, CPQR or MPQR,CPQR |
extraParams.qrSupportsCancel | No, "true" to enable | QR voids and closing of expired MPQR orders. Cancellations for device reversals are sent even when it is off |
extraParams.qrSupportsRefund | No, "true" to enable | QR refunds |
extraParams.notifyProfile, extraParams.notifyKey | No, set both to enable | QR notify: notifyProfile is std-v1, notifyKey is the hex notify key |
extraParams.pinDestKeyAlias | Card | Alias of your PIN key from the key ceremony. PIN is sent in pinBlock |
extraParams.track2DestKeyAlias | No | Alias of your Track2 key from the key ceremony. Track2 is sent in track2Data |
extraParams.pinDestBlockFormat | No | 0 or 4. Defaults to the key algorithm (TDES: 0, AES: 4); a mismatch is rejected |
- All
extraParamsvalues are strings. Any key you add that is not in this table is forwarded to your host inposExtraon every request of the acceptance. - For QR, also set
merchantCityon the profile: it is sent as EMVCo tag 60.merchantPostalCode,shopId,shopNameandproviderMchIdare optional profile fields that are forwarded on QR requests when set. - Always set
pinDestKeyAliason 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:
| Area | Cases |
|---|---|
| Card | Sale (contactless, PIN), refund, void, reversal on timeout; sign-on and settlement if enabled |
| MPQR | Paid, failed, expired, cancelled, notify received |
| CPQR | Paid, failed, timeout followed by cancellation |
| Security | Wrong 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.