1. ZPK
Merchant Connect API
latest
  • latest
  • HASE
  • Version Record
  • Integration Guide
    • EC Payment
      • Merchant API
        • Overview
        • Payment
        • Payment Methods
        • Response code
        • After Payment
          • Capture
          • Cancel
          • Refund
          • Cancel or Refund
          • Accept Notification
        • Features
          • Account Status Inquiry (ASI)
          • COF
          • Multi-Currency Transaction
          • Recurring
          • Smart Routing
          • Transaction Retry
          • Payout
          • Authentication
            • 3D Secure
            • FIDO Authentication
            • Authentication only
            • Authorization only
          • Tokenization
            • Gateway Tokenization
            • Create a gateway token
            • Network Tokenization
            • Pay with gateway token
            • Manage token
            • Network Token update notification
            • Card Based Network Token
    • In-store Payment
      • Merchant API(QR)
        • Payment
          • CPM
          • MPM
          • MPM static QR code
        • After Payment
          • Capture
          • Cancel
          • Refund
          • Cancel or Refund
          • Accept Notification
      • Merchant API (Card)
        • ZPK
          • ZPK
        • Payment
          • Payment
        • After Payment
          • Capture
          • Cancel
          • Refund
          • Cancel or Refund
          • Accept Notification
  • API Explorer
    • API Rules
    • PaymentMethod
      • PaymentMethod
      • PaymentMethod
      • PaymentMethod
      • PaymentMethod
    • FXRateInquiry
      • FXRateInquiry
      • FXRateInquiry
    • Payment
      • Payment
      • Payment
      • Payment
    • Payout
      • Payout
      • Payout
    • Capture
      • Capture
      • Capture
    • Cancel
      • Cancel
      • Cancel
    • Refund
      • Refund
      • Refund
    • Cryptogram
      • Cryptogram
      • Cryptogram
    • Cancel or Refund
      • Cancel or Refund
      • Cancel or Refund
    • Notification
      • Notification for PaymentMethod
      • Notification for Payment
      • Notification for Capture
      • Notification for Cancel
      • Notification for Refund
      • Notification for DataSubmission
      • Notification for MPM Static QR Code
      • Notification for Token Status Update
      • Notification for Settlement
      • Notification for Reversal
      • Notification for Cryptogram
      • Notification for Payout
    • Appendix
      • Result Code
      • Payment Brands
      • Payment Method Variant
      • Currency list
      • Country and region list
      • Product Code
    • HealthCheck
      • HealthCheck
    • Coupon Write-off
      • Coupon Write-off
    • Coupon Reversal
      • Coupon Reversal
    • ZPK
      • ZPK
latest
  • latest
  • HASE
  1. ZPK

ZPK

1. Overview#

This document explains how a Merchant Connect integration retrieves or refreshes a terminal-level ZPK (Zone PIN Key) before an offline card PIN transaction.
The ZPK endpoint is a key-management API. It does not authorize a card transaction and does not call a PSP. The returned ZPK is encrypted under the configured institution-level ZMK/BDK. The terminal or an approved secure component uses the returned key material to encrypt a PIN block, and sends the returned checkValue with the later Payment request so Merchant Connect can locate the correct ZPK version.
3DES clarification: In this document, 3DES means Triple DES encryption for PIN-block processing. It is not 3DS (3-D Secure cardholder authentication).
ItemDescription
InterfaceZPK retrieval
MethodGET
Path/g2/v1/payment/mer/{sid}/zpk?terminalID={terminalID}
ProtocolHTTPS + JSON response
InitiatorMerchant Host or approved POS integration
Request bodyNone
Key sourceInstitution-level ZMK/BDK
Key scopeInstitution + store sid + terminal ID
PIN algorithm3DES in the current release
PSP callNone
Follow-up operationUse checkValue in an offline card Payment request
The {sid} value represents the merchant/store identifier assigned to the target environment. It must not be hard-coded in a production integration.

2. Get a zpk#

LocationFieldRequiredTypeLengthDescription
PathsidYesString32Store identifier. It is also the store dimension of the ZPK binding.
QueryterminalIDYesString8Registered terminal identifier. It is the terminal dimension of the ZPK binding.
The request has no JSON body. The server derives the institution dimension by resolving the store represented by {sid}.

3. Authentication Headers#

HeaderRequiredDescription
AuthorizationYesMerchant Connect signature.
Content-TypeYesapplication/json; charset=utf-8.
DateTimeYesISO 8601 message timestamp.
MsgIDYesMerchant-generated request trace identifier.
SignTypeYesConfigured signing method, such as SHA256, SHA512, HMAC-SHA256, or HMAC-SHA512.
KeyIDConditionalRequired when multi-level signing keys are enabled.
Idempotency-KeyNot applicableThis GET endpoint has no request body; follow the deployment's standard GET retry and tracing policy.

4. Key Scope and Lifecycle#

4.1 Key scope#

Merchant Connect V1 uses terminal-level isolation for ZPK storage and lookup:
DimensionScopeDescription
Key sourceInstitutionBDK/ZMK is configured at institution level.
StoresidThe store is resolved from the request path.
TerminalterminalIDEach registered terminal has an independent ZPK.
VersioncheckValueEach generated ZPK version is identified by its check value.
A ZPK must not be reused across different stores or terminals. The same institution-level ZMK/BDK may be the derivation source, but the resulting ZPK binding remains terminal-specific.

4.2 Rotation and expiry#

RuleBehavior
Current ZPKThe latest ZPK for a terminal remains the current key until another ZPK is retrieved.
Previous ZPKWhen a new ZPK is generated, the previous version remains usable for one hour.
Version timingEach previous key has its own one-hour window; requesting another key does not extend older versions.
LookupPayment processing uses checkValue to locate the terminal's current or still-valid previous ZPK.
Missing or expired versionMerchant Connect returns B0034; the terminal should retrieve a new ZPK before retrying the related PIN transaction.

5. Response Fields#

Field pathRequired on successTypeLengthDescription
resultYesObject—Common response result container.
result.codeYesString8Response code. Success is S0000; key or validation failures use the documented error code.
result.messageYesString1024Human-readable response message.
zpkYes on successObject—ZPK result container. It is omitted on failure.
zpk.statusYes on successString20Result status: Success or Failed.
zpk.zpkYes on successString32ZPK ciphertext encrypted under the institution ZMK. It is not the plaintext ZPK.
zpk.checkValueYes on successString6Six-character hexadecimal check value used to identify the ZPK version during Payment processing.

6. Request and Response Examples#

All values below are placeholders. Do not replace them with production key material in documentation or source control.

6.1 Request#

The request has no body.

6.2 Successful response#

{
  "result": {
    "code": "S0000",
    "message": "Success"
  },
  "zpk": {
    "status": "Success",
    "zpk": "{{zpkCiphertext}}",
    "checkValue": "{{checkValue}}"
  }
}
zpk.zpk is an encrypted ZPK ciphertext. The integration must use the approved secure key-management process to unwrap it; the plaintext ZPK must never be exposed in logs, source code, or ordinary application storage.

6.3 Failure response: institution key is not configured#

{
  "result": {
    "code": "B0049",
    "message": "ZMK not exist"
  }
}

7. Using the ZPK in an Offline Card Payment#

After a successful ZPK response:
1.
The terminal or approved secure component unwraps the returned ZPK using the configured secure key process.
2.
The terminal encrypts the PIN block with the current-release 3DES method.
3.
The terminal sends the encrypted PIN and the returned check value in the Payment request.
4.
Merchant Connect locates the ZPK using the institution, store, terminal, and check value.
5.
If the check value identifies a current or less-than-one-hour-old previous key, Merchant Connect continues PIN processing.
6.
If the check value cannot be found or has expired, Merchant Connect returns B0034; retrieve a new ZPK and follow the approved retry policy.
Representative Payment fields:
{
  "paymentMethod": {
    "type": "card",
    "card": {
      "pin": {
        "encryptedPin": "{{encryptedPinBlock}}",
        "pinEncryptMethod": "3DES",
        "checkValue": "{{checkValue}}"
      }
    }
  },
  "transInitiator": {
    "platform": "POS",
    "paymentScenario": "inStore",
    "terminalID": "{{terminalId}}"
  }
}
The exact card, amount, currency, entry-mode, and terminal fields must follow the Payment API contract. This section only shows the ZPK-dependent PIN fields.

8. Validation and Error Handling#

The exact HTTP status and message format must follow the deployed Merchant Connect error table. Common ZPK outcomes include:
CodeMeaningClient action
S0000ZPK retrieved successfullySecurely process the ciphertext and retain checkValue.
C0000Institution not foundCheck the store configuration and institution mapping.
C0002Store not foundCorrect the sid and do not retry unchanged.
C0003Terminal not found under the requested store, including a cross-store terminalVerify the store-terminal relationship and terminalID.
B0001–B0004Group, merchant, store, or terminal status is invalidCorrect the resource status before retrying.
B0005Offline/ZPK capability is not enabledEnable the required product and configuration.
B0049Institution ZMK/BDK is not configuredConfigure the applicable institution key through the approved key-management process.
B0034Payment checkValue is missing, unknown, or expiredRetrieve a new ZPK and retry according to the transaction retry policy.
E0000System errorFollow the deployment retry and support procedure; do not log key material.
Do not blindly repeat a failed request when the cause is a resource, configuration, or key-version error.
Previous
Accept Notification
Next
Payment
Built with