1. WPay
WPay
  • Introduction
  • Signature
  • API Keys
  • Get Started
  • Webhook Service
  • Api Reference
    • Authentication
      • Get Access Token
      • Refresh Access Token
    • WPay
      • Hosted Payment Page
        POST
      • List Payment History
        POST
      • Get Payment Detail
        POST
      • Refund
        POST
      • List Subscriptions
        POST
      • Get Subscription Detail
        POST
      • Cancel Subscription
        POST
      • Get Subscription Bills
        POST
    • Webhook
      • Simulate a Event Call
  • Schemas
    • Schemas
      • RefundOrderDTO
      • RefundPageReq
      • ApiPageApiPageRefundOrderDTO
      • ApiResponseApiPageRefundOrderDTO
      • CancelReq
  1. WPay

Hosted Payment Page

Developing
POST
/checkout/w-payment/hpp
Initiates a hosted payment page (HPP) session. Supports both one-time and subscription payments. Returns a redirectUrl for the customer to complete payment.

Request

Body Params application/jsonRequired

Examples
{
  "mchOrderNo": "ORD-20240423-001",
  "amount": 99.99,
  "currency": "USD",
  "payMode": "ONETIME",
  "successUrl": "https://yourdomain.com/pay-result?status=success",
  "cancelUrl": "https://yourdomain.com/pay-result?status=cancel"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location '/checkout/w-payment/hpp' \
--header 'Content-Type: application/json' \
--data '{
  "mchOrderNo": "ORD-20240423-001",
  "amount": 99.99,
  "currency": "USD",
  "payMode": "ONETIME",
  "successUrl": "https://yourdomain.com/pay-result?status=success",
  "cancelUrl": "https://yourdomain.com/pay-result?status=cancel"
}'

Responses

🟢200成功
application/json
Bodyapplication/json

Example
{
  "retcode": "200",
  "retmsg": "success",
  "retdata": {
    "trxNo": "TRX1714012345678",
    "mchOrderNo": "ORD-20240423-001",
    "status": 1,
    "amount": 99.99,
    "redirectUrl": null
  }
}
Modified at 2026-05-17 23:15:55
Previous
Refresh Access Token
Next
List Payment History
Built with