> For the complete documentation index, see [llms.txt](https://docs.moneycollect.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.moneycollect.com/docs/payment/tokenization.md).

# Tokenization

## I. Tokenization Configuration

Contact your account manager to apply for activation of Tokenization products, and confirm whether the subsequent payment for MIT-type transactions can be activated for you.

Our Tokenization solution enables merchants to securely reuse previously authorized payment credentials for future transactions without handling sensitive card data directly.

During the tokenization process, a payment method is associated with a unique customerId and paymentMethod ID. These identifiers can be used to reference the underlying payment credentials in subsequent transactions.

Unlike traditional tokenization solutions, our platform does not return a standalone payment token. Instead, merchants should store the returned customerId and paymentMethod ID and use them for future payment requests.

The underlying payment credentials are securely managed by the relevant financial institutions, payment networks, or token service providers. Our platform maintains the relationship between the customer, payment method, and the corresponding payment credentials, allowing merchants to initiate future transactions without storing or transmitting sensitive card data.

This approach simplifies integration, reduces merchants' exposure to sensitive payment information, and supports a variety of future payment scenarios, including Cardholder-Initiated Transactions (CIT), Merchant-Initiated Transactions (MIT), recurring payments, and other tokenized payment use cases.

{% hint style="info" %}
**Note**: No payment token is returned during tokenization. Merchants must persist the customerId and paymentMethod ID returned by the API and use them for all subsequent payments involving the stored payment credentials.
{% endhint %}

## II. Token creation

{% stepper %}
{% step %}

### Create customer

The merchant server calls the create customer interface: `/customers/create` to obtain the customer ID, for example cus\_1938157433067143170.

Note: This customer ID should be bound to the merchant website user's unique ID.

**Request example:**

```json
{
  "address": {
    "city": "Asheville",
    "country": "US",
    "line1": "3968 Fidler Drive",
    "line2": "",
    "postalCode": "28806",
    "state": "North Carolina"
  },
  "description": "",
  "email": "fun@gmail.com",
  "firstName": "Mark",
  "lastName": "Merrill",
  "phone": "2106276464"
}
```

**Response example :**

```json
{
  "code": "success",
  "msg": "success",
  "data": {
    "id": "cus_1938157433067143170",
    "email": "fun@gmail.com",
    "firstName": "Mark",
    "lastName": "Merrill",
    "phone": "2106276464",
    "description": "",
    "address": {
      "city": "Asheville",
      "country": "US",
      "line1": "3968 Fidler Drive",
      "line2": "",
      "postalCode": "28806",
      "state": "North Carolina"
    },
    "shipping": null,
    "created": "2025-06-26T08:48:35.925Z"
  }
}
```

{% endstep %}

{% step %}

### Create paymentMethod

The merchant server calls the payment method creation interface: `/payment_methods/create` to obtain the payment method ID, for example

pm\_1938159585009336322

**Request example:**

```json
{
  "billingDetails": {
    "address": {
      "city": "Asheville",
      "country": "US",
      "line1": "3968 Fidler Drive",
      "line2": "",
      "postalCode": "28806",
      "state": "North Carolina"
    },
    "email": "fun@gmail.com",
    "firstName": "Mark",
    "lastName": "Merrill",
    "phone": "2106276464",
    "description": ""
  },
  "card": {
    "cardNo": "4242424242424242",
    "expMonth": "04",
    "expYear": "2028",
    "securityCode": "123"
  },
  "type": "card",
  "merchantPaySite": "https://test.com/"
}
```

**Response example：**

```json
{
  "code": "success",
  "msg": "success",
  "data": {
    "id": "pm_1938159585009336322",
    "type": "card",
    "billingDetails": {
      "firstName": "Mark",
      "lastName": "Merrill",
      "phone": "2106276464",
      "email": "fun@gmail.com",
      "address": {
        "city": "Asheville",
        "country": "US",
        "line1": "3968 Fidler Drive",
        "line2": "",
        "postalCode": "28806",
        "state": "North Carolina"
      }
    },
    "created": "2025-06-26T08:57:08.987Z",
    "customerId": null,
    "card": {
      "brand": "Visa",
      "country": "GB",
      "expMonth": "04",
      "expYear": "2028",
      "fingerprint": "KB2kvSZ3i2un0lmfwIc873kvRJJem4AAEvA/fo3HPPo=",
      "last4": "4242",
      "tokenType": null
    },
    "boleto": null,
    "pix": null,
    "creditCardBrazil": null
  }
}
```

{% endstep %}

{% step %}

### Create Payment

The merchant server calls the payment creation interface (support zero amount authorization): `/payment/create`. When calling the current interface, pass in `customerId` and `paymentMethod` at the same time, and set `setupFutureUsage` to `on`. Moneycollect will bind `customerId` and `paymentMethod` for subsequent tokenization transactions.

**Request example：**

```json
{
  "amount":"1000",
  "confirmationMethod": "automatic",
  "currency": "USD",
  "customerId": "cus_1938157433067143170",
  "description": "test tokenization",
  "ip": "192.168.3.1",
  "confirm": "true",
  "lineItems": [
    {
      "amount": 10,
      "currency": "USD",
      "description": "test tokenization",
      "images": ["https://payment.moneycollect.com/static/img/checkout_platforms.e4491f3.png"],
      "name": "test",
      "quantity": 1
    }
  ],
  "notifyUrl": "https://www.moneycollect.com/services/v1/callResult",
  "orderNo": "47598388037375697",
  "paymentMethod":"pm_1938159585009336322",
  "preAuth": "n",
  "receiptEmail": "fun@gmail.com",
  "returnUrl": "https://www.moneycollect.com/services/v1/redirectResultTest?bankCode=TestBankCode",
  "setupFutureUsage": "on",
  "statementDescriptor": "TEST",
  "statementDescriptorSuffix": "",
  "website": "https://test.com/"
}
```

**Response example：**

```json
{
  "code": "success",
  "msg": "success",
  "data": {
    "id": "pt_1938161587181322242",
    "amount": "1000",
    "currency": "USD",
    "confirmationMethod": "automatic",
    "customerId": "cus_1938157433067143170",
    "description": "test tokenization",
    "paymentMethod": "pm_1938159585009336322",
    "paymentMethodTypes": [
      "card"
    ],
    "paymentMethodType": "card",
    "receiptEmail": "fun@gmail.com",
    "setupFutureUsage": "on",
    "orderNo": "47598388037375697",
    "notifyUrl": "https://www.moneycollect.com/services/v1/callResult",
    "returnUrl": "https://moneycollect.com/services/v1/redirectResultTest?bankCode=TestBankCode",
    "website": "https://test.com/",
    "ip": "192.168.3.1",
    "preAuth": "n",
    "statementDescriptor": "TEST",
    "clientSecret": "pt_1938161587181322242_secret_564C4368F6A6523E5E8099C88E549FB7",
    "canceledAt": null,
    "cancellationReason": null,
    "amountReceived": "0",
    "amountCapturable": "0",
    "created": "2025-06-26T09:05:06.346Z",
    "riskInfo": {
      "riskScore": 0,
      "riskMessage": "risk_pass"
    },
    "status": "succeeded",
    "displayStatus": "succeeded",
    "errorCode": null,
    "errorMessage": null,
    "invoiceId": null,
    "fromChannel": null,
    "use3D": false
  }
}
```

{% endstep %}
{% endstepper %}

## III. CIT scenarios

#### Use tokens for payments in future cardholder-initiated transaction&#x20;

The merchant server calls the payment creation endpoint (`/payment/create`) using the previously saved `customerId` and `paymentMethod`. For subsequent cardholder-initiated transactions (CIT), set `setupFutureUsage` to `on` and specify `"subsequentInitialType": "cit"` to process future payments using the stored payment method.

{% hint style="info" %}
**Note**: Subsequent cit transactions may trigger the 3D transaction process.
{% endhint %}

**Request example：**

```json
{
  "amount":"1000",
  "confirmationMethod": "automatic",
  "currency": "USD",
  "customerId": "cus_1938157433067143170",
  "description": "test tokenization",
  "ip": "192.168.3.1",
  "confirm": "true",
  "notifyUrl": "https://www.moneycollect.com/services/v1/callResult",
  "orderNo": "57598388037375697",
  "paymentMethod":"pm_1938159585009336322",
  "preAuth": "n",
  "receiptEmail": "fun@gmail.com",
  "returnUrl": "https://www.moneycollect.com/services/v1/redirectResultTest?bankCode=TestBankCode",
  "setupFutureUsage": "on",
  "subsequentInitialType": "cit",
  "statementDescriptor": "TEST",
  "statementDescriptorSuffix": "",
  "website": "https://test.com/"
}
```

**Response example：**

```json
{
  "code": "success",
  "msg": "success",
  "data": {
    "id": "pt_1938163722635706369",
    "amount": "1000",
    "currency": "USD",
    "confirmationMethod": "automatic",
    "customerId": "cus_1938157433067143170",
    "description": "test tokenization",
    "paymentMethod": "pm_1938159585009336322",
    "paymentMethodTypes": [
      "card"
    ],
    "paymentMethodType": "card",
    "receiptEmail": "fun@gmail.com",
    "setupFutureUsage": "on",
    "subsequentInitialType": "cit",
    "orderNo": "57598388037375697",
    "notifyUrl": "https://www.moneycollect.com/services/v1/callResult",
    "returnUrl": "https://www.moneycollect.com/services/v1/redirectResultTest?bankCode=TestBankCode",
    "website": "https://test.com/",
    "ip": "192.168.3.1",
    "preAuth": "n",
    "statementDescriptor": "TEST",
    "clientSecret": "pt_1938163722635706369_secret_F1F86B847E81E1CE0AF4BDBA6D9F6620",
    "canceledAt": null,
    "cancellationReason": null,
    "amountReceived": "0",
    "amountCapturable": "0",
    "created": "2025-06-26T09:13:35.478Z",
    "riskInfo": {
      "riskScore": 0,
      "riskMessage": "risk_pass"
    },
    "status": "succeeded",
    "displayStatus": "succeeded",
    "errorCode": null,
    "errorMessage": null,
    "invoiceId": null,
    "fromChannel": null,
    "use3D": false
  }
}
```

## IV. MIT scenarios

#### Use tokens for payments in future merchant-initiated transaction&#x20;

The merchant server calls the payment creation endpoint (`/payment/create`) using the previously saved `customerId` and `paymentMethod`. For subsequent merchant-initiated transactions (MIT), set `setupFutureUsage` to `on` and specify `"subsequentInitialType": "mit"` to process future payments using the stored payment method.

**Request example：**

```json
{
  "amount":"1000",
  "confirmationMethod": "automatic",
  "currency": "USD",
  "customerId": "cus_1938157433067143170",
  "description": "test tokenization",
  "ip": "192.168.3.1",
  "confirm": "true",
  "notifyUrl": "https://www.moneycollect.com/services/v1/callResult",
  "orderNo": "57598388037375697",
  "paymentMethod":"pm_1938159585009336322",
  "preAuth": "n",
  "receiptEmail": "fun@gmail.com",
  "returnUrl": "https://www.moneycollect.com/services/v1/redirectResultTest?bankCode=TestBankCode",
  "setupFutureUsage": "on",
  "subsequentInitialType": "mit",
  "statementDescriptor": "TEST",
  "statementDescriptorSuffix": "",
  "website": "https://test.com/"
}
```

**Response example：**

```json
{
  "code": "success",
  "msg": "success",
  "data": {
    "id": "pt_1938163722635706369",
    "amount": "1000",
    "currency": "USD",
    "confirmationMethod": "automatic",
    "customerId": "cus_1938157433067143170",
    "description": "test tokenization",
    "paymentMethod": "pm_1938159585009336322",
    "paymentMethodTypes": [
      "card"
    ],
    "paymentMethodType": "card",
    "receiptEmail": "fun@gmail.com",
    "setupFutureUsage": "on",
    "subsequentInitialType": "mit",
    "orderNo": "57598388037375697",
    "notifyUrl": "https://www.moneycollect.com/services/v1/callResult",
    "returnUrl": "https://www.moneycollect.com/services/v1/redirectResultTest?bankCode=TestBankCode",
    "website": "https://test.com/",
    "ip": "192.168.3.1",
    "preAuth": "n",
    "statementDescriptor": "TEST",
    "clientSecret": "pt_1938163722635706369_secret_F1F86B847E81E1CE0AF4BDBA6D9F6620",
    "canceledAt": null,
    "cancellationReason": null,
    "amountReceived": "0",
    "amountCapturable": "0",
    "created": "2025-06-26T09:13:35.478Z",
    "riskInfo": {
      "riskScore": 0,
      "riskMessage": "risk_pass"
    },
    "status": "succeeded",
    "displayStatus": "succeeded",
    "errorCode": null,
    "errorMessage": null,
    "invoiceId": null,
    "fromChannel": null,
    "use3D": false
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moneycollect.com/docs/payment/tokenization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
