Cancel Digital Wallet Payment API
This API processes full or partial cancellations for digital wallet payment transactions (PAYCO, KakaoPay, NaverPay, TossPay, etc.).
Test Key Information
API Information
POST/spay/APICancel.do
Content-Type
application/json테스트
https://tbgw.settlebank.co.kr/spay/APICancel.do운영
https://gw.settlebank.co.kr/spay/APICancel.doImportant Notes
NOTE
Digital wallet cancellation notice
Digital wallet payment cancellation follows the policies of each service provider (PAYCO, KakaoPay, NaverPay, TossPay, etc.).
- Both full and partial cancellations are supported.
- For partial cancellations, increment the cancellation sequence (
cnclOrd) sequentially for each request. - Cancellation policies may vary by digital wallet provider.
- Upon successful cancellation, the remaining cancellable balance is returned in the response.
KakaoPay partial cancellation not supported in sandbox
KakaoPay partial cancellation is not supported in the sandbox environment. It is available normally in the production environment.
Request Parameters
타입 표기법
N숫자A영문H한글AN영문+숫자AHN영문+한글+숫자예: AN(10) = 영문+숫자, 최대 10byte
params Object
└mchtIdAN(10)Alphanumeric, up to 10 bytes*Unique merchant ID assigned by Hecto Financial
Unique merchant ID assigned by Hecto Financial
hecto_test: Digital wallet payment test└verAN(4)Alphanumeric, up to 4 bytes*Message version
Message version
*Fixed value
└methodA(2)Alphabetic, up to 2 bytes*Payment method
Payment method
*Fixed value (PZ: Digital Wallet)
└bizTypeAN(2)Alphanumeric, up to 2 bytes*Business type code
Business type code
*Fixed value (C0: Cancellation)
└encCdN(2)Numeric, up to 2 bytes*Encryption classification code
Encryption classification code
*Fixed value
└mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*Unique order number generated by the merchant
Unique order number generated by the merchant
└trdDtN(8)Numeric, up to 8 bytes*Cancellation request date (YYYYMMDD)
Cancellation request date (YYYYMMDD)
└trdTmN(6)Numeric, up to 6 bytes*Cancellation request time (HHMMSS)
Cancellation request time (HHMMSS)
└mobileYnA(1)Alphabetic, up to 1 bytesMobile indicator
Mobile indicator
Y: Mobile web/app N: PC or other└osTypeA(1)Alphabetic, up to 1 bytesOS type
OS type
A: Android I: iOS W: Windows M: Mac E: Otherdata Object
└pktHashAN(64)Alphanumeric, up to 64 bytes*
SHA-256Hash value generated using SHA256(실시간 생성)Hash value generated using SHA256
NOTE
Hash generation combination
trdDt + trdTm + mchtId + mchtTrdNo + cnclAmt (plaintext) + hashKey
└orgTrdNoAN(40)Alphanumeric, up to 40 bytes*Transaction number issued by Hecto Financial at the time of payment
Transaction number issued by Hecto Financial at the time of payment
└crcCdA(3)Alphabetic, up to 3 bytes*Currency classification value
Currency classification value
*Fixed value
└cnclOrdN(3)Numeric, up to 3 bytes*Cancellation sequence (starts from 001; use 002 for the 2nd partial cancellation)
Cancellation sequence (starts from 001; use 002 for the 2nd partial cancellation)
└cnclAmtN(12)Numeric, up to 12 bytes*
AES-256AES-256/ECB/PKCS5Padding + Base64Cancellation amountCancellation amount
└taxTypeCdA(1)Alphabetic, up to 1 bytesTax exemption status
Tax exemption status
N: Taxable Y: Tax-exempt G: Mixed tax└taxAmtN(12)Numeric, up to 12 bytes
AES-256AES-256/ECB/PKCS5Padding + Base64Taxable amount of the cancellation amount (required for mixed tax)Taxable amount of the cancellation amount (required for mixed tax)
└vatAmtN(12)Numeric, up to 12 bytes
AES-256AES-256/ECB/PKCS5Padding + Base64VAT amount of the cancellation amount (required for mixed tax)VAT amount of the cancellation amount (required for mixed tax)
└taxFreeAmtN(12)Numeric, up to 12 bytes
AES-256AES-256/ECB/PKCS5Padding + Base64Tax-exempt amount of the cancellation amount (required for mixed tax)Tax-exempt amount of the cancellation amount (required for mixed tax)
└svcAmtN(12)Numeric, up to 12 bytes
AES-256AES-256/ECB/PKCS5Padding + Base64Service charge of the cancellation amountService charge of the cancellation amount
└cnclRsnAHN(255)Alphanumeric + Korean, up to 255 bytesCancellation reason
Cancellation reason
Response Parameters
타입 표기법
N숫자A영문H한글AN영문+숫자AHN영문+한글+숫자예: AN(10) = 영문+숫자, 최대 10byte
params Object
└mchtIdAN(10)Alphanumeric, up to 10 bytes*Merchant ID
hecto_testMerchant ID
└verAN(4)Alphanumeric, up to 4 bytes*Message version
0A19Message version
└methodA(2)Alphabetic, up to 2 bytes*Payment method
PZPayment method
└bizTypeAN(2)Alphanumeric, up to 2 bytes*Business type code
C0Business type code
└encCdN(2)Numeric, up to 2 bytes*Encryption classification code
23Encryption classification code
└mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*Merchant order number
ORDER20211231100000Merchant order number
└trdNoAN(40)Alphanumeric, up to 40 bytes*Hecto Financial transaction number
STFP_PGPZhecto_test0211129135810M1494620Hecto Financial transaction number
└trdDtN(8)Numeric, up to 8 bytes*Cancellation request date (YYYYMMDD)
20211231Cancellation request date (YYYYMMDD)
└trdTmN(6)Numeric, up to 6 bytes*Cancellation request time (HHMMSS)
100000Cancellation request time (HHMMSS)
└outStatCdAN(4)Alphanumeric, up to 4 bytes*Transaction status code (success/failure)
0021Transaction status code (success/failure)
0021: Success 0031: Failure└outRsltCdAN(4)Alphanumeric, up to 4 bytes*Result code
0000Result code
└outRsltMsgAHN(200)Alphanumeric + Korean, up to 200 bytes*Result message
Processed successfully.Result message
data Object
└pktHashAN(64)Alphanumeric, up to 64 bytes*Hash value from the request returned as-is
f395b6725a9a18...Hash value from the request returned as-is
└orgTrdNoAN(40)Alphanumeric, up to 40 bytes*Transaction number issued by Hecto Financial at the time of payment
STFP_PGPZhecto_test0211129135810M1494620Transaction number issued by Hecto Financial at the time of payment
└cnclAmtN(12)Numeric, up to 12 bytes*
AES-256AES-256/ECB/PKCS5PaddingCancellation amount1000Cancellation amount
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
└blcAmtN(12)Numeric, up to 12 bytes*
AES-256AES-256/ECB/PKCS5PaddingRemaining cancellable balance based on the transaction number after successful cancellation0Remaining cancellable balance based on the transaction number after successful cancellation
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
└cardCnclAmtN(12)Numeric, up to 12 bytes*
AES-256AES-256/ECB/PKCS5PaddingCredit card cancellation amount out of the total5000Credit card cancellation amount out of the total
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
└pntCnclAmtN(12)Numeric, up to 12 bytes*
AES-256AES-256/ECB/PKCS5PaddingPoints cancellation amount out of the total (only applicable when the original transaction was a combined payment)0Points cancellation amount out of the total (only applicable when the original transaction was a combined payment)
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
└coupCnclAmtN(12)Numeric, up to 12 bytes*Coupon cancellation amount out of the total
1000Coupon cancellation amount out of the total
Need technical support?
Code Samples
HectoFinancial GitHub