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-Type
application/jsonSandbox
https://tbgw.settlebank.co.kr/spay/APICancel.doProduction
https://gw.settlebank.co.kr/spay/APICancel.doRequest Parameters
Type Notation
NNumericAAlphabeticHKoreanANAlphanumericAHNAlphanumeric + Koreane.g. AN(10) = alphanumeric, up to 10 bytes
params Object
└mchtIdAN(12)Alphanumeric, up to 12 bytes*Unique merchant ID assigned by Hecto Financial
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
Message version
*Fixed value
└methodA(2)Alphabetic, up to 2 bytes*Payment method
Payment method
*Fixed value
└bizTypeAN(2)Alphanumeric, up to 2 bytes*Business type code
Business type code
*Fixed value (for cancellation)
└encCdN(2)Numeric, up to 2 bytes*Encryption type code
Encryption type 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(200)Alphanumeric, up to 200 bytes*
SHA-256Hash value generated using SHA256(auto-generated)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 type value
Currency type value
KRW: Domestic payment USD: International payment└cnclOrdN(3)Numeric, up to 3 bytes*Cancellation sequence, starting from 001
Cancellation sequence, starting from 001
*002 for the 2nd partial cancellation
└taxTypeCdA(1)Alphabetic, up to 1 bytesTax exemption status. If blank, follows merchant default settings
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 + Base64Cancellation amountCancellation amount
*Domestic payment: 1000, International payment: 150 (ex [$1.50] => integer representation [150])
└taxAmtN(12)Numeric, up to 12 bytes
AES-256AES-256/ECB/PKCS5Padding + Base64Taxable amount within the cancellation amount (required for mixed taxation)Taxable amount within the cancellation amount (required for mixed taxation)
└vatAmtN(12)Numeric, up to 12 bytes
AES-256AES-256/ECB/PKCS5Padding + Base64VAT amount within the cancellation amount (required for mixed taxation)VAT amount within the cancellation amount (required for mixed taxation)
└taxFreeAmtN(12)Numeric, up to 12 bytes
AES-256AES-256/ECB/PKCS5Padding + Base64Tax-free amount within the cancellation amount (required for mixed taxation)Tax-free amount within the cancellation amount (required for mixed taxation)
└svcAmtN(12)Numeric, up to 12 bytes
AES-256AES-256/ECB/PKCS5Padding + Base64Service charge within the cancellation amountService charge within the cancellation amount
└cnclRsnAHN(255)Alphanumeric + Korean, up to 255 bytesCancellation reason. Enter a cancellation reason message if needed
Cancellation reason. Enter a cancellation reason message if needed
Response Parameters
params Object
└mchtIdAN(12)Alphanumeric, up to 12 bytes*Unique merchant ID assigned by Hecto Financial
nxca_jt_ilUnique merchant ID assigned by Hecto Financial
└verAN(4)Alphanumeric, up to 4 bytes*Message version
0A19Message version
*Fixed value
└methodA(2)Alphabetic, up to 2 bytes*Payment method
CAPayment method
*Fixed value
└bizTypeAN(2)Alphanumeric, up to 2 bytes*Business type code
C0Business type code
*Fixed value for cancellation
└encCdN(2)Numeric, up to 2 bytes*Encryption type code
23Encryption type code
*Fixed value
└mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*Unique order number generated by the merchant
ORDER20211231100000Unique order number generated by the merchant
└trdNoAN(40)Alphanumeric, up to 40 bytes*Unique transaction number generated by Hecto Financial
STFP_PGCAnxca_jt_il0211129135810M1494620Unique transaction number generated by Hecto Financial
└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*Decline code. Detailed code provided when transaction status is '0031'
0000Decline code. Detailed code provided when transaction status is '0031'
└outRsltMsgAHN(200)Alphanumeric + Korean, up to 200 bytes*Result message (URL Encoding, UTF-8)
Processed successfully.Result message (URL Encoding, UTF-8)
data Object
└pktHashAN(64)Alphanumeric, up to 64 bytes*Hash value from request returned as-is
Hash value from request returned as-is
└orgTrdNoAN(40)Alphanumeric, up to 40 bytes*Transaction number issued by Hecto Financial at the time of payment
STFP_PGCAnxca_jt_il0211129135810M1494620Transaction number issued by Hecto Financial at the time of payment
└cnclAmtN(12)Numeric, up to 12 bytes*
AES-256AES-256/ECB/PKCS5PaddingCancellation amount1000Cancellation amount
*Certain response fields are AES-256 encrypted. Decrypt them before use.
└cardCnclAmtN(12)Numeric, up to 12 bytes*
AES-256AES-256/ECB/PKCS5PaddingCredit card cancellation amount out of the total amount5000Credit card cancellation amount out of the total amount
*Certain response fields are AES-256 encrypted. Decrypt them before use.
└pntCnclAmtN(12)Numeric, up to 12 bytes*
AES-256AES-256/ECB/PKCS5PaddingPoint cancellation amount out of the total amount1000Point cancellation amount out of the total amount
*Certain response fields are AES-256 encrypted. Decrypt them before use.
└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
*Certain response fields are AES-256 encrypted. Decrypt them before use.
└dcCnclAmtN(12)Numeric, up to 12 bytes
AES-256AES-256/ECB/PKCS5PaddingCancelled discount amount1000Cancelled discount amount
*Certain response fields are AES-256 encrypted. Decrypt them before use.
└dcCnclYnA(1)Alphabetic, up to 1 bytesDiscount cancellation indicator (Y if discount cancellation amount exists, N otherwise)
YDiscount cancellation indicator (Y if discount cancellation amount exists, N otherwise)
Y: Discount cancelled N: No discount cancellationWebhook (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
