---
title: Recurring - Payment API Credit Card
slug: en/nicepay-api-non-snap-recurring-payment-api-credit-card
description: Information about Non-SNAP Payment API - Payment - Recurring - Credit Card API available on NICEPAY system
image: https://archbee-image-uploads.s3.amazonaws.com/ZHvSjR5ZrsoxwKbJa3xmo/y-yoN-UpeGk3VU33Y3y4O_microsoftteams-image.png
icon: {"faIcon":"fa-solid fa-book"}
docTags: 
createdAt: 2022-12-01T07:59:26.000Z
---

# About Recurring - Payment API Credit Card

***

Payment Recurring type is another Credit Card feature that can pay a particular bill from your Customer periodically with the same amount similar to the initial bill payment.

The API used in this payment stage is similar to the API for Full Payment & Installment and Pre-Auth & Capture payment types. However, there are differences in the sent parameter request.

NICEPAY will give a `recurringToken` as Payment API response parameter called  `recurring token making`. Merchant can use `recurringToken` on the later Payment API request without using `cardNo` and `cardExpYymm`.&#x20;



# Recurring - Payment API Credit Card (First Payment)

***

To activate the Credit Card recurring type transaction, you mandatory pay the created transaction to receive the `recurringToken` beforehand.



| **API Endpoint**                                                                       | `/nicepay/direct/v2/payment`                                 |
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| **Request Method**<br /><font color="#2166ae">application/x-www-form-urlencoded</font> | <font color="#3b9f0f">**POST**</font>****                    |
| **Description**                                                                        | Recurring                                                    |
| **Merchant Token**                                                                     | SHA256(`timeStamp`+`iMid`+`referenceNo`+`amt`+`merchantKey`) |

:::hint{type="info"}
The used API specification is similar to the [API Recurring Token Credit Card](docId:8FYUuAQYI5c4SsThlkYy9).
:::



## Request Parameter for Recurring - Payment API Credit Card (First Payment)

***

The following is a request payment on recurring to gain `recurringToken` which where You need to finish the [Recurring - Registration API Credit Card](docId:8FYUuAQYI5c4SsThlkYy9) beforehand.

You still need `cardNo`, `cardExpYymm`, `cardCvv`, `cardHolderNm` & `cardHolderEmail` from the Customer on the first payment on this recurring scheme.&#x20;

| **Parameter**                                                | **Type** | **Size** | **Description**                        | **Example / Notes**                                              |
| ------------------------------------------------------------ | -------- | -------- | -------------------------------------- | ---------------------------------------------------------------- |
| `timeStamp`<br /><font color="#2166ae">Required</font>       | N        | 14       | Request Timestamp (`YYYYMMDDHH24MISS`) | 20230522080502                                                   |
| `tXid`<br /><font color="#2166ae">Required</font>            | AN       | 30       | &#xD;Transaction ID	                   | IONPAYTEST01202305220041509298                                   |
| `referenceNo`<br /><font color="#2166ae">Required</font>     | ANS      | 40       | Merchant Order Number	                 | MerchantReferenceNumber001                                       |
| `merchantToken`<br /><font color="#2166ae">Required</font>   | AN       | 255      | Merchant Token                         | ff139e49606387091cd9baeadff3161aff6afd9406e1f481e0fdb8b46d1ae5ae |
| `cardNo`<br /><font color="#2166ae">Required</font>          | N        | 20       | Credit Card Number                     | 51234500\*\*\*\*0000                                             |
| `cardExpYymm`<br /><font color="#2166ae">Required</font>     | A        | 4        | Card Expiry (`YYMM`)	                  | 3901                                                             |
| `cardCvv`<br /><font color="#2166ae">Required</font>         | N        | 4        | Card CVV                               | 100                                                              |
| `cardHolderNm`<br /><font color="#2166ae">Required</font>    | AN       | 45       | Card Holder Name                       | John Doe<br /><br />**Only alphabet allowed**                    |
| `cardHolderEmail`<br /><font color="#2166ae">Required</font> | ANS      | 100      | Card Holder Email                      | johndoe\@gmail.com                                               |
| `callBackUrl`<br /><font color="#2166ae">Required</font>     | ANS      | 255      | Payment Result URL                     | https\://www\.nicepay.co.id/IONPAY\_CLIENT/paymentResult.jsp     |



## Response Parameter for Recurring - Payment API Credit Card (First Payment)

***

Below is the detailed response You get. Please perform save & store the `recurringToken` gain to execute the recurring feature process on the next transaction with the same Customer Credit Card.&#x20;



| **Parameter**    | **Type** | **Size** | **Description**                                                                                                                   | **Example / Notes**                                              |
| ---------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `timeStamp`      | N        | 14       | Response Date<br />(`YYYYMMDDHH24MISS`)                                                                                           | 20230520135959                                                   |
| `resultCd`       | N        | 4        | [Result Code](docId:9eC3yH9CQqpb6cRWauWWO)                                                                                        | 0000                                                             |
| `resultMsg`      | AN       | 255      | [Result Message](docId\:FsX1GESJKxOp0T9rvUHp_)                                                                                    | SUCCESS                                                          |
| `tXid`           | AN       | 30       | Transaction ID                                                                                                                    | IONPAYTEST01202305161007570327                                   |
| `referenceNo`    | ANS      | 40       | Merchant Order Number                                                                                                             | MerchantReferenceNumber001                                       |
| `payMethod`      | N        | 2        | [Payment Method Code](docId\:NQ1y7vMa25ZtvQHN5He6W)                                                                               | 01<br /><br />When Success                                       |
| `amount`         | N        | 12       | Payment Amount                                                                                                                    | 10000<br /><br />When Success                                    |
| `currency`       | AN       | 3        | Currency                                                                                                                          | IDR<br /><br />When Success                                      |
| `goodsNm`        | AN       | 100      | Goods Name                                                                                                                        | Merchant Goods 1<br /><br />When Success                         |
| `billingNm`      | AN       | 100      | Buyer Name                                                                                                                        | John Doe<br /><br />When Success                                 |
| `transDt`        | N        | 8        | Transaction Date<br />(`YYYYMMDD`)                                                                                                | 20230516<br /><br />When Success                                 |
| `transTm`        | N        | 6        | Transaction Time<br />(`HH24MISS`)                                                                                                | 135959<br /><br />When Success                                   |
| `description`    | AN       | 100      | Transaction Description                                                                                                           | This Is The Description Of The Payment <br /><br />When Success  |
| `authNo`         | N        | 10       | Approval Number                                                                                                                   | 123456<br /><br />When Success                                   |
| `issuBankCd`     | A        | 4        | [Issuing Bank Code](docId\:HlxvgrXVxWD90n8ohNKm0)                                                                                 | CENA (Refer Bank Code)<br /><br />When Success                   |
| `acquBankCd`     | A        | 4        | [Acquiring Bank Code](docId\:HlxvgrXVxWD90n8ohNKm0)                                                                               | BNIA (Refer Bank Code)<br /><br />When Success                   |
| `cardNo`         | AN       | 20       | Card Number (Masked)                                                                                                              | 51234500\*\*\*\*0008<br /><br />When Success                     |
| `cardExpYymm`    | N        | 4        | Card Expiry<br />(`YYMM`)                                                                                                         | 3901<br /><br />When Success                                     |
| `instmntMon`     | N        | 1        | Installment Month                                                                                                                 | 1<br /><br />When Success                                        |
| `instmntType`    | N        | 2        | [Installment Type Code](docId:_Wzur5wjwhrDR8YXI-Ppi)<br />                                                                        | 1<br /><br />When Success                                        |
| `ccTransType`    | AN       | 2        | [Credit Card Transaction Type](docId:7PAs_VD5YLG4VDurMygWo)<br />`1` Normal<br />`2` Recurring<br />`3` Pre-Auth<br />`4` Capture | 2<br /><br />When Success                                        |
| `vat`            | N        | 12       | Value Added Tax (VAT)                                                                                                             | 0<br /><br />When Success                                        |
| `fee`            | N        | 12       | Service Fee                                                                                                                       | 0<br /><br />When Success                                        |
| `notaxAmt`       | N        | 12       | Tax Free Amount                                                                                                                   | 0<br /><br />When Success                                        |
| `recurringToken` | AN       | 64       | Token That Using Recurring Payment                                                                                                | f19e3128784d0b33c189d5df21321c781b5bd107b185587fd8a54781aa845c84 |
| `acquBankNm`     | A        | 255      | Acquiring Bank Name                                                                                                               | CIMB                                                             |
| `issuBankNm`     | A        | 255      | Issuing Bank Name                                                                                                                 | BCA                                                              |



## Sample Parameter for Recurring - Payment API Credit Card (First Payment)

***

### Request Parameter

:::CodeblockTabs
cURL

```curl
curl --location 'https://dev.nicepay.co.id/nicepay/direct/v2/payment' \
--header 'X-FORWARDED-FOR: 1.2.3' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'timeStamp=20250930150955' \
--data-urlencode 'tXid=RECURRTEST01202509301555563979' \
--data-urlencode 'referenceNo=ordNo20250930150915' \
--data-urlencode 'merchantToken=bc2ee7790486a7ee4a5313d4c1d4088a38456b89204e308ae38e0beee3849d0b' \
--data-urlencode 'cardNo=5123450000000008' \
--data-urlencode 'cardExpYymm=3106' \
--data-urlencode 'cardCvv=100' \
--data-urlencode 'cardHolderNm=Nicepay Test' \
--data-urlencode 'callBackUrl=https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp?order_id=RECURRTEST01202509301555563979'
```

Node.js

```nodejs
let secondVersion = new SecondApiVersion(config);

let parameterPayment = {
  amt: "1000",
  referenceNo: "ordNo20250930150915",
  tXid: "RECURRTEST01202509301555563979",
  cardNo: "5123450000000008",
  callBackUrl: "https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp?order_id=RECURRTEST01202509301555563979",
  cardExpYymm: "3106",
  cardCvv: "100",
  recurringToken: "",  // Leave empty for first payment
  cardHolderNm: "Nicepay Test",
  preauthToken: "",
  cardHolderEmail: "test@email.com",
};

let response = secondVersion.requestPayment(parameterPayment);
```

```java
NICEPay config = NICEPay.builder()
        .isProduction(false) // Set to true for production
        .build();

Card requestData = Card.builder()
        .timeStamp("20250922143200")                           // Current timestamp (yyyyMMddHHmmss)
        .tXid("RECURRTEST01202509301555563979")              // Transaction ID from registration
        .iMid("RECURRTEST")                                   // Your NICEPay iMid
        .referenceNo("ordNo20250930150915")                  // Unique order reference
        .amt("1000")                                          // Payment amount
        .merchantToken(timeStamp, iMid, reffNo, amount, MERCHANT_KEY) // Secure token generation
        .cardNo("5123450000000008")                           // Test card number
        .cardExpYymm("3601")                                  // Card expiry date (YYMM)
        .cardCvv("100")                                       // 3-digit CVV
        .cardHolderNm("NICEPAY TEST")                         // Cardholder name
        .callBackUrl("https://www.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp") // Callback URL
        .recurringToken("")                                   // Leave empty for first payment
        .preauthToken("")                                     // Leave empty if not pre-auth
        .build();

String responseHtml = V2CardService.callV2CardPaymentRequest(requestData, config);

```

```python
bodyPayment = (
    builderPayment.BuildPayment()
    .setTimestamp(datetime.now().strftime("%Y%m%d%H%M%S"))  # Current timestamp (yyyyMMddHHmmss)
    .setTxid("TESTMPGS0501202510011026450166")            # Transaction ID from registration
    .setReferenceNo("ordNo20250930150915")                 # Unique order reference
    .setCashtag("")                                         # Leave empty if not using cashtag
    .setCardNo("5123450000000008")                          # Test card number
    .setCardExpYymm("3901")                                 # Card expiry date (YYMM)
    .setCardCvv("100")                                      # 3-digit CVV
    .setRecurringToken("")                                  # Leave empty if not recurring
    .setPreAuthToken("")                                    # Leave empty for hold fund request
    .setAmt("1000")                                         # Payment amount
    .build()
)

environment = (
    builderEnvironment.BuildEnvironment()
    .isCloud(False)   # Set to True if using NICEPay Cloud
    .isProduction(False)  # Set to True for production
    .build()
)

response = ServiceNicepay.servicePayment(
    DataGenerator.getPaymentBody(bodyPayment.dataPayment()),
    environment
)
```

Vanilla JS

```javascript
const paymentData = {
  cardNo: "5123450000000008",              // Test card number
  cardExpYymm: "3601",                     // Card expiry in YYMM format
  cardCvv: "100",                          // 3-digit CVV
  cardHolderEmail: "customer@example.com", // Cardholder email
  cardHolderNm: "Nicepay Test",                // Cardholder name
  callBackUrl: "https://your-domain.com/callback", // Callback URL after payment
  tXid: "RECURRTEST01202509301555563979", // Transaction ID from registration
  merchantToken: "bc2ee7790486a7ee4a5313d4c1d4088a38456b89204e308ae38e0beee3849d0b", // Secure token
  recurringToken: "",                      // Leave empty for first payment
};

const response = await Nicepay.paymentTransaction(paymentData);

```

Laravel

```php
$url = HttpUtil::getNicepayDomain($this->useProd, $this->useCloud) . $this->payment_endpoint;

// Request body parameters
$txid = "RECURRTEST01202509301555563979";
$timestamp = Carbon::now()->format("YmdHis"); // Current timestamp (yyyyMMddHHmmss)
$reference_no = "ordNo20250930150915";
$amt = "1000";

// Generate secure merchant token
$merchant_token = $this->generateMerchantToken(
    $timestamp,
    $this->imid,
    $reference_no,
    $amt,
    $this->mer_key
);

$param = [
    "timeStamp"       => $timestamp, // Current timestamp
    "tXid"            => $txid,      // Transaction ID from registration
    "merchantToken"   => $merchant_token, // Secure hash token
    "cardNo"          => "5123450000000008", // Test card number
    "cardExpYymm"     => "3901",     // Card expiry date (YYMM)
    "cardCvv"         => "100",      // 3-digit CVV
    "callBackUrl"     => "https://www.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp", // Callback URL
    "returnJsonFormat"=> "1",        // Force JSON response format
    "recurringToken" => "",
];

$response = HttpUtil::redirectWithQueryParams($url, $param);

```

PHP Native

```php
$config = NICEPay::builder()
    ->setIsProduction(true) // Set to false for sandbox/testing
    ->build();

$parameter = Card::builder()
    ->timeStamp($timestamp) // Current timestamp (yyyyMMddHHmmss)
    ->iMid("TESTMPGS05") // Your NICEPay iMid
    ->tXid("TESTMPGS0501202510011026450166") // Transaction ID from registration
    ->referenceNo("ordNo20251001101069") // Unique order reference
    ->merchantToken(
        $timestamp,
        $iMid,
        $referenceNO,
        $amt,
        $this->merchantKey
    ) // Generate secure token
    ->cardNo(TestConst::$CARD_NO) // Test card number from constants
    ->cardExpYymm(TestConst::$CARD_EXP_YYMM) // Card expiry date (YYMM)
    ->cardCvv(TestConst::$CARD_CVV) // 3-digit CVV
    ->cardHolderNm("Nicepay test") // Cardholder name
    ->callBackUrl("https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp?") // Callback URL after payment
    ->recurringToken("") 
    ->build();

$cardService = new V2CardService($config);
$response = $cardService->payment($parameter);

```

```kotlin
var config: NICEPay? = NICEPay.Builder()
    .isProduction(true) // Set to false for sandbox/testing
    .build()

val request: DirectV2RequestPaymentCard = DirectV2RequestPaymentCard.Builder()
    .timeStamp("20250922143200") // Current timestamp (yyyyMMddHHmmss)
    .tXid("RECURRTEST01202509301555563979") // Transaction ID from registration
    .iMid("RECURRTEST") // Your NICEPay iMid
    .merchantKey(MERCHANT_KEY) // Secret merchant key
    .referenceNo("ordNo20250930150915") // Unique order reference number
    .amt("1000") // Payment amount
    .callBakUrl("https://www.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp") // Callback URL after payment
    .cardNo("5123450000000008") // Test card number
    .cardCvv("123") // 3-digit CVV (sample)
    .cardExpYymm("3601") // Card expiry date (YYMM)
    .recurringToken("") // Left empty for first payment 
    .build()

val response = paymentService.registration(request, config)!!
```
:::

### Response Parameter

:::CodeblockTabs
Sample Response

```html
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 5.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->

<!DOCTYPE html>
<html>

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <script type="text/javascript" src="/nicepay/js/bootstrap.js"></script>
    <link rel="stylesheet" type="text/css" href="/nicepay/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="/nicepay/css/bootstrap_backup.css" />
    <link rel="stylesheet" type="text/css" href="/nicepay/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/nicepay/css/form.css" />
    <link rel="stylesheet" type="text/css" href="/nicepay/css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="/nicepay/css/basic.css" />

    <link rel="shortcut icon" href="https://www.nicepay.co.id/favicon.ico" type="image/x-icon" />
    <link rel="icon" href="https://www.nicepay.co.id/favicon.ico" type="image/x-icon" />

    <script type="text/javascript" src="/nicepay/js/jquery.js"></script>
    <script type="text/javascript" src="/nicepay/js/jquery.min.js"></script>
    <script type="text/javascript" src="/nicepay/js/common.js"></script>


</head>

<body>











    <html>

    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script type="text/javascript">
            function setAcsInfo(){
		if ('01' != '05') {
			document.tranMgr.action = $("#callbackUrl").val();
		} else if ('01' == '05' && '' != null && '' == 'OVOE') {
			document.tranMgr.action = $("#callbackUrl").val();
		}
		
		if (document.tranMgr.cardBrand.value == null || document.tranMgr.cardBrand.value == "")
			document.tranMgr.cardBrand.setAttribute("disabled", true);
		
		document.tranMgr.submit();
	}

        </script>
    </head>
    <style>
        body {
            min-width: 100%;
            height: auto;
            min-height: 500px;
            overflow: none;
            border: none;
        }

        .wrapper {
            position: absolute;
            top: 0;
            left: 0;
            background-color: transparent;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100%;
            width: 100%;
            z-index: 10;
        }

        .loader {
            color: #79CDBD;
            font-size: 10px;
            width: 1em;
            height: 1em;
            border-radius: 50%;
            position: relative;
            text-indent: -9999em;
            animation: mulShdSpin 1.3s infinite linear;
            transform: translateZ(0);
        }

        @keyframes mulShdSpin {

            0%,
            100% {
                box-shadow: 0 -3em 0 0.2em,
                    2em -2em 0 0em, 3em 0 0 -1em,
                    2em 2em 0 -1em, 0 3em 0 -1em,
                    -2em 2em 0 -1em, -3em 0 0 -1em,
                    -2em -2em 0 0;
            }

            12.5% {
                box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em,
                    3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em,
                    -2em 2em 0 -1em, -3em 0 0 -1em,
                    -2em -2em 0 -1em;
            }

            25% {
                box-shadow: 0 -3em 0 -0.5em,
                    2em -2em 0 0, 3em 0 0 0.2em,
                    2em 2em 0 0, 0 3em 0 -1em,
                    -2em 2em 0 -1em, -3em 0 0 -1em,
                    -2em -2em 0 -1em;
            }

            37.5% {
                box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em,
                    3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em,
                    -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em;
            }

            50% {
                box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em,
                    3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em,
                    -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em;
            }

            62.5% {
                box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em,
                    3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0,
                    -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em;
            }

            75% {
                box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em,
                    3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em,
                    -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0;
            }

            87.5% {
                box-shadow: 0em -3em 0 0, 2em -2em 0 -1em,
                    3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em,
                    -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em;
            }
        }
    </style>

    <body onLoad="javascript:setAcsInfo();">
        <div class="wrapper" id="loader">
            <span class="loader"></span>
        </div>




        <form name="tranMgr" method="post" action="">
            <input type="hidden" id="callbackUrl"  value="https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp?order_id=RECURRTEST01202509301555563979">
            <input type="hidden" name="resultCd"  value="0000">
            <input type="hidden" name="resultMsg" value="SUCCESS">
            <input type="hidden" name="tXid" value="RECURRTEST01202509301555563979">
            <input type="hidden" name="referenceNo" value="ordNo20250930150915">
            <input type="hidden" name="payMethod" value="01">
            <input type="hidden" name="amt" value="1000">
            <input type="hidden" name="transDt" value="20250930">
            <input type="hidden" name="transTm" value="155556">
            <input type="hidden" name="description" value="">
            <input type="hidden" name="authNo" value="563979">
            <input type="hidden" name="issuBankCd" value="BTPN">
            <input type="hidden" name="acquBankCd" value="BMRI">
            <input type="hidden" name="cardNo" value="51234500****0008">
            <input type="hidden" name="receiptCode" value="">
            <input type="hidden" name="mitraCd" value="">
            <input type="hidden" name="recurringToken" value="20b50427bc05cba305b0d580bf403e3c8487db29454459a920b6af358e435035">
            <input type="hidden" name="preauthToken" value="">

            <input type="hidden" name="currency" value="IDR">
            <input type="hidden" name="goodsNm" value="Goods">
            <input type="hidden" name="billingNm" value="Nicepay test RECURRTEST">
            <input type="hidden" name="ccTransType" value="1">
            <input type="hidden" name="mRefNo" value="">

            <input type="hidden" name="instmntType" value="1">
            <input type="hidden" name="instmntMon" value="1">

            <input type="hidden" name="cardExpYymm" value="3106">

            <input type="hidden" name="issuBankNm" value="BTPN">
            <input type="hidden" name="acquBankNm" value="Mandiri">

            <input type="hidden" name="timeStamp" value="20250930155726">
            <input type="hidden" name="merchantToken" value="2a826d3285de0d09d7fa92cb788dfcb35a1656af15b81b97a0b42c5115510983">
            <input type="hidden" name="cardBrand" value="">



        </form>



    </body>

    </html>
</body>

</html>
```
:::



# Continual Recurring - Payment API Credit Card&#x20;

***

After proceeding with the first payment and already receiving `recurringToken` on [Recurring - Payment API Credit Card](docId\:R5cyFQCvgOynxPB3cpL9-).

You can use that `recurringToken` to pay another bill using a similar Customer Credit Card credential to implement recurring (subscription) payment mechanism. However, to proceed this payment continual recurring, You still need to beforehand do the transaction registration on [Recurring - Registration API Credit Card](docId:8FYUuAQYI5c4SsThlkYy9).

The following is the request and response detail used on the later payment using the same recurring token.



| **API Endpoint**                                                                       | `/nicepay/direct/v2/payment`                                 |
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| **Request Method**<br /><font color="#2166ae">application/x-www-form-urlencoded</font> | <font color="#3b9f0f">**POST**</font>****                    |
| **Description**                                                                        | Recurring Continual Payment Credit Card                      |
| **Merchant Token**                                                                     | SHA256(`timeStamp`+`iMid`+`referenceNo`+`amt`+`merchantKey`) |

:::hint{type="info"}
API specification used is similar to the [API Recurring Token Credit Card](docId:8FYUuAQYI5c4SsThlkYy9).
:::



## Request Payment for Continual Recurring - Payment API Credit Card

***

You only need to use `recurringToken` on Payment API Recurring for this next request without using `cardNo` and `cardExpYymm` parameter.&#x20;

| **Parameter**                                                | **Type** | **Size** | **Description**                        | **Example / Notes**                                                                     |
| ------------------------------------------------------------ | -------- | -------- | -------------------------------------- | --------------------------------------------------------------------------------------- |
| `timeStamp`<br /><font color="#2166ae">Required</font>       | N        | 14       | Request Timestamp (`YYYYMMDDHH24MISS`) | 20230522080502                                                                          |
| `tXid`<br /><font color="#2166ae">Required</font>            | AN       | 30       | &#xD;Transaction ID	                   | IONPAYTEST01202305220041509298                                                          |
| `referenceNo`<br /><font color="#2166ae">Required</font>     | ANS      | 40       | Merchant Order Number	                 | MerchantReferenceNumber001                                                              |
| `merchantToken`<br /><font color="#2166ae">Required</font>   | AN       | 255      | Merchant Token                         | ff139e49606387091cd9baeadff3161aff6afd9406e1f481e0fdb8b46d1ae5ae                        |
| `recurringToken`<br /><font color="#2166ae">Required</font>  | AN       | 64       | Token That Using Recurring Payment     | When Success&#xD;<br />f19e3128784d0b33c189d5df21321c781b5bd107b185587fd8a54781aa845c84 |
| `cardCvv`<br /><font color="#2166ae">Required</font>         | N        | 4        | Card CVV                               | 100                                                                                     |
| `cardHolderNm`<br /><font color="#2166ae">Required</font>    | AN       | 45       | Card Holder Name                       | John Doe<br /><br />**Only alphabet allowed**                                           |
| `cardHolderEmail`<br /><font color="#2166ae">Required</font> | ANS      | 100      | Card Holder Email<br />                | johndoe\@gmail.com                                                                      |
| `callBackUrl`<br /><font color="#2166ae">Required</font>     | ANS      | 255      | Payment Result URL                     | https\://www\.nicepay.co.id/IONPAY\_CLIENT/paymentResult.jsp                            |

:::hint{type="warning"}
Include `cardCVV` on every transaction depending on the MID type of *CVV* or *Non-CVV*.
:::



## Response Payment for Continual Recurring - Payment API Credit Card

***

| **Parameter** | **Type** | **Size** | **Description**                                                                                                                   | **Example / Notes**                                             |
| ------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `timeStamp`   | N        | 14       | Response Date<br />(`YYYYMMDDHH24MISS`)                                                                                           | 20230520135959                                                  |
| `resultCd`    | N        | 4        | [Result Code](docId:9eC3yH9CQqpb6cRWauWWO)                                                                                        | 0000                                                            |
| `resultMsg`   | AN       | 255      | [Result Message](docId\:wpcEMaZro_Xvnxz-1ZAiB)                                                                                    | SUCCESS                                                         |
| `tXid`        | AN       | 30       | Transaction ID                                                                                                                    | IONPAYTEST01202305161007570327                                  |
| `referenceNo` | ANS      | 40       | Merchant Order Number                                                                                                             | MerchantReferenceNumber001                                      |
| `payMethod`   | N        | 2        | [Payment Method Code](docId\:NQ1y7vMa25ZtvQHN5He6W)                                                                               | 01<br /><br />When Success                                      |
| `amount`      | N        | 12       | Payment Amount                                                                                                                    | 10000<br /><br />When Success                                   |
| `currency`    | AN       | 3        | Currency                                                                                                                          | IDR<br /><br />When Success                                     |
| `goodsNm`     | AN       | 100      | Goods Name                                                                                                                        | Merchant Goods 1<br /><br />When Success                        |
| `billingNm`   | AN       | 100      | Buyer Name                                                                                                                        | John Doe<br /><br />When Success                                |
| `transDt`     | N        | 8        | Transaction Date<br />(`YYYYMMDD`)                                                                                                | 20230522<br /><br />When Success                                |
| `transTm`     | N        | 6        | Transaction Time<br />(`HH24MISS`)                                                                                                | 224343<br /><br />When Success                                  |
| `description` | AN       | 100      | Transaction Description                                                                                                           | This Is The Description Of The Payment <br /><br />When Success |
| `authNo`      | N        | 10       | Approval Number                                                                                                                   | 123456<br /><br />When Success                                  |
| `issuBankCd`  | A        | 4        | [Issuing Bank Code](docId\:HlxvgrXVxWD90n8ohNKm0)                                                                                 | CENA (Refer Bank Code)<br /><br />When Success                  |
| `acquBankCd`  | A        | 4        | [Acquiring Bank Code](docId\:HlxvgrXVxWD90n8ohNKm0)                                                                               | BNIA (Refer Bank Code)<br /><br />When Success                  |
| `cardNo`      | AN       | 20       | Card Number (Masked)                                                                                                              | 51234500\*\*\*\*0008<br /><br />When Success                    |
| `cardExpYymm` | N        | 4        | Card Expiry<br />(`YYMM`)                                                                                                         | 3901<br /><br />When Success                                    |
| `instmntMon`  | N        | 1        | Installment Month                                                                                                                 | 1<br /><br />When Success                                       |
| `instmntType` | N        | 2        | [Installment Type Code](docId:_Wzur5wjwhrDR8YXI-Ppi)<br />                                                                        | 1<br /><br />When Success                                       |
| `ccTransType` | AN       | 2        | [Credit Card Transaction Type](docId:7PAs_VD5YLG4VDurMygWo)<br />`1` Normal<br />`2` Recurring<br />`3` Pre-Auth<br />`4` Capture | 2<br /><br />When Success                                       |
| `vat`         | N        | 12       | Value Added Tax (VAT)                                                                                                             | 0<br /><br />When Success                                       |
| `fee`         | N        | 12       | Service Fee                                                                                                                       | 0<br /><br />When Success                                       |
| `notaxAmt`    | N        | 12       | Tax Free Amount                                                                                                                   | 0<br /><br />When Success                                       |
| `acquBankNm`  | A        | 255      | Acquiring Bank Name                                                                                                               | CIMB                                                            |
| `issuBankNm`  | A        | 255      | Issuing Bank Name                                                                                                                 | BCA                                                             |



## Sample Parameter for Continual Recurring - Payment API Credit Card

***

### Request Parameter

:::CodeblockTabs
cURL

```curl
curl --location 'https://dev.nicepay.co.id/nicepay/direct/v2/payment' \
--header 'X-FORWARDED-FOR: 1.2.3' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: JSESSIONID=95539D2A218BD0BA1EA20D10878B53E2.pg_was1' \
--data-urlencode 'timeStamp=20250930170957' \
--data-urlencode 'tXid=RECURRTEST01202509301729488790' \
--data-urlencode 'referenceNo=ordNo20250930170928' \
--data-urlencode 'merchantToken=7c60ad0bfb38e1599bbcee61e3bba438bf9f6ffbbaa0d1cfc561c9fdcd24f89d' \
--data-urlencode 'cardHolderNm=Nicepay Test' \
--data-urlencode 'recurringToken=20b50427bc05cba305b0d580bf403e3c8487db29454459a920b6af358e435035' \
--data-urlencode 'callBackUrl=https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp?order_id=RECURRTEST01202509301729488790'
```

Node.js

```nodejs
let secondVersion = new SecondApiVersion(config);

let parameterPayment = {
  amt: "1000",
  referenceNo: "ordNo20250930170928",
  tXid: "RECURRTEST01202509301729488790",
  callBackUrl: "https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp?order_id=RECURRTEST01202509301555563979",
  cardHolderNm: "Nicepay Test",
  recurringToken: "20b50427bc05cba305b0d580bf403e3c8487db29454459a920b6af358e435035",
  cardHolderEmail: "test@email.com",
};

let response = secondVersion.requestPayment(parameterPayment);
```

```java
NICEPay config = NICEPay.builder()
        .isProduction(false) // Set to true for production
        .build();

Card requestData = Card.builder()
        .timeStamp("20250922143200")                           // Current timestamp (yyyyMMddHHmmss)
        .tXid("RECURRTEST01202509301729488790")              // Transaction ID from registration
        .iMid("RECURRTEST")                                   // Your NICEPay iMid
        .referenceNo("ordNo20250930170928")                  // Unique order reference
        .amt("1000")                                          // Payment amount
        .merchantToken(timeStamp, iMid, reffNo, amount, MERCHANT_KEY) // Secure token generation
        .cardHolderNm("NICEPAY TEST")                         // Cardholder name
        .callBackUrl("https://www.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp") // Callback URL
        .recurringToken("20b50427bc05cba305b0d580bf403e3c8487db29454459a920b6af358e435035")                                   // Leave empty for first payment
        .preauthToken("")                                     // Leave empty if not pre-auth
        .build();

String responseHtml = V2CardService.callV2CardPaymentRequest(requestData, config);

```

```python
bodyPayment = (
    builderPayment.BuildPayment()
    .setTimestamp(datetime.now().strftime("%Y%m%d%H%M%S"))  # Current timestamp (yyyyMMddHHmmss)
    .setTxid("RECURRTEST01202509301729488790")            # Transaction ID from registration
    .setReferenceNo("ordNo20250930170928")                 # Unique order reference
    .setCashtag("")                 
    .setRecurringToken("20b50427bc05cba305b0d580bf403e3c8487db29454459a920b6af358e435035")                                  # Leave empty if not recurring
    .setPreAuthToken("")                                    # Leave empty if not pre-auth
    .setAmt("1000")                                         # Payment amount
    .build()
)

environment = (
    builderEnvironment.BuildEnvironment()
    .isCloud(False)   # Set to True if using NICEPay Cloud
    .isProduction(False)  # Set to True for production
    .build()
)

response = ServiceNicepay.servicePayment(
    DataGenerator.getPaymentBody(bodyPayment.dataPayment()),
    environment
)
```

Vanilla JS

```javascript
const paymentData = {
  cardHolderEmail: "customer@example.com", // Cardholder email
  cardHolderNm: "Nicepay Test",                // Cardholder name
  callBackUrl: "https://your-domain.com/callback", // Callback URL after payment
  tXid: "RECURRTEST01202509301729488790", // Transaction ID from registration
  merchantToken: "bc2ee7790486a7ee4a5313d4c1d4088a38456b89204e308ae38e0beee3849d0b", // Secure token
  recurringToken: "20b50427bc05cba305b0d580bf403e3c8487db29454459a920b6af358e435035",                      // Leave empty for first payment
};

const response = await Nicepay.paymentTransaction(paymentData);

```

Laravel

```php
$url = HttpUtil::getNicepayDomain($this->useProd, $this->useCloud) . $this->payment_endpoint;

// Request body parameters
$txid = "RECURRTEST01202509301729488790";
$timestamp = Carbon::now()->format("YmdHis"); // Current timestamp (yyyyMMddHHmmss)
$reference_no = "ordNo20250930170928";
$amt = "1000";

// Generate secure merchant token
$merchant_token = $this->generateMerchantToken(
    $timestamp,
    $this->imid,
    $reference_no,
    $amt,
    $this->mer_key
);

$param = [
    "timeStamp"       => $timestamp, // Current timestamp
    "tXid"            => $txid,      // Transaction ID from registration
    "merchantToken"   => $merchant_token, // Secure hash token
    "callBackUrl"     => "https://www.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp", // Callback URL
    "returnJsonFormat"=> "1",        // Force JSON response format
    "recurringToken" => "20b50427bc05cba305b0d580bf403e3c8487db29454459a920b6af358e435035",
];

$response = HttpUtil::redirectWithQueryParams($url, $param);

```

PHP Native

```php
$config = NICEPay::builder()
    ->setIsProduction(true) // Set to false for sandbox/testing
    ->build();

$parameter = Card::builder()
    ->timeStamp($timestamp) // Current timestamp (yyyyMMddHHmmss)
    ->iMid("IONPAYTEST") // Your NICEPay iMid
    ->tXid("RECURRTEST01202509301729488790") // Transaction ID from registration
    ->referenceNo("ordNo20250930170928") // Unique order reference
    ->merchantToken(
        $timestamp,
        $iMid,
        $newCCTrx->getReferenceNo(),
        $newCCTrx->getAmt(),
        $this->merchantKey
    ) // Generate secure token
    ->cardHolderNm("Nicepay test") // Cardholder name
    ->callBackUrl("https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp?") // Callback URL after payment
    ->recurringToken("20b50427bc05cba305b0d580bf403e3c8487db29454459a920b6af358e435035") 
    ->build();

$cardService = new V2CardService($config);
$response = $cardService->payment($parameter);

```

```kotlin
var config: NICEPay? = NICEPay.Builder()
    .isProduction(true) // Set to false for sandbox/testing
    .build()

val request: DirectV2RequestPaymentCard = DirectV2RequestPaymentCard.Builder()
    .timeStamp("20250922143200") // Current timestamp (yyyyMMddHHmmss)
    .tXid("RECURRTEST01202509301555563979") // Transaction ID from registration
    .iMid("RECURRTEST") // Your NICEPay iMid
    .merchantKey(MERCHANT_KEY) // Secret merchant key
    .referenceNo("ordNo20250930150915") // Unique order reference number
    .amt("1000") // Payment amount
    .callBakUrl("https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp") // Callback URL after payment
    .recurringToken("20b50427bc05cba305b0d580bf403e3c8487db29454459a920b6af358e435035") // Left empty for first payment 
    .build()

val response = paymentService.registration(request, config)!!
```
:::

### Response Parameter

:::CodeblockTabs
Sample Response

```html
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 5.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->

<!DOCTYPE html>
<html>

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <script type="text/javascript" src="/nicepay/js/bootstrap.js"></script>
    <link rel="stylesheet" type="text/css" href="/nicepay/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="/nicepay/css/bootstrap_backup.css" />
    <link rel="stylesheet" type="text/css" href="/nicepay/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/nicepay/css/form.css" />
    <link rel="stylesheet" type="text/css" href="/nicepay/css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="/nicepay/css/basic.css" />

    <link rel="shortcut icon" href="https://www.nicepay.co.id/favicon.ico" type="image/x-icon" />
    <link rel="icon" href="https://www.nicepay.co.id/favicon.ico" type="image/x-icon" />

    <script type="text/javascript" src="/nicepay/js/jquery.js"></script>
    <script type="text/javascript" src="/nicepay/js/jquery.min.js"></script>
    <script type="text/javascript" src="/nicepay/js/common.js"></script>


</head>

<body>











    <html>

    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script type="text/javascript">
            function setAcsInfo(){
		if ('01' != '05') {
			document.tranMgr.action = $("#callbackUrl").val();
		} else if ('01' == '05' && '' != null && '' == 'OVOE') {
			document.tranMgr.action = $("#callbackUrl").val();
		}
		
		if (document.tranMgr.cardBrand.value == null || document.tranMgr.cardBrand.value == "")
			document.tranMgr.cardBrand.setAttribute("disabled", true);
		
		document.tranMgr.submit();
	}

        </script>
    </head>
    <style>
        body {
            min-width: 100%;
            height: auto;
            min-height: 500px;
            overflow: none;
            border: none;
        }

        .wrapper {
            position: absolute;
            top: 0;
            left: 0;
            background-color: transparent;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100%;
            width: 100%;
            z-index: 10;
        }

        .loader {
            color: #79CDBD;
            font-size: 10px;
            width: 1em;
            height: 1em;
            border-radius: 50%;
            position: relative;
            text-indent: -9999em;
            animation: mulShdSpin 1.3s infinite linear;
            transform: translateZ(0);
        }

        @keyframes mulShdSpin {

            0%,
            100% {
                box-shadow: 0 -3em 0 0.2em,
                    2em -2em 0 0em, 3em 0 0 -1em,
                    2em 2em 0 -1em, 0 3em 0 -1em,
                    -2em 2em 0 -1em, -3em 0 0 -1em,
                    -2em -2em 0 0;
            }

            12.5% {
                box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em,
                    3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em,
                    -2em 2em 0 -1em, -3em 0 0 -1em,
                    -2em -2em 0 -1em;
            }

            25% {
                box-shadow: 0 -3em 0 -0.5em,
                    2em -2em 0 0, 3em 0 0 0.2em,
                    2em 2em 0 0, 0 3em 0 -1em,
                    -2em 2em 0 -1em, -3em 0 0 -1em,
                    -2em -2em 0 -1em;
            }

            37.5% {
                box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em,
                    3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em,
                    -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em;
            }

            50% {
                box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em,
                    3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em,
                    -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em;
            }

            62.5% {
                box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em,
                    3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0,
                    -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em;
            }

            75% {
                box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em,
                    3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em,
                    -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0;
            }

            87.5% {
                box-shadow: 0em -3em 0 0, 2em -2em 0 -1em,
                    3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em,
                    -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em;
            }
        }
    </style>

    <body onLoad="javascript:setAcsInfo();">
        <div class="wrapper" id="loader">
            <span class="loader"></span>
        </div>




        <form name="tranMgr" method="post" action="">
            <input type="hidden" id="callbackUrl"  value="https://dev.nicepay.co.id/IONPAY_CLIENT/paymentResult.jsp?order_id=RECURRTEST01202509301729488790">
            <input type="hidden" name="resultCd"  value="0000">
            <input type="hidden" name="resultMsg" value="SUCCESS">
            <input type="hidden" name="tXid" value="RECURRTEST01202509301729488790">
            <input type="hidden" name="referenceNo" value="ordNo20250930170928">
            <input type="hidden" name="payMethod" value="01">
            <input type="hidden" name="amt" value="1000">
            <input type="hidden" name="transDt" value="20250930">
            <input type="hidden" name="transTm" value="172948">
            <input type="hidden" name="description" value="">
            <input type="hidden" name="authNo" value="488790">
            <input type="hidden" name="issuBankCd" value="BTPN">
            <input type="hidden" name="acquBankCd" value="BMRI">
            <input type="hidden" name="cardNo" value="51234500****0008">
            <input type="hidden" name="receiptCode" value="">
            <input type="hidden" name="mitraCd" value="">
            <input type="hidden" name="recurringToken" value="">
            <input type="hidden" name="preauthToken" value="">

            <input type="hidden" name="currency" value="IDR">
            <input type="hidden" name="goodsNm" value="Goods">
            <input type="hidden" name="billingNm" value="Nicepay test RECURRTEST">
            <input type="hidden" name="ccTransType" value="2">
            <input type="hidden" name="mRefNo" value="">

            <input type="hidden" name="instmntType" value="1">
            <input type="hidden" name="instmntMon" value="1">

            <input type="hidden" name="cardExpYymm" value="3106">

            <input type="hidden" name="issuBankNm" value="BTPN">
            <input type="hidden" name="acquBankNm" value="Mandiri">

            <input type="hidden" name="timeStamp" value="20250930173145">
            <input type="hidden" name="merchantToken" value="898c48420ac413ce6cd86bde6a29203b017e8476fc0f2f3f7f92d866adfdfc5a">
            <input type="hidden" name="cardBrand" value="">



        </form>



    </body>

    </html>
</body>

</html>
```
:::



# CallBack Handling for Full Payment & Installment - Payment API Credit Card

***

:::hint{type="info"}
`tXid` will never similar with the request hol&#x64;*.&#x20;*&#x43;apture process will ensure that the capture `amount` value won't exceed the owned funds.&#x20;
:::

:::hint{type="success"}
When Your callback already received `callbackUrl`, we recommended the Merchant to do the status verification using the [Status Inquiry - API Credit Card](docId\:NTP9jTSSg4RtkebeOh_Dr).
:::

:::hint{type="warning"}
`CallBack Handling` is very important to minimize the Fraud act, we highly recommend the Merchant to do the verification using `callBack Handling` .&#x20;
:::

:::CodeblockTabs
URL CallBack

```json
"callbackUrl" : "https://www.merchant.com/callbackUrl/"
```

Response CallBack

```json
{
    "resultCd":"0000",
    "resultMsg":"SUCCESS",
    "tXid":"IONPAYTEST01202212141112221428",
    "referenceNo":"",
    "payMethod":"01",
    "amt":"10000",
    "transDt":"20221212",
    "transTm":"121212",
    "description":"Testing Credit Card Transaction",
    "authNo":"080623",
    "issuBankCd":"OTHR"
    "acquBankCd":"BMRI",
    "cardNo":"453211*****1111",
    "goodsNm":"Test Transaction Nicepay"
    "billingNm":"John Doe",
    "currency":"IDR",
    "timeStamp":"20221212121212",
    "merchantToken":"2035d2295d9578fffb40137186f0203474142ae3e57992d4847826c5fcaffce6",
    "cardExpYymm":"2712",
    "instmntMon":"1",
    "instmntType":"1",
    "ccTransType":"1"
}
```
:::

