Pre-Auth & Capture - Registration API Credit Card
About Pre-Auth & Capture - Registration API Credit Card
Pre-Auth & Capture is another feature from Credit Card where the Merchant can hold or do the Pre-Auth process beforehand from the paid fund from the Customer.
Then, You need to validate for that fund transaction also known as Capture so that the fund logs into Your Bank account. If you want to do the Capture process after the Pre-Auth expired time finished, then that transaction will considered as Void, and that fund transaction will return to Your Customer.
So, we recommend doing the Capture process as soon as possible before the Pre-Auth expiry time finished.
Learn about Credit Card Payment feature with PreAuth & Capture on Pre-Authorization & Capture in Credit Card.
Pre-Auth & Capture - Registration API Credit Card
API Endpoint | /nicepay/direct/v2/registration |
|---|---|
Request Method | POST |
Description | Pre-Auth & Capture |
Merchant Token | SHA256(timeStamp+iMid+referenceNo+amt+merchantKey) |
Request Format | application/json |
Request Parameter for Pre-Auth & Capture - Registration API Credit Card
The first step that should do is to activate the Pre-Auth & Capture feature to register the Credit Card transaction beforehand on this API Registration.
This process need to be done so You can get the tXid that will use later to proceed with the Pre-Auth process.
Parameter | Type | Size | Description | Example / Notes |
|---|---|---|---|---|
timeStamp Required | N | 14 | Request Timestamp (YYYYMMDDHH24MISS) | 20221202141217 |
iMid Required | AN | 10 | Merchant ID | IONPAYTEST |
payMethod Required | N | 2 | 01 | |
currency Required | A | 3 | Currency | IDR |
amt Required | N | 12 | Amount (number not in float format) | 10000 (Total sum amount goods from cartData) |
referenceNo Required | ANS | 40 | Merchant's Reference Number | ordNo20221202141217 |
goodsNm Required | AN | 100 | Goods Name | Testing Transaction |
billingNm Required | A | 100 | Buyer Name | John Doe |
billingPhone Required | N | 15 | Buyer Phone Number | 2112345678 |
billingEmail Required | ANS | 40 | Buyer E-mail | |
billingAddr Required | AN | 100 | Buyer Address | Jln. Raya Kasablanka Kav.88 |
billingCity Required | A | 50 | Buyer City | South Jakarta |
billingState Required | A | 50 | Billing State | DKI Jakarta |
billingPostCd Required | N | 10 | Billing Post Number | 14350 |
billingCountry Required | A | 10 | Billing Country | Indonesia |
cartData Optional | JSONstring | 4000 | Cart Data | {} |
instmntType Required | N | 2 | 1 (For PreAuth & Recurring default 1) | |
instmntMon Required | N | 2 | Installment Month 1: 1 Month/Full Payment, if instmntType: null/1 | 1 (For PreAuth & Recurring default 1) |
recurrOpt Required | N | 2 | 0: Automatic Cancel 1: Do not cancel 2: Do not make token | 2 |
dbProcessUrl Required | ANS | 255 | Notification URL | https://merchant.com/dbProcessUrl |
userIP Required for CC, E-Wallet, Payloan, QRIS | AN | 15 | User IP | 127.0.0.1 |
merchantToken Required | AN | 255 | Merchant Token | c91e6531f6c84869439bc5ebe5389bd71e7752c054fc9dbfe193d087a1b797ae |
description | AN | 100 | Transaction Description | Test Transaction |
userSessionID | AN | 100 | User Session ID | userSessionID |
userAgent | ANS | 100 | User Agent | Mozilla |
userLanguage | A | 2 | User Language | en-US |
Cart Data for Full Payment & Installment - Registration API Credit Card
cartData on request parameter at Credit Card Registration uses to cover the goods or items will be paid to Your Customer including the item detail and each item price.
Parameter | Description | Example |
|---|---|---|
Count | Total sum from the whole cart data | 2 |
Item | Divide into 5 types of parameter such as img_url, goods_id, goods_name, goods_detail and goods_amt | - |
Detail explaination on Item parameter.
Parameter | Description | Example |
|---|---|---|
img_url | URL Item Picture (Size 50px x 50px) | htttps://www.merchant.com/image_goods1.jpg |
goods_id | Item ID | NICEPRDID1 |
goods_name | Item Name | Nama Item-1 |
goods_detail | Item Detail Description | Detail Item-1 |
goods_amt | Item Price | 1000 |
Sample JSON Cart Data
{
"count": "2",
"item": [
{
"img_url": "http://www.merchant.com/image_goods1.jpg",
"goods_id": "NICEPRDID1",
"goods_name": "Item 1 Name",
"goods_detail": "Item 1 Detail",
"goods_amt": "1000"
},
{
"img_url": "http://www.merchant.com/image_goods2.jpg",
"goods_id": "NICEPRDID1",
"goods_name": "Item 2 Name",
"goods_detail": "Item 2 Detail",
"goods_amt": "1000"
}
]
}
Response Parameter for Pre-Auth & Capture - Registration API Credit Card
The following is the response parameter from the transaction registration request result for Pre-Auth & Capture type that already proceed with Credit Card payment.
The parameter result needed to proceed to the next process from this response result is only tXid.
To proceed to the next stage, please visit Pre-Auth & Capture - Payment API Credit Card page.
Parameter | Type | Size | Description | Example / Notes |
|---|---|---|---|---|
resultCd | N | 4 | Result Code | 0000 |
resultMsg | AN | 255 | Result Message: Error Code | SUCCESS |
tXid | AN | 30 | Transaction ID | PACTEST00101202206241007570327 |
referenceNo | ANS | 40 | Merchant Reference Number | ordNo20221215101254 |
payMethod | N | 2 | 01 | |
amt | N | 12 | Payment Amount | 10000 |
transDt | N | 8 | Transaction Date (YYYYMMDD) | 20221212 |
transTm | N | 6 | Transaction Time (HH24MISS) | 121212 |
description | AN | 100 | Transaction Description | Testing Transaction Credit Card |
bankCd | A | 4 | Bank Code | null |
vacctNo | N | 20 | Virtual Account | null |
mitraCd | A | 4 | Mitra Code | null |
payNo | N | 12 | CVS Payment Number | null |
currency | A | 3 | Currency | IDR |
goodsNm | AN | 100 | Goods Name | Goods For Testing Transaction |
billingNm | A | 100 | Buyer Name | John Doe |
vacctValidDt | N | 8 | VA Expiry Date (YYYYMMDD) | null |
vacctValidTm | N | 6 | VA Expiry Time (HH24MISS) | null |
payValidDt | N | 8 | Expiry Date (YYYYMMDD) | null |
payValidTm | N | 6 | Expiry Time (HH24MISS) | null |
requestURL | ANS | 360 | Request URL | null |
paymentExpDt | N | 6 | QR Payment Expiry Date (YYYYMMDD) | null |
paymentExpTm | N | 6 | QR Payment Expiry Time (HH24MISS) | null |
qrContent | ANS | 360 | QR String in Plain Text | null |
qrUrl | ANS | 360 | URL for QR Image, Valid for 5 minutes | null |
Please check NICEPAY Code to know the common code also response code on Credit Card payment method or other NICEPAY payment methods.
Sample Parameter for Pre-Auth & Capture - Registration API Credit Card
Request Parameter
const nicepayClient = require("nodejs-nicepay");
let secondVersion = new nicepayClient.SecondApiVersion({
isProduction: false,
isCloudServer: false,
merchantKey: "YOUR_MERCHANT_KEY",
});
const parameter = {
timeStamp: "20221214111261",
iMid: "PACTEST001",
payMethod: "01",
currency: "IDR",
amt: "5000",
merchantToken: "b40cb019e938d0118b77cb6f564a7facf12472e5bbb598dde0cd43b2df46b2aa",
referenceNo: "ordNo20221214111261",
goodsNm: "Goods For Testing Pre-Auth",
billingNm: "John Doe",
billingPhone: "081288998899",
billingEmail: "[email protected]",
billingAddr: "Jln. Raya Kasablanka Kav.88",
billingCity: "South Jakarta",
billingState: "DKI Jakarta",
billingCountry: "Indonesia",
billingPostCd: "12800",
dbProcessUrl: "http://ptsv2.com/t/merchant/post",
cartData: "{\"count\":\"1\",\"item\":[{\"goods_id\":\"NICEPRDID1\",\"img_url\":\"http://www.merchant.com/image_goods1.jpg\",\"goods_name\":\"Goods For Testing Pre-Auth\",\"goods_detail\":\"Goods For Testing Pre-Auth Details\",\"goods_amt\":\"5000\",\"goods_quantity\":\"1\"}]}",
userIP: "127.0.0.1",
instmntType: "1",
instmntMon: "1",
recurrOpt: "",
userLanguage: "en",
userAgent:
"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0",
};
let endPoint = "/direct/v2/registration";
secondVersion.requestAPI(parameter, endPoint);
Response Parameter
{
"resultCd": "0000",
"resultMsg": "SUCCESS",
"tXid": "PACTEST00101202510081159303818",
"referenceNo": "ordNo20221214111261",
"payMethod": "01",
"amt": "5000",
"transDt": "20251008",
"transTm": "115930",
"description": null,
"bankCd": null,
"vacctNo": null,
"mitraCd": null,
"payNo": null,
"currency": null,
"goodsNm": null,
"billingNm": null,
"vacctValidDt": null,
"vacctValidTm": null,
"payValidDt": null,
"payValidTm": null,
"requestURL": null,
"paymentExpDt": null,
"paymentExpTm": null,
"qrContent": null,
"qrUrl": null
}