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-Typeapplication/json
테스트https://tbnpay.settlebank.co.kr/v1/api/pay/cancel
운영https://npay.settlebank.co.kr/v1/api/pay/cancel

Request Parameters

타입 표기법
N숫자A영문H한글AN영문+숫자AHN영문+한글+숫자
예: AN(10) = 영문+숫자, 최대 10byte
hdInfoAN(50)Alphanumeric, up to 50 bytes*
Message information code.
*Fixed value
mchtIdAN(8)Alphanumeric, up to 8 bytes*
Unique Merchant ID assigned by Hecto Financial.
mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*
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.
mchtTrdDtN(8)Numeric, up to 8 bytes*
Void order date.
*yyyyMMdd
mchtTrdTmN(6)Numeric, up to 6 bytes*
Void order time.
*HH24MISS
trdAmtN(13)Numeric, up to 13 bytes*
Transaction amount.
*Void transaction amount or partial void amount
custAcntSumryAN(30)Alphanumeric, up to 30 bytes
Bank statement description.
*Text that will appear on the customer's bank statement (Korean: 3 bytes per character)
splAmtN(13)Numeric, up to 13 bytes
Supply amount.
vatN(13)Numeric, up to 13 bytes
VAT amount.
svcAmtN(13)Numeric, up to 13 bytes
Service charge.
trdNoAN(50)Alphanumeric, up to 50 bytes*
Original transaction reference number.
*Hecto Financial transaction reference number
custIpAN(15)Alphanumeric, up to 15 bytes
Customer IP address.
*The customer device's IP address, not the merchant server IP
pktHashAN(200)Alphanumeric, up to 200 bytes*SHA-256(실시간 생성)
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

ItemCombined fields
pktHash valueMerchant 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).
0021: Success 0031: Failure
outRsltCdAN(4)Alphanumeric, up to 4 bytes*
Decline code.
*Refer to rejection code table
outRsltMsgAN(300)Alphanumeric, up to 300 bytes*Processed successfully.
Result message.
*Error details are returned when an error occurs.
mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*OID201902210001
Void order number.
*No Korean characters
trdNoAN(40)Alphanumeric, up to 40 bytes*STFP_FIRM12345678901234567890
Void transaction reference number.
*Hecto Financial transaction reference number
trdAmtN(13)Numeric, up to 13 bytes*1000
Refund 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?