1. Card payment
Lesspay2.0
  • LESSPAY2 API Reference
    • Get started
    • Authentication
    • Parameter Specifications
    • Pay In
      • Overview
      • Development Guidelines
      • Local Payment Methods (LPMs)
      • Error Codes
      • Card payment
        • Card Payment
        • 3D Secure (3DS) Configuration
        • Fraud & Dispute Webhook Notifications
      • API List
        • Create Payin
        • Fetch Payin
      • Webhook
        • Payin webhook
    • Pay Out
      • Overview
      • Development Guidelines
      • Multiple Transfer Methods
      • Error Codes
      • API List
        • Create Payout
        • Payout Supported Banks
        • Fetch Payout
      • Webhook
        • Payout webhook
  1. Card payment

Card Payment

Overview#

This guide provides comprehensive instructions for integrating Card Payment functionality into your merchant system. Our platform supports two integration modes to meet different business needs:
Cashier Mode (pay_access_type=1): Redirect users to our hosted cashier page
OpenAPI Mode (pay_access_type=2): Direct API integration with your own payment form

Integration Mode 1: Cashier Mode#

Overview#

In Cashier Mode, merchants redirect customers to our hosted payment page where users can securely enter their card details. This mode minimizes PCI compliance requirements and provides a quick integration path.

Payment Flow Screenshots#

Step 1: Cashier Payment Page#

Users are redirected to the hosted cashier page where they enter their card details:
Checkout cashier.png

Step 2: 3D Secure Authentication#

After clicking "Pay now", users complete 3DS verification:
Checkout Cashier 3DS.png

Step 3: Payment Success#

Upon successful payment, users see the confirmation page:
Checkout Pay Success.png

Sequence Diagram#

Complete API Documentation#

Create Order API: Create Payin
Signature Generation: Authentication

Create Order Endpoint#

POST /api/global/v1/pay/create-order

Request Parameters#

Required Parameters:
ParameterTypeRequiredDescription
target_amountStringYesPayment amount
target_currencyStringYesCurrency code (e.g., CNY, USD)
transaction_typeStringYesMust be PAY_IN
notify_urlStringYesCallback URL for payment notifications
request_idStringYesUnique merchant order ID
fail_urlStringYesRedirect URL on payment failure
success_urlStringYesRedirect URL on payment success
product_nameStringYesProduct/service name
descriptionStringYesOrder description
way_typeStringYesMust be CARD_PAYMENT
api_versionStringYesMust be V2
pay_access_typeIntegerYesMust be 1 for Cashier Mode

Request Example#

Response Example#

{
    "msg": "SUCCESS",
    "code": 0,
    "data": {
        "order_data": {
            "payOrderId": "P2011337513994018818",
            "payOrderDetailIdEncode": "0c11add2dd42e4853755e2ea325c2e100b4aec92f6cc8f83efff27d6c5362f8f",
            "mchOrderNo": "M17662773795657082",
            "payOrderDetailId": "PD2011337514476363778",
            "payOrderDetailState": 1,
            "payData": "https://authentication-devices.sandbox.checkout.com/sessions-interceptor/sid_qxhjzqibm23yxopurfcsx2bhdi",
            "payDataType": "payurl",
            "orderState": 1
        },
        "pay_order_id": "P2011337513994018818"
    }
}

Response Handling#

1.
Check payDataType: If the value is payurl, redirect the user to the URL in payData
2.
Redirect User: The payData URL points to the hosted cashier page
3.
User Interaction: User completes payment and 3DS verification on the cashier page
4.
Result: User is redirected to success_url or fail_url based on payment result
5.
Callback: Wait for payment callback notification for final confirmation

Integration Mode 2: OpenAPI Mode#

Overview#

In OpenAPI Mode, merchants have full control over the payment UI. This mode supports two payment methods:
1.
Direct Card Payment: Collect and submit card details via API
2.
Token Payment: Use saved card tokens for recurring payments

2.1 Direct Card Payment#

Sequence Diagram#

Required Parameters#

In addition to the common parameters (same as Cashier Mode, but with pay_access_type=2), you must include:
ParameterTypeRequiredDescription
target_amountStringYesPayment amount
target_currencyStringYesCurrency code (e.g., CNY, USD)
transaction_typeStringYesMust be PAY_IN
notify_urlStringYesCallback URL for payment notifications
request_idStringYesUnique merchant order ID
fail_urlStringYesRedirect URL on payment failure
success_urlStringYesRedirect URL on payment success
product_nameStringYesProduct/service name
descriptionStringYesOrder description
way_typeStringYesMust be CARD_PAYMENT
api_versionStringYesMust be V2
pay_access_typeIntegerYesMust be 2 for OpenAPI Mode
channel_extraObjectYesCard payment specific data
channel_extra.extra_typeStringYesMust be card for direct card payment
channel_extra.card_dataObjectYesCard information object
channel_extra.card_data.numberStringYesCard number
channel_extra.card_data.expiry_monthIntegerYesExpiry month (1-12)
channel_extra.card_data.expiry_yearIntegerYesExpiry year (e.g., 2027)
channel_extra.card_data.cvvStringYesCard CVV/CVC code
channel_extra.card_data.store_for_future_useBooleanOptionalSet to true to generate a token

Request Example#

Response Example#

With 3DS Required:
{
    "code": 0,
    "data": {
        "order_data": {
            "mchOrderNo": "M20260115121901",
            "orderState": 1,
            "payData": "https://authentication-devices.sandbox.checkout.com/sessions-interceptor/sid_iixxg7abmqkypepvfsrwua7uja",
            "payDataType": "payurl",
            "payOrderDetailId": "PD2011293075558170625",
            "payOrderDetailIdEncode": "3ff04ea391ed7163c6943e39e774dbf159ddde496e5ffcde0996ab4805a6eaaf",
            "payOrderDetailState": 1,
            "payOrderId": "P2011293075021299713"
        },
        "pay_order_id": "P2011293075021299713"
    },
    "msg": "SUCCESS"
}
Without 3DS (Direct Processing):
{
    "code": 0,
    "data": {
        "order_data": {
            "mchOrderNo": "M20260115121901",
            "orderState": 1,
            "payOrderDetailId": "PD2011293075558170625",
            "payOrderDetailIdEncode": "3ff04ea391ed7163c6943e39e774dbf159ddde496e5ffcde0996ab4805a6eaaf",
            "payOrderDetailState": 1,
            "payOrderId": "P2011293075021299713"
        },
        "pay_order_id": "P2011293075021299713"
    },
    "msg": "SUCCESS"
}

Response Handling#

1.
Check payDataType:
If payDataType is payurl: Redirect user to the payData URL for 3DS authentication
If payDataType is empty: Payment is processing, wait for callback notification
2.
Wait for Callback: Always wait for the payment callback to confirm the final payment status

2.2 Token Payment#

Overview#

After a successful card payment with store_for_future_use: true, you'll receive a card_token in the callback notification. This token can be used for future payments without requiring the user to re-enter card details.

Token Acquisition#

The card_token is provided in the channel_biz_data field of the payment callback:
{
  "channel_biz_data": {
    "card_token": "src_3oqxta2juhbevjaw72pgorkd5e",
    "issuer": "CKO, WHERE THE WORLD CHECKS OUT",
    "issuer_country": "GB"
  }
}

Sequence Diagram#

Complete API Documentation#

Create Order API: Create Payin
Signature Generation: Authentication

Create Order Endpoint#

POST /api/global/v1/pay/create-order

Required Parameters#

Similar to Direct Card Payment, but replace card_data with token_data:
ParameterTypeRequiredDescription
target_amountStringYesPayment amount
target_currencyStringYesCurrency code (e.g., CNY, USD)
transaction_typeStringYesMust be PAY_IN
notify_urlStringYesCallback URL for payment notifications
request_idStringYesUnique merchant order ID
fail_urlStringYesRedirect URL on payment failure
success_urlStringYesRedirect URL on payment success
product_nameStringYesProduct/service name
descriptionStringYesOrder description
way_typeStringYesMust be CARD_PAYMENT
api_versionStringYesMust be V2
pay_access_typeIntegerYesMust be token for OpenAPI Mode
channel_extra.extra_typeStringYesMust be token for token payment
channel_extra.token_dataObjectYesToken information object
channel_extra.token_data.tokenStringYesThe card token from previous payment

Request Example#

Response Handling#

Token payments follow the same response handling as Direct Card Payments:
Check payDataType for 3DS requirement
Wait for callback notification for final status

Webhook (Payment Callback Notification)#

Overview#

After payment processing (success or failure), our system sends a callback notification to the notify_url you provided in the order request.

Callback Format#

{
  "api_version": "V2",
  "description": "Lesspay Order",
  "fail_url": "https://www.doopayment.com",
  "order_status": "SUCCEED",
  "order_status_int": 2,
  "pay_order_id": "P2011789219984105474",
  "product_name": "Lesspay Order",
  "request_id": "M20260115121901",
  "success_url": "https://www.doopayment.com",
  "target_amount": "100.00",
  "target_currency": "CNY",
  "channel_biz_data": {
    "card_token": "src_3oqxta2juhbevjaw72pgorkd5e",
    "issuer": "CKO, WHERE THE WORLD CHECKS OUT",
    "issuer_country": "GB"
  }
}

Callback Parameters#

ParameterTypeDescription
order_statusStringPayment status: SUCCEED, FAILED, etc.
order_status_intIntegerStatus code: 2 = Success
pay_order_idStringPlatform order ID
request_idStringYour original merchant order ID
target_amountStringPayment amount
target_currencyStringPayment currency
channel_biz_dataObjectChannel-specific data (includes card_token if requested)

Callback Verification#

See Payin webhook

Order Status#

See Parameter Specifications
Modified at 2026-02-28 07:57:34
Previous
Error Codes
Next
3D Secure (3DS) Configuration
Built with