Digital Wallet Webhook
When a transaction is successfully completed, Hecto Financial sends a webhook to your server. For details, see the notiUrl guide.
This document applies to webhooks for the following digital wallet payment methods:
| Digital Wallet | Code | Webhook Doc |
|---|---|---|
| KakaoPay | KKP | This document |
| NaverPay | NVP | This document |
| PAYCO | PAC | This document |
| TossPay | TOS | This document |
| Samsung Pay | SPP | Credit Card Webhook |
NOTE
What is notiUrl?
notiUrl is a server-to-server webhook that delivers the payment result directly from the Hecto Financial server to your server. It does not go through the browser, allowing stable receipt of results.
Communication Specification
| Item | Description |
|---|---|
| Method | POST |
| Content-Type | application/x-www-form-urlencoded; charset=UTF-8 |
| Response Format | Plain Text (OK or FAIL) |
Cancellation Webhook Notice
Cancellation webhook is not provided by default
Digital wallet cancellation results are confirmed via API response, so cancellation webhooks are not sent by default. If you need cancellation webhooks, contact your sales representative or technical support (pgsupport@hecto.co.kr).
Webhook Parameters
타입 표기법
N숫자A영문H한글AN영문+숫자AHN영문+한글+숫자예: AN(10) = 영문+숫자, 최대 10byte
└outStatCdAN(4)Alphanumeric, up to 4 bytes*Transaction status
0021Transaction status
0021: Success└trdNoAN(40)Alphanumeric, up to 40 bytes*Unique transaction number assigned by Hecto Financial
STFP_PGPZhecto_test0211129135810M1494620Unique transaction number assigned by Hecto Financial
└methodA(2)Alphabetic, up to 2 bytes*Payment method
PZPayment method
PZ: Digital Wallet└bizTypeAN(2)Alphanumeric, up to 2 bytes*Business type
B0Business type
B0: Approval C0: Cancellation└mchtIdAN(10)Alphanumeric, up to 10 bytes*Merchant ID assigned by Hecto Financial
hecto_testMerchant ID assigned by Hecto Financial
└mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*Unique order number generated by the merchant
ORDER20211231100000Unique order number generated by the merchant
└ezpDivCdA(3)Alphabetic, up to 3 bytes*Digital wallet provider classification code
KKPDigital wallet provider classification code
KKP: KakaoPay NVP: NaverPay PAC: PAYCO TOS: TossPay└mchtNameAHN(20)Alphanumeric + Korean, up to 20 bytesMerchant name
Hecto FinancialMerchant name
└pmtprdNmAHN(128)Alphanumeric + Korean, up to 128 bytesProduct name ordered by the customer
Test ProductProduct name ordered by the customer
└trdDtmN(14)Numeric, up to 14 bytes*Transaction datetime. Format: YYYYMMDDhhmmss
20211231100000Transaction datetime. Format: YYYYMMDDhhmmss
└trdAmtN(12)Numeric, up to 12 bytesTransaction amount
1000Transaction amount
└cardCdAN(10)Alphanumeric, up to 10 bytesCard company code (for card payment)
NHCCard company code (for card payment)
└cardNmAHN(20)Alphanumeric + Korean, up to 20 bytesCard company name
NH CheckCard company name
└emailAN(60)Alphanumeric, up to 60 bytesMerchant customer email
HongGilDong@example.comMerchant customer email
└mchtCustIdAN(50)Alphanumeric, up to 50 bytesMerchant customer ID
HongGilDongMerchant customer ID
└cardNoAN(20)Alphanumeric, up to 20 bytesMasked card number
123456******7890Masked card number
*For KakaoPay, only the BIN number is provided.
For NaverPay, the approval may use an OTC (One Time Card, one-time card number), which may differ from the actual card number.
For NaverPay, the approval may use an OTC (One Time Card, one-time card number), which may differ from the actual card number.
└cardApprNoAN(15)Alphanumeric, up to 15 bytesCard approval number
30001234Card approval number
└instmtMonN(2)Numeric, up to 2 bytesInstallment months
00Installment months
└instmtTypeA(1)Alphabetic, up to 1 bytesY if the installment month is part of a card company event (optional based on merchant settings)
NY if the installment month is part of a card company event (optional based on merchant settings)
└orgTrdNoAN(40)Alphanumeric, up to 40 bytesOriginal transaction number for cancellations
STFP_PGPZhecto_test0211129135810M1494620Original transaction number for cancellations
└orgTrdDtN(8)Numeric, up to 8 bytesOriginal transaction date for cancellations
20211231Original transaction date for cancellations
└pntAmtN(13)Numeric, up to 13 bytes*Points/Money payment amount out of the total
0Points/Money payment amount out of the total
*For NaverPay, points and money are combined and provided as a single total
└cardAmtN(13)Numeric, up to 13 bytes*Credit card amount out of the total
3000Credit card amount out of the total
└coupAmtN(13)Numeric, up to 13 bytes*Coupon amount out of the total
1000Coupon amount out of the total
└kkmAmtN(13)Numeric, up to 13 bytesKakao Money amount
5000Kakao Money amount
└mnyAmtN(13)Numeric, up to 13 bytesTossPay Money amount
5000TossPay Money amount
*For TossPay (TOS) payments, the amount paid with TossPay Money out of the total
└csrcIssAmtN(13)Numeric, up to 13 bytesCash receipt issuance eligible amount
3000Cash receipt issuance eligible amount
*Delivered only for NaverPay payments. For simple payments other than NaverPay (KakaoPay, PAYCO, TossPay, etc.), the cash receipt is handled directly by each provider, so this parameter is not delivered.
For NaverPay, complimentary points (issued via events/promotions) are excluded from the point/money payment amount.
For NaverPay, complimentary points (issued via events/promotions) are excluded from the point/money payment amount.
└cnclTypeN(2)Numeric, up to 2 bytesCancellation transaction type
00Cancellation transaction type
00: Full cancellation 10: Partial cancellation└csrcIssNoAN(30)Alphanumeric, up to 30 bytesCash receipt approval number
0123456789Cash receipt approval number
*Delivered only for NaverPay payments. For simple payments other than NaverPay (KakaoPay, PAYCO, TossPay, etc.), the cash receipt is handled directly by each provider, so this parameter is not delivered.
└mchtParamAHN(4000)Alphanumeric + Korean, up to 4000 bytesAdditional merchant information field. The value passed in the request is returned as-is.
name=HongGilDong&age=25Additional merchant information field. The value passed in the request is returned as-is.
└pktHashAN(64)Alphanumeric, up to 64 bytes*SHA256 hash value
a2d6d597d55d7c9b689baa2e08c1ddf0ce71f4248c5b9b59fe61bfbf949543e1SHA256 hash value
NOTE
Hash generation combination
outStatCd + transaction date (first 8 digits of trdDtm) + transaction time (last 6 digits of trdDtm) + mchtId + mchtTrdNo + trdAmt (plaintext) + hashKey
Webhook Response (Merchant → Hecto Financial)
Your server sends a response back to Hecto Financial.
| Response | Description |
|---|---|
OK | Success (uppercase). Processed as webhook received. |
FAIL or others | Recognized as failure; resent up to the configured number of times per merchant. Sending stops after exceeding the resend deadline. |
Response format note
The response must be plain text 'OK' only. If spaces or other characters are included, it will be considered a failure and resending will occur.
Hash Verification
Hash verification required
To check for data tampering, you must verify the hash data received via notiUrl. Only provide the service when the hash matches.
| Item | Combination Fields |
|---|---|
| pktHash | outStatCd + transaction date (first 8 digits of trdDtm) + transaction time (last 6 digits of trdDtm) + mchtId + mchtTrdNo + trdAmt (plaintext) + hashKey |
Webhook Example
Payment Webhook (Hecto Financial → Merchant)
POST /your-noti-url HTTP/1.1
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
outStatCd=0021
&trdNo=STFP_PGPZhecto_test0211231100000M1234567
&method=PZ
&bizType=B0
&mchtId=hecto_test
&mchtTrdNo=ORDER20211231100000
&ezpDivCd=KKP
&mchtName=HectoFinancial
&pmtprdNm=Test Product
&trdDtm=20211231100000
&trdAmt=50000
&cardCd=NHC
&cardNm=NH Check
&cardNo=123456******7890
&cardApprNo=30001234
&instmtMon=00
&pntAmt=0
&cardAmt=50000
&coupAmt=0
&email=test@example.com
&mchtCustId=customer123
&mchtParam=
&pktHash=a2d6d597d55d7c9b689baa2e08c1ddf0ce71f4248c5b9b59fe61bfbf949543e1
Response (Merchant → Hecto Financial)
OK
Need technical support?
Code Samples
HectoFinancial GitHub