NICEPAY API
...
API Credit Card
Payment - API Credit Card

Pre-Auth & Capture - Payment API Credit Card

18min

About Pre-Auth & Capture - Payment API Credit Card



After You with registration with Pre-Auth & Capture feature type on Pre-Auth & Capture - Registration API Credit Card, You can to next step on that through this .

Learn about with RecurringToken on Credit Card Feature or visit technical explanation about Pre-Auth Capture in Pre-Auth & Capture - Payment API Credit Card .



Pre-Auth - Payment (Hold Fund) API Credit Card



API Endpoint

/nicepay/direct/v2/payment

Request Method

POST

Description

Pre-Auth (Hold Fund)

Merchant Token

SHA256(timeStamp+iMid+referenceNo+amt+merchantKey)

Request Format

application/json



Request Parameter Pre-Auth (Hold Fund) - Payment API Credit Card



To able Pre-auth feature from Your , You need to fill in tXid from response result on Pre-Auth & Capture - Registration API Credit Card that You have already done.

Parameter

Type

Size

Description

Example / Notes

timeStamp

Required

N

14

Request Timestamp

(YYYYMMDDHH24MISS)

20230522130518

tXid

Required

AN

30

Transaction ID

IONPAYTEST01202305161007570327

referenceNo

Required

ANS

40

 Order Number

This Is The Description Of The

merchantToken

Required

AN

255

 Token

ff139e49606387091cd9baeadff3161aff6afd9406e1f481e0fdb8b46d1ae5ae

cardHolderNm

Required

AN

45

Card Holder Name

John Doe

cardHolderEmail

Required

ANS

100

Card Holder Email

cardCvv

Required

N

4

Card CVV

100

callBackUrl

Required

AN

255

 Result Forward URL

https://www.merchant.com/callbackUrl/

You also need cardNo, cardExpYymm, cardHolderNm, cardHolderEmail & cardCvv s that You can get from Your so billing can be ed.



Response Parameter Pre-Auth (Hold Fund) - Payment API Credit Card



The following is a response from request Pre-Auth (Hold Fund) result.

Parameter

Type

Size

Description

Example / Notes

timeStamp

N

14

Response Date

(YYYYMMDDHH24MISS)

20230516135959

resultCd

N

4

Result Code

0000

resultMsg

AN

255

Result Message: Error Code

SUCCESS

tXid

AN

30

Transaction ID

IONPAYTEST01202305161007570327

referenceNo

ANS

40

 Order Number

MerchantReferenceNumber001

payMethod

N

2

01



When Success

amount

N

12

 Amount

10000



When Success

currency

AN

3

Currency

IDR



When Success

goodsNm

AN

100

Goods Name

 Goods 1



When Success

billingNm

AN

100

Buyer Name

John Doe



When Success

transDt

N

8

Transaction Date

(YYYYMMDD)

20230522

When Success

transTm

N

6

Transaction Time

(HH24MISS)

135959



When Success

description

AN

100

Description

This Is The Description Of The



When Success

authNo

N

10

Approval Number

123456



When Success

issuBankCd

A

4

CENA



When Success

acquBankCd

A

4

BNIA



When Success

cardNo

AN

20

Card Number

(Masked)

443426******0008



When Success

cardExpYymm

N

4

Card Expiry

(YYMM)

3901



When Success

instmntMon

N

2

Installment Month

1



When Success

instmnType

N

2

1



When Success

preauthToken

AN

64

Pre-Auth Token

5c6ba40e61c45d9fa37e763ea1f86b9d6ac5f1f7ed279e4d4531191c83279320

When Success

ccTransType

AN

2

3



When Success

vat

N

12

Value Added Tax

()

0



When Success

fee

N

12

Service Fee

0



When Success

notaxAmt

N

12

Tax Free Amount

0



When Success

acquBankNm

A

255

Acquiring Name

CIMB

issuBankNm

A

255

Issuing Name

BCA

If this is successful, paid fund will automatically hold, and You will get needed preauthToken to go through later capture .

 capture immediately after Pre-Auth is finished before fund expiry and will be considered void ( fund will return to cardholder)

The expiration date on Pre-Auth type usually takes up to 7 days.



Sample JSON Credit Card - Pre-Auth (Hold Fund) - Payment API Credit Card



Sample Request PreAuth Hold
Sample Response PreAuth Hold
Java Request




Capture - Payment API Credit Card



API URL

/nicepay/direct/v2/payment

Request Method

POST

Description

Capture Process from Pre-Auth

Merchant Token

SHA256(timeStamp+iMid+referenceNo+amt+merchantKey)

Request Format

application/json



Request Parameter Capture - Payment API Credit Card



After you get preauthToken on paid from your on API Pre-Auth Payment (Hold) .

The next step is going through capture on earlier held fund. However to with that, You need to register again with new on Pre-Auth & Capture - Registration API Credit Card with capture amount must be less or equal to hold amount from previous Pre-Auth .

If you already success registered again, You can use this Capture.

The capture can be executed multiple times as long as total amount that already went through pre-auth still available for capture include pre-auth still not yet expired or hasn't considered void.

The following is a list of to integrate for using PreauthToken without cardNo, cardExpYymm , or cardCvv.

Parameter

Type

Size

Description

Example / Notes

timeStamp

Required

N

14

Request Timestamp (YYYYMMDDHH24MISS)

20230516135959

tXid

Required

AN

30

Transaction ID

IONPAYTEST01202305161007570327

referenceNo

Required

ANS

40

 Order Number

MerchantReferenceNumber001

merchantToken

Required

AN

255

 Token

ff139e49606387091cd9baeadff3161aff6afd9406e1f481e0fdb8b46d1ae5ae

cardHolderNm

Required

AN

45

Card Holder Name

John Doe

cardCvv



N

6

Card CVV

100

callBackUrl

Required

ANS

255

 Result URL

https://www.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp

preauthToken

Required For Capture Process in Pre-Auth

AN

64

Pre-Auth Token

5976c263fe6116503645057bb00be809c3a6f9c1e355efa12ef2cda2be03d5eb

tXid will never be similar with request (pre-auth - hold). The Capture will ensure that capture amount value won't exceed funds You already pre-auth.



Response Parameter Capture - Payment API Credit Card



Parameter

Type

Size

Description

Example / Notes

timeStamp

N

14

Response Date

(YYYYMMDDHH24MISS)

20230516135959

resultCd

N

4

Result Code

0000

resultMsg

AN

255

Result Message: Error Code

SUCCESS

tXid

AN

30

Transaction ID

IONPAYTEST01202305161007570327

referenceNo

ANS

40

 Order Number

MerchantReferenceNumber001

payMethod

N

2

01



When Success

amount

N

12

 Amount

10000



When Success

currency

AN

3

Currency

IDR



When Success

goodsNm

AN

100

Goods Name

 Goods 1



When Success

billingNm

AN

100

Buyer Name

John Doe



When Success

transDt

N

8

Transaction Date

(YYYYMMDD)

20230522

When Success

transTm

N

6

Transaction Time

(HH24MISS)

224343



When Success

description

AN

100

Description

This Is The Description Of The



When Success

authNo

N

10

Approval Number

123456



When Success

issuBankCd

A

4

CENA



When Success

acquBankCd

A

4

BNIA



When Success

cardNo

AN

20

Card Number

(Masked)

51234500****0008



When Success

cardExpYymm

N

4

Card Expiry

(YYMM)

3901



When Success

instmntMon

N

2

Installment Month

1



When Success

instmnType

N

2

1



When Success

ccTransType

AN

2

3



When Success

vat

N

12

Value Added Tax

()

0



When Success

fee

N

12

Service Fee

0



When Success

notaxAmt

N

12

Tax Free Amount

0



When Success

acquBankNm

A

255

Acquiring Name

CIMB

issuBankNm

A

255

Issuing Name

BCA

tXid will never similar with request hold. Capture will ensure that capture amount value won't exceed owned funds.



Sample JSON Credit Card Capture - Payment API Credit Card



Sample Request Pre-Auth Capture
Sample Response Pre-Auth Capture
Java Request




CallBack Handling for Credit Card Payment Pre-Auth



When your callback already received callbackUrl, we recommended do verification using Status Inquiry - API Credit Card.

CallBack Handling is very important to minimize Fraud act, we highly recommend to do verification using callBack Handling .

URL CallBack
Response CallBack