Payment Void API
Sends a payment void/refund request from the merchant server to the Hecto Financial server.
Processes a refund (void) for a completed payment (direct debit) transaction. Use the transaction reference number of the original payment to process a void or refund.
API Information
POST/v1/api/pay/cancel
Content-Type
application/json테스트
https://tbnpay.settlebank.co.kr/v1/api/pay/cancel운영
https://npay.settlebank.co.kr/v1/api/pay/cancelRequest Parameters
타입 표기법
N숫자A영문H한글AN영문+숫자AHN영문+한글+숫자예: AN(10) = 영문+숫자, 최대 10byte
└hdInfoAN(50)Alphanumeric, up to 50 bytes*Message information code.
Message information code.
*Fixed value
└mchtIdAN(8)Alphanumeric, up to 8 bytes*Unique Merchant ID assigned by Hecto Financial.
Unique Merchant ID assigned by Hecto Financial.
└mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*Merchant void order number.
Merchant void order number.
*No Korean characters. This is the order number for the void request, not the original transaction order number.
└mchtCustIdAN(100)Alphanumeric, up to 100 bytes*
AES-256AES-256/ECB/PKCS5Padding + Base64 (Standard)Unique customer ID or key provided by the merchant.Unique customer ID or key provided by the merchant.
└mchtTrdDtN(8)Numeric, up to 8 bytes*Void order date.
Void order date.
*yyyyMMdd
└mchtTrdTmN(6)Numeric, up to 6 bytes*Void order time.
Void order time.
*HH24MISS
└trdAmtN(13)Numeric, up to 13 bytes*Transaction amount.
Transaction amount.
*Void transaction amount or partial void amount
└custAcntSumryAN(30)Alphanumeric, up to 30 bytesBank statement description.
Bank statement description.
*Text that will appear on the customer's bank statement (Korean: 3 bytes per character)
└splAmtN(13)Numeric, up to 13 bytesSupply amount.
Supply amount.
└vatN(13)Numeric, up to 13 bytesVAT amount.
VAT amount.
└svcAmtN(13)Numeric, up to 13 bytesService charge.
Service charge.
└trdNoAN(50)Alphanumeric, up to 50 bytes*Original transaction reference number.
Original transaction reference number.
*Hecto Financial transaction reference number
└custIpAN(15)Alphanumeric, up to 15 bytesCustomer IP address.
Customer IP address.
*The customer device's IP address, not the merchant server IP
└pktHashAN(200)Alphanumeric, up to 200 bytes*
SHA-256SHA-256 hash value.(실시간 생성)SHA-256 hash value.
*Merchant ID + customer ID (plaintext) + void order date + void order time + transaction amount + original transaction reference number + auth key
Request Hash Code
| Item | Combined fields |
|---|---|
| pktHash value | Merchant ID + customer ID (plaintext) + void order date + void order time + transaction amount + original transaction reference number + auth key |
Response Parameters
타입 표기법
N숫자A영문H한글AN영문+숫자AHN영문+한글+숫자예: AN(10) = 영문+숫자, 최대 10byte
└outStatCdAN(4)Alphanumeric, up to 4 bytes*Transaction status code (success/failure).
Transaction status code (success/failure).
0021: Success 0031: Failure└outRsltCdAN(4)Alphanumeric, up to 4 bytes*Decline code.
Decline code.
*Refer to rejection code table
└outRsltMsgAN(300)Alphanumeric, up to 300 bytes*Result message.
Processed successfully.Result message.
*Error details are returned when an error occurs.
└mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*Void order number.
OID201902210001Void order number.
*No Korean characters
└trdNoAN(40)Alphanumeric, up to 40 bytes*Void transaction reference number.
STFP_FIRM12345678901234567890Void transaction reference number.
*Hecto Financial transaction reference number
└trdAmtN(13)Numeric, up to 13 bytes*Refund amount.
1000Refund amount.
*Amount debited (transaction amount)
Request Example
{
"hdInfo": "SPAY_RT0W_1.0",
"mchtId": "midtest",
"mchtTrdNo": "OID201902210001",
"mchtCustId": "AES-encrypted customer ID",
"mchtTrdDt": "20191231",
"mchtTrdTm": "120000",
"trdAmt": "1000",
"custAcntSumry": "Kim Hecto",
"splAmt": "910",
"vat": "90",
"svcAmt": "0",
"trdNo": "STFP_FIRM12345676709",
"custIp": "127.0.0.1",
"pktHash": "hash value"
}
Response Example
{
"outStatCd": "0021",
"outRsltCd": "0000",
"outRsltMsg": "Processed successfully.",
"mchtTrdNo": "OID201902210001",
"trdNo": "STFP_FIRM12345678901234567890",
"trdAmt": "1000"
}
Need technical support?
Code Samples
HectoFinancial GitHub