Cancel Charge API

An API that cancels a credit card payment. Supports both full and partial cancellations.

Test Key Information

Important Notes

  • Cancellation is processed based on the original transaction number.
  • For partial cancellations, the cancellation sequence (cnclOrd) must be incremented sequentially.
  • An amount exceeding the cancellable balance cannot be cancelled.

API Information

POST/spay/APICancel.do
Content-Typeapplication/json
테스트https://tbgw.settlebank.co.kr/spay/APICancel.do
운영https://gw.settlebank.co.kr/spay/APICancel.do

Request Parameters

타입 표기법
N숫자A영문H한글AN영문+숫자AHN영문+한글+숫자
예: AN(10) = 영문+숫자, 최대 10byte

params Object

mchtIdAN(12)Alphanumeric, up to 12 bytes*
Unique merchant ID assigned by Hecto Financial
nxca_jt_il: Authenticated nxca_jt_bi: non-authenticated nxca_ks_gu: legacy-authenticated
verAN(4)Alphanumeric, up to 4 bytes*
Message version
*Fixed value
methodA(2)Alphabetic, up to 2 bytes*
Payment method
*Fixed value
bizTypeAN(2)Alphanumeric, up to 2 bytes*
Business type code
*Fixed value (for cancellation)
encCdN(2)Numeric, up to 2 bytes*
Encryption type code
*Fixed value
mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*
Unique order number generated by the merchant
trdDtN(8)Numeric, up to 8 bytes*
Cancellation request date (YYYYMMDD)
trdTmN(6)Numeric, up to 6 bytes*
Cancellation request time (HHMMSS)
mobileYnA(1)Alphabetic, up to 1 bytes
Mobile indicator
Y: Mobile web/app N: PC or other
osTypeA(1)Alphabetic, up to 1 bytes
OS type
A: Android I: IOS W: Windows M: Mac E: Other

data Object

pktHashAN(200)Alphanumeric, up to 200 bytes*SHA-256(실시간 생성)
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
crcCdA(3)Alphabetic, up to 3 bytes*
Currency type value
KRW: Domestic payment USD: International payment
cnclOrdN(3)Numeric, up to 3 bytes*
Cancellation sequence, starting from 001
*002 for the 2nd partial cancellation
taxTypeCdA(1)Alphabetic, up to 1 bytes
Tax exemption status. If blank, follows merchant default settings
Y: Tax-exempt N: Taxable G: Mixed taxation
cnclAmtN(12)Numeric, up to 12 bytes*AES-256AES-256/ECB/PKCS5Padding + Base64
Cancellation amount
*Domestic payment: 1000, International payment: 150 (ex [$1.50] => integer representation [150])
taxAmtN(12)Numeric, up to 12 bytesAES-256AES-256/ECB/PKCS5Padding + Base64
Taxable amount within the cancellation amount (required for mixed taxation)
vatAmtN(12)Numeric, up to 12 bytesAES-256AES-256/ECB/PKCS5Padding + Base64
VAT amount within the cancellation amount (required for mixed taxation)
taxFreeAmtN(12)Numeric, up to 12 bytesAES-256AES-256/ECB/PKCS5Padding + Base64
Tax-free amount within the cancellation amount (required for mixed taxation)
svcAmtN(12)Numeric, up to 12 bytesAES-256AES-256/ECB/PKCS5Padding + Base64
Service charge within the cancellation amount
cnclRsnAHN(255)Alphanumeric + Korean, up to 255 bytes
Cancellation reason. Enter a cancellation reason message if needed

Response Parameters

params Object

mchtIdAN(12)Alphanumeric, up to 12 bytes*nxca_jt_il
Unique merchant ID assigned by Hecto Financial
verAN(4)Alphanumeric, up to 4 bytes*0A19
Message version
*Fixed value
methodA(2)Alphabetic, up to 2 bytes*CA
Payment method
*Fixed value
bizTypeAN(2)Alphanumeric, up to 2 bytes*C0
Business type code
*Fixed value for cancellation
encCdN(2)Numeric, up to 2 bytes*23
Encryption type code
*Fixed value
mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*ORDER20211231100000
Unique order number generated by the merchant
trdNoAN(40)Alphanumeric, up to 40 bytes*STFP_PGCAnxca_jt_il0211129135810M1494620
Unique transaction number generated by Hecto Financial
trdDtN(8)Numeric, up to 8 bytes*20211231
Cancellation request date (YYYYMMDD)
trdTmN(6)Numeric, up to 6 bytes*100000
Cancellation request time (HHMMSS)
outStatCdAN(4)Alphanumeric, up to 4 bytes*0021
Transaction status code (success/failure)
0021: Success 0031: Failure
outRsltCdAN(4)Alphanumeric, up to 4 bytes*0000
Decline code. Detailed code provided when transaction status is '0031'
outRsltMsgAHN(200)Alphanumeric + Korean, up to 200 bytes*Processed successfully.
Result message (URL Encoding, UTF-8)

data Object

pktHashAN(64)Alphanumeric, up to 64 bytes*
Hash value from request returned as-is
orgTrdNoAN(40)Alphanumeric, up to 40 bytes*STFP_PGCAnxca_jt_il0211129135810M1494620
Transaction number issued by Hecto Financial at the time of payment
cnclAmtN(12)Numeric, up to 12 bytes*AES-256AES-256/ECB/PKCS5Padding1000
Cancellation amount
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
cardCnclAmtN(12)Numeric, up to 12 bytes*AES-256AES-256/ECB/PKCS5Padding5000
Credit card cancellation amount out of the total amount
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
pntCnclAmtN(12)Numeric, up to 12 bytes*AES-256AES-256/ECB/PKCS5Padding1000
Point cancellation amount out of the total amount
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
blcAmtN(12)Numeric, up to 12 bytes*AES-256AES-256/ECB/PKCS5Padding0
Remaining cancellable balance based on the transaction number after successful cancellation
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
dcCnclAmtN(12)Numeric, up to 12 bytesAES-256AES-256/ECB/PKCS5Padding1000
Cancelled discount amount
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
dcCnclYnA(1)Alphabetic, up to 1 bytesY
Discount cancellation indicator (Y if discount cancellation amount exists, N otherwise)
Y: Discount cancelled N: No discount cancellation

Webhook (Cancellation Result)

Cancellation webhook is not provided by default

Credit card 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).
NOTE

Webhook Reference

When cancellation webhooks are enabled, they are delivered in the same format as the credit card webhook. View webhook documentation
💬

Need technical support?