NICEPAY API
...
API Version 1 (V1)
V1 Enterprise

Credit Card - V1 Enterprise

56min

Credit Card



Transaction flow :

  1. Request onePassToken.
  2. Redirect to 3Ds / MIGS .
  3.  input OTP on 3Ds .
  4.  register .
  5.  send .



Credit Card Flow V1 Enterprise
Credit Card Flow V1 Enterprise


 Flow:

  1. The does .
  2. The requests from .
  3. The registers data.
  4. The sends response, card data based, to .
  5. The inputs card data.
  6. The sends data card data to .
  7. The sends request by using Regist to .
  8.  saves detail.
  9.  sends response to .
  10. The requests using to .
  11.  requests 3Ds to .
  12.  verifies request.
  13.  sends 3Ds URL response to .
  14.  sends authentication to .
  15. The sends OTP to .
  16. The input OTP and send data to .
  17.  validates OTP.
  18.  sends 3Ds result to .
  19.  calculates FDS.
  20.  requests to .
  21.  es .
  22.  sends response to .
  23.  sends using callBackUrl and dbProcessUrl to .
  24. The receives .
  25. The requests checking to .
  26.  sends checking response to .
  27. The receives final .
  28. The sends result to .



Request Token



 need to request onePassToken for each Credit Card using V1 Enterprise.

API Specifications - Request Token

API Endpoint

/nicepay/api/onePassToken.do

Request Method application/x-www-form-urlencoded

POST

Description

Request onePassToken for Transaction.

Merchant Token

SHA256 (iMid+ referenceNo+ amt+ merchantKey)

Payment Methods

01 



Request Parameter - Request Token

The Parameters below must be sent inside ‘jsonData’ and formatted as JSON.

Token Request


Parameter

Type

Size

Description

Example Value

iMid

Required

AN

10

 ID

IONPAYTEST

merchantToken

Required

AN

255

 Token

f5d1a08fd497bf3f39e9a0027c0a6822109903cd95140c36db537b5977fb9652

cardNo Required

N

16

Card Number

5123450000000008

cardExpYYmm Required

N

4

Card Expiry (YYMM)

3901

cardHolderNm Required 

AN

45

Card Holder Name

John Doe

cardHolderEmail Required

ANS

100

Card Holder Email

amt Required

N

12

 Amount

10000

referenceNo Required

ANS

40

 Order Number

MerchantReferenceNumber001

instmntType

N

2

1

instmntMon

N

2

Installment Month

1



Response Parameter - Request Token

Sample JSON Response


Parameter

Type

Size

Description

resultCd

N

4

Result Code

resultMsg

AN

255

cardToken

AN

64

One Time Use Transaction Token

paymentType

N

1

CC Authorization Type

Kindly check paymentType from onePassToken.do response. This will be needed for next step to determine whether to use 3DS or MIGS.

paymentType

Description

1

3D Secure

2

KeyIn (Proceed to Registration without 3Ds/MIGS)

3

MiGS



3Ds Request



Proceed with this when you get paymentType = 1 from onePassToken.do response.

3Ds Steps:

  1. Send Request Parameters to 3Ds Request .
  2.  will be redirect to 3Ds .
  3.  input OTP.
  4.  will send Response Parameter to callbackUrl.



API Specification - 3Ds

API Endpoint

/nicepay/api/secureVeRequest.do

Method

application/x-www-form-urlencoded

Pop Up or Redirect

Description

Request 3D for paymentType = 1

Merchant Token

SHA256 (iMid+ referenceNo+ amt+ merchantKey)



Request Parameter - 3Ds

JSON


Parameter

Type

Size

Description

Example

country

Required

N

3

Country

360

callbackUrl

Required

ANS

200

Callback URL

http://merchant.com/callback

onePassToken Required

AN

64

One time use token

c5bd0b91bcc3d21358cd004c60e54 579441c23aa8e7553b41ce3402db1113fff



Response Parameter - 3Ds

JSON


Parameter

Type

Size

Description

resultCd

N

4

Result Code

resultMsg

AN

255

referenceNo

ANS

40

 Order Number

merchantToken

AN

255

 Token



MiGS Request



MiGS (MasterCard Internet Gateway Service) is a from Mastercard to refund and monitor report based on between and .

Currently, using MPGS (Mastercard Gateway Service) that latest version of MiGS to increase security with 3Ds 2.0 feature. Although, MiGS API still used on MPGS .

Use this if get paymentType = 3 from onePassToken.do response .

Steps:

  1. Send Request Parameters to MIGS Request .
  2.  will be redirect to MIGS .
  3.  input OTP.
  4.  will send Response Parameter to callbackUrl.



API Specifications - MiGS

API url

/nicepay/api/migsRequest.do

Request Method application/x-www-form-urlencoded

POST or Redirect

Description

Request MIGS for paymentType = 3

Merchant Token

SHA256 (iMid+ referenceNo+ amt+ merchantKey)

Payment Methods

01 



Request Parameter - MiGS

Sample URL Parameter MIGS Request


Parameter

Type

Size

Description

Example

instmntType

Required

N

2

1

instmntMon

N

2

Installment Month

1

referenceNo Required

ANS

40

 Order Number

MerchantReferenceNumber001

cardCvv

N

3

Card CVV

100

callbackUrl Required 

ANS

200

Callback URL for result

http://merchant.com/callbackUrl

onePassToken Required 

AN

64

One Time Use Transaction Token

d12b153b3dd50b1875e64ac17288a7cd33fd5511cf01924cac2ca7f345de8f08



Response Parameter - MiGS

Sample URL Parameter MIGS Response


Parameter

Type

Size

Description

resultCd

N

4

Result Code

resultMsg

AN

255



Credit Card Payment



API Specifications - Credit Card Payment

API Endpoint

/nicepay/api/onePass.do

Request Method application/x-www-form-urlencoded

POST

Description

Register Transaction and Charge using onePassToken

Merchant Token

SHA256 (iMid+ referenceNo+ amt+ merchantKey)

Payment Methods

01 



Request Parameter - Credit Card Registration

Sample API Payment
Sample Java Request Credi Card


Parameter

Type

Size

Description

Example / Notes

iMid

Required

AN

2

 ID

IONPAYTEST

payMethod Required

N

2

01

currency Required 

A

40

Currency

IDR

amt Required 

N

12

Goods Amount

10000

referenceNo Required

ANS

40

 Order Number

MerchantReferenceNumber001

goodsNm Required 

AN

100

Goods Name

 Goods 1

billingNm Required 

A

30

Billing Name

John Doe

billingPhone Required 

N

15

Billing Phone Number

08123456789

billingEmail Required

ANS

40

Billing E-Mail

billingCity Required

N

50

Billing City

South Jakarta

billingState Required 

A

50

Billing State

DKI Jakarta

billingPostCd Required

N

10

Billing Post Number

10200

billingCountry Required

A

10

Billing Country



callBackUrl Required 

ANS

255

 Result Forward URL (On Browser)

https://www.mechant.com/callbackUrl

dbProcessUrl Required

ANS

255

 Result Receive URL (Server Side)

https://www.merchant.com/dbProcessUrl

description Required

AN

100

Description

This Is The Description Of The

merchantToken Required 

AN

255

 Token

2349fcbd3a5b81d08ca719cc6d9c826f2f6f9d4de337b86e4019114aad6222b1

userIP Required

ANS

15

User IP

127.0.0.1

cartData Required 

ANS

4000

Cart Data (JSON Format)

{}

instmntType Required 

N

2

1

instmntMon Required 

N

2

Installment Month

1

cardCvv

N

3

Card CVV

100

onePassToken Required 

AN



One Time Use Transaction Token

9338d54573688ae18e175240b0257de48d89c6ef1c9c7b5c094dc4beed9e435f

recurrOpt Required For Recurring CC 

N

2

0 : Automatic Cancel 1 : Do not cancel 2 : Do not make token

1

billingAddr

AN

255

Billing Address

Jln. Raya Kasablanka Kav.88

deliveryNm

A

30

Delivery Name

's Name

deliveryPhone

N

15

Delivery Phone

08123456789

deliveryAddr

AN

100

Delivery Address

Jln. Dr. Saharjo No.88

deliveryEmail

AN

100

Delivery E-Mail

deliveryCity

A

50

Delivery City

South Jakarta

deliveryState

A

50

Delivery State

DKI Jakarta

deliveryPostCd

N

10

Delivery Post Number

10201

deliveryCountry

A

A

Delivery Country



vat

N

12



0

fee

N

12

Service Tax

0

notaxAmt

N

12

Tax Free Amount

0

reqDt

N

N

Request Date (YYYYMMDD)

20230516

reqTm

N

N

Request Time (HH24MISS)

135959

reqDomain

ANS

100

Request Domain

www.merchant.com

reqServerIP

ANS

15

Request Server IP

127.0.0.1

reqClientVer

ANS

50

Request Client Version

1.0

userSessionID

AN

100

User Session ID

userSessionID

userAgent

ANS

100

User Agent Information

Mozilla

userLanguage

ANS

2

User Language

en-US



Response Parameter - Credit Card Payment

Sample Respone Payment


Parameter

Type

Size

Description

resultCd

N

4

Result Code

resultMsg

AN

255

tXid

AN

30

Transaction ID

referenceNo

ANS

40

 Order Number

payMethod

N

2

amount

N

12

Transaction Amount

currency

AN

3

Currency

goodsNm

N

100

Goods Name

billingNm

N

30

Buyer Name

transDt

N

8

Transaction Date (YYYYMMDD)

transTm

N

6

Transaction Time (HH24MISS)

description

AN

100

Transaction Description

callbackUrl

ANS

100

Callback URL

authNo

N

10

Authorization Number

issuBankCd

A

4

issuBankNm

A

255

Issuing Name

acquBankCd

A

4

acquBankNm

A

255

Acquiring Name

cardNo

ANS

20

Card Number (Masked)

instmntMon

N

2

Installment Month

instmntType

N

2

Installment Type

recurringToken

AN

64

Token for Recurring

preauthToken

AN

64

Token for Preauth

ccTransType

N

2

vat

N

12

 Number

fee

N

12

Service Fee

notaxAmt

N

12

Tax Free Amount



Credit Card Recurring



When signs contract as Recurring, give a RecurringToken to Response. The can use RecurringToken for next Request without input card detail, except cardCVV (Mandatory).



Recurring Issue

To do Recurring , need recurringToken own from to use continuously without reinputting card data multiple times. recurringToken receives after s initial . Following are steps to get recurringToken .

  1. The will input data card such as cardNo and ExyMmYy through Request Token (onePassToken.do).
  2. The will get cardToken.
  3. Recurring on V1 Enterprise divide into 2 , Direct 3Ds and Direct Non-3Ds.
    • If going through 3Ds , then card data will going through security verification from 3Ds Request (secureVeRequest.do) with an OTP also FDS (Fraud Detection System) security.
    • If not going through 3Ds , then will not going through security verification.
  4. The does with (onePass.do) and get recurringToken to recurring .

API Specification - Recurring Issue

API Endpoint

/nicepay/api/recurringToken.do

Request Method application/x-www-form-urlencoded

POST

Description

recurringToken.do almost similar to onePassToken.do difference whether use card info or recurring token

Merchant Token

SHA256 (Merchant ID + Reference Number + Amount + Merchant Key)



Request Parameter - Recurring Issue

The below must send on 'jsonData' and with JSON format.

Sample Request Recurring Issue


Parameter

Type

Size

Description

Example / Notes

amt Required 

N

12

Amount

10000

referenceNo Required 

AN

40

 Order Number

MerchantReferenceNumber001

merchantToken Required 

AN

255

 Token

baf19eaed10d8539498cbe06ed19c50a60a587416d9c980abbb3c06b4eee51f5

iMid Required 

AN

10

 ID

IONPAYTEST

recurringToken Required 

AN

100

Recurring Token

88cb7e30c531429a95fb2af442f591b75939fd0387288af2dc2340c50776d84a

instmntType Required 

AN

2

1

instmntMon Required 

N

2

Installment Month

1

cardHolderNm Required 

AN

45

Card Holder Name

John Doe

cardHolderEmail Required 

ANS

100

Card Holder Email



Response Parameter - Recurring Issue

Sample Response Parameter


Parameter

Type

Size

Description

Remark

resultCd

N

4

Result Code

0000

resultMsg

AN

255

SUCCESS

cardToken

AN

64

Recurring Token

c954f03ef83a363f94fa26bef6ec4d08fa7693590a735386fcce6e2ef1caae8a

paymentType

AN

1

1 : 3Ds

2 : KeyIn





Recurring Payment

After get recurringToken from initial success or result from card registration , will use that recurringToken to execute next schedule. Following is steps on using recurringToken.

  1.  recurringToken gain from initial (recurringToken.do) or result from card registration (tokenize.do).
  2. Next, cardToken will gain and save on database to use on next .
  3. Special for 3Ds , card data will go through security verification from 3Ds Request (secureVeRequest.do) with an OTP also FDS (Fraud Detection System) security using cardToken gain from previous step.
  4. The will using Recurring (recurringTrans.do).

This will continuously on recurring period.

On next recurring , recurringToken will originate from recurringToken.do . onePass.do only use during first recurring .

API Specifications - Recurring Payment

API Endpoint

/nicepay/api/recurringTrans.do

Method

application/x-www-form-urlencoded

POST

Merchant Token

SHA256(Merchant ID + Reference Number + Amount + MerchantKey)

Description

The for Recurring or with Recurring Token



Request Parameter- Recurring Payment

Sample Request Recurring Payment
Sample Java Request Recurring Paymen


Parameter

Type

Size

Description

Example / Notes

iMid

Required

AN

2

 ID

IONPAYTEST

payMethod Required

N

2

01

currency Required 

A

40

Currency

IDR

amt Required 

N

12

Goods Amount

10000

referenceNo Required

ANS

40

 Order Number

MerchantReferenceNumber001

goodsNm Required 

AN

100

Goods Name

 Goods 1

billingNm Required 

A

30

Billing Name

John Doe

billingPhone Required 

N

15

Billing Phone Number

08123456789

billingEmail Required

ANS

40

Billing E-Mail

billingCity Required

N

50

Billing City

South Jakarta

billingState Required 

A

50

Billing State

DKI Jakarta

billingPostCd Required

N

10

Billing Post Number

10200

billingCountry Required

A

10

Billing Country



callBackUrl Required 

ANS

255

 Result Forward URL (On Browser)

https://www.mechant.com/callbackUrl

dbProcessUrl Required

ANS

255

 Result Receive URL (Server Side)

https://www.merchant.com/dbProcessUrl

description Required

AN

100

Description

This Is The Description Of The 

merchantToken Required 

AN

255

 Token

2349fcbd3a5b81d08ca719cc6d9c826f2f6f9d4de337b86e4019114aad6222b1

userIP Required

ANS

15

User IP

127.0.0.1

cartData Required 

ANS

4000

Cart Data (JSON Format)

{}

instmntType Required 

N

2

1

instmntMon Required 

N

2

Installment Month

1

cardCvv

N

3

Card CVV

100

recurringToken

Required 

AN

64

Recurring Token

88cb7e30c531429a95fb2af442f591b75939fd0387288af2dc2340c50776d84a

recurrOpt Required For Recurring CC 

N

2

0 Automatic Cancel 1 Do Not Cancel 2 Do Not Make Token

1

billingAddr

AN

255

Billing Address

Jln. Raya Kasablanka Kav.88

deliveryNm

A

30

Delivery Name

's Name

deliveryPhone

N

15

Delivery Phone

08123456789

deliveryAddr

AN

100

Delivery Address

Jln. Dr. Saharjo No.88

deliveryEmail

ANS

100

Delivery E-Mail

deliveryCity

A

50

Delivery City

South Jakarta

deliveryState

A

50

Delivery State

DKI Jakarta

deliveryPostCd

N

10

Delivery Post Number

10201

deliveryCountry

A

A

Delivery Country



vat

N

12



0

fee

N

12

Service Tax

0

notaxAmt

N

12

Tax Free Amount

0

reqDt

N

N

Request Date (YYYYMMDD)

20230516

reqTm

N

N

Request Time (HH24MISS)

135959

reqDomain

ANS

100

Request Domain

www.merchant.com

reqServerIP

ANS

15

Request Server IP

127.0.0.1

reqClientVer

ANS

50

Request Client Version

1.0

userSessionID

AN

100

User Session ID

userSessionID

userAgent

ANS

100

User Agent Information

Mozilla

userLanguage

ANS

2

User Language

en-US



Response Parameter - Recurring Payment

Sample Response Recurring Payment


Parameter

Type

Size

Description

resultCd

N

4

Result Code

resultMsg

AN

255

tXid

AN

30

Transaction ID

referenceNo

ANS

40

 Order Number

payMethod

N

2

amount

N

12

Transaction Amount

currency

AN

3

Currency

goodsNm

N

100

Goods Name

billingNm

N

30

Buyer Name

transDt

N

8

Transaction Date (YYYYMMDD)

transTm

N

6

Transaction Time (HH24MISS)

description

AN

100

Transaction Description

callbackUrl

ANS

100

Callback URL

authNo

N

10

Authorization Number

issuBankCd

A

4

issuBankNm

A

255

Issuing Name

acquBankCd

A

4