TossPay Digital Wallet Payment (Checkout)
TossPay digital wallet payment is a service that processes payments through Toss. It supports TossPay card payment and Toss Money payment.
Test Key Information
API Information
POST/corp/main.do
Content-Type
application/x-www-form-urlencoded테스트
https://tbnpg.settlebank.co.kr/corp/main.do운영
https://npg.settlebank.co.kr/corp/main.doImportant Notes
NOTE
TossPay payment type
TossPay supports two payment types: card payment (CARD) and Toss Money (MONEY). Use the corpPayType parameter to distinguish them.
Request Parameters
타입 표기법
N숫자A영문H한글AN영문+숫자AHN영문+한글+숫자예: AN(10) = 영문+숫자, 최대 10byte
Required Parameters
└mchtIdAN(10)Alphanumeric, up to 10 bytes*Unique merchant ID assigned by Hecto Financial
Unique merchant ID assigned by Hecto Financial
hecto_test: TossPay digital wallet payment test└methodAN(20)Alphanumeric, up to 20 bytes*Payment method code
Payment method code
*Fixed value
└corpPayCodeAN(3)Alphanumeric, up to 3 bytes*Digital wallet provider code
Digital wallet provider code
*TossPay: TOS
└corpPayTypeA(5)Alphabetic, up to 5 bytes*Payment type
Payment type
CARD: Card payment MONEY: Toss Money└trdDtN(8)Numeric, up to 8 bytes*Request date (yyyyMMdd)
Request date (yyyyMMdd)
└trdTmN(6)Numeric, up to 6 bytes*Request time (HH24MISS)
Request time (HH24MISS)
└mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*Unique order number generated by the merchant (no Korean characters)
Unique order number generated by the merchant (no Korean characters)
└mchtNameAHN(100)Alphanumeric + Korean, up to 100 bytes*Merchant name
Merchant name
└pmtPrdtNmAHN(128)Alphanumeric + Korean, up to 128 bytes*Product name
Product name
└trdAmtN(12)Numeric, up to 12 bytes*
AES-256AES-256/ECB/PKCS5Padding + Base64Transaction amountTransaction amount
└notiUrlAN(250)Alphanumeric, up to 250 bytes*Webhook endpoint URL for server-to-server payment result delivery
Webhook endpoint URL for server-to-server payment result delivery
└nextUrlAN(250)Alphanumeric, up to 250 bytes*URL to redirect to after the payment result screen
URL to redirect to after the payment result screen
*Redirected when a button inside the checkout is clicked. Use the outStatCd value to check whether the payment succeeded (0021) or failed (0031).
└cancUrlAN(250)Alphanumeric, up to 250 bytes*URL to redirect to when the customer clicks the X button in the checkout
URL to redirect to when the customer clicks the X button in the checkout
*Browser close and back navigation are not detected.
└pktHashAN(200)Alphanumeric, up to 200 bytes*
SHA-256Hash value generated using SHA256(실시간 생성)Hash value generated using SHA256
NOTE
Hash generation combination
mchtId + method + mchtTrdNo + trdDt + trdTm + trdAmt (plaintext) + hashKey
Optional Parameters
└mchtParamAHN(4000)Alphanumeric + Korean, up to 4000 bytesMerchant reserved field (returned as-is when result is delivered)
Merchant reserved field (returned as-is when result is delivered)
└mchtCustIdAN(50)Alphanumeric, up to 50 bytes
AES-256AES-256/ECB/PKCS5Padding + Base64Merchant customer IDMerchant customer ID
Response Parameters
When payment is completed or fails, the parameters below are delivered via redirect to nextUrl. When the customer clicks the X button inside the checkout, they are redirected to cancUrl. Browser close and back navigation are not detected.
타입 표기법
N숫자A영문H한글AN영문+숫자AHN영문+한글+숫자예: AN(10) = 영문+숫자, 최대 10byte
Common Response
└mchtIdAN(10)Alphanumeric, up to 10 bytes*Merchant ID
hecto_testMerchant ID
└outStatCdAN(4)Alphanumeric, up to 4 bytes*Transaction status code
0021Transaction status code
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
└methodAN(20)Alphanumeric, up to 20 bytes*Payment method
corpPayment method
└mchtTrdNoAN(100)Alphanumeric, up to 100 bytes*Merchant order number
TOSSPAY20211231100000Merchant order number
└mchtCustIdAN(50)Alphanumeric, up to 50 bytes
AES-256AES-256/ECB/PKCS5PaddingMerchant customer IDHongGilDongMerchant customer ID
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
└trdNoAN(40)Alphanumeric, up to 40 bytes*Hecto Financial transaction number
STFP_PGCAnxca_jt_il0211129135810M1494620Hecto Financial transaction number
└trdAmtN(12)Numeric, up to 12 bytes*
AES-256AES-256/ECB/PKCS5PaddingTransaction amount1000Transaction amount
*실제 응답값은 AES-256 암호화된 값입니다. 복호화 후 사용하세요.
└mchtParamAHN(4000)Alphanumeric + Korean, up to 4000 bytesField value from the request returned as-is in the response
name=HongGilDong&age=25Field value from the request returned as-is in the response
└authDtN(14)Numeric, up to 14 bytesApproval datetime
20211231100000Approval datetime
Webhook (Payment Result)
After payment is completed, Hecto Financial sends a webhook to your server.
NOTE
Webhook reference
For TossPay payment result webhook parameters and processing method, see the Webhook document.
Need technical support?
Code Samples
HectoFinancial GitHub