Define the payment scenario by combining three parameters: productType, subProductType, and txnType. These parameters tell Onerway what payment product to use, how to process the payment, and what funds flow to execute.
| Parameter | Purpose | Examples |
|---|---|---|
productType | Payment product | Card, local payment method, QR code |
subProductType | Payment model | Direct, tokenized, subscription, installment |
txnType | Transaction type | Sale, refund, authorization, capture |
The productType parameter specifies which payment product to use. This determines the payment flow and available payment methods.
Accept credit and debit cards from international networks including Visa, Mastercard, and American Express.
Use for: Online checkout, recurring subscriptions, saving cards, installment payments.
Compatible models: DIRECT, TOKEN, SUBSCRIBE, INSTALLMENT.
Accept region-specific payment methods such as Alipay, WeChat Pay, and other digital wallets popular in specific markets.
Use for: Regional customers, familiar payment options, reducing payment friction.
Compatible models: DIRECT, SUBSCRIBE.
| If your business... | Use | Why |
|---|---|---|
| Serves international customers or operates cross-border | CARD | Supports global card networks |
| Operates in regions with strong local payment preferences | LPMS | Offers familiar options like WeChat Pay |
| Has physical retail locations | PAYMENT_CODE | Fast in-person checkout |
| Uses self-service kiosks or unmanned retail | ORDER_CODE | Customers pay without staff |
productType: "ALL" to display an aggregated checkout page with all enabled payment methods.The subProductType parameter specifies the payment model and processing method. It works with productType to precisely describe the payment scenario.
Process immediate, one-time payments. Funds are captured in real-time when the customer completes the transaction.
When to use: Standard e-commerce checkout, one-time purchases, immediate payment collection.
{
"productType": "CARD",
"subProductType": "DIRECT"
}
Replace WeChat with the actual payment method type (such as Alipay, DANA):
{
"lpmsInfo": "{\"lpmsType\":\"WeChat\"}",
"productType": "LPMS",
"subProductType": "DIRECT"
}
Save sensitive card information as a secure token for future use. Tokenization enhances security by storing a placeholder instead of actual card details.
When to use: Save customers' payment methods for faster checkout without re-entering card details.
{
"productType": "CARD",
"subProductType": "TOKEN"
}
Enable recurring, automatic charges for subscription-based businesses. Onerway initiates charges according to your defined billing cycle.
When to use: SaaS subscriptions, membership fees, recurring services, automatic renewals.
The subscription field contains a JSON string specifying the subscription details:
{
"productType": "CARD",
"subProductType": "SUBSCRIBE",
"subscription": "{...}"
}
Split the total amount into multiple smaller payments over time. This reduces the upfront cost for customers and can increase conversion for high-value purchases.
When to use: High-value purchases, consumer electronics, furniture, luxury items.
{
"productType": "CARD",
"subProductType": "INSTALLMENT"
}
| If you need to... | Use | Key benefit |
|---|---|---|
| Process one-time payments | DIRECT | Simple and immediate settlement |
| Save payment methods securely | TOKEN | Reduced PCI scope, faster repeat purchases |
| Charge customers on a recurring schedule | SUBSCRIBE | Automated billing, improved retention |
| Offer flexible payment terms | INSTALLMENT | Lower barriers, higher conversion |
| Product Type | Supported Payment Models |
|---|---|
CARD | DIRECT, TOKEN, SUBSCRIBE, INSTALLMENT |
LPMS | DIRECT, SUBSCRIBE |
PAYMENT_CODE | DIRECT |
ORDER_CODE | DIRECT |
The txnType parameter determines how Onerway processes the payment. Different transaction types correspond to different fund flows.
Process a standard payment transaction. Funds are immediately captured when the customer completes the payment.
When to use: Most common transaction type for one-time purchases and immediate payment collection.
{
"productType": "CARD",
"subProductType": "DIRECT",
"txnType": "SALE"
}
{
"lpmsInfo": "{\"lpmsType\":\"WeChat\"}",
"productType": "LPMS",
"subProductType": "DIRECT",
"txnType": "SALE"
}
Reverse a completed transaction and return funds to the customer. Onerway treats sales as forward transactions and refunds as reverse transactions.
When to use: Process customer refund requests for previously completed payments.
You'll see this transaction type in API query responses and webhook notifications:
{
"txnType": "REFUND"
}
Save a customer's card information without charging them. This creates a token you can use for future payments.
When to use: Collect payment method details for future use without immediate charge, such as trial sign-ups or delayed billing.
You'll see this transaction type in API query responses and webhook notifications:
{
"txnType": "BIND_CARD"
}
Pre-authorization reserves funds on a customer's card without immediately charging them. Use this for scenarios where the final amount isn't known upfront, such as hotel bookings or car rentals.
The pre-authorization flow has three steps:
1. Authorize (AUTH) — Reserve funds on the customer's card:
{
"txnType": "AUTH",
"amount": "10000",
"currency": "USD"
}
2. Capture (CAPTURE) — Finalize the charge (full or partial amount):
{
"txnType": "CAPTURE",
"originTransactionId": "original_auth_transaction_id"
}
3. Void (VOID) — Cancel the authorization and release funds:
{
"txnType": "VOID",
"originTransactionId": "original_auth_transaction_id"
}
If not captured, the authorization automatically expires and releases the funds.
Some digital wallets, such as WeChat Pay and DANA, can launch their native apps on mobile devices for a seamless payment experience. Specify additional parameters to enable in-app payments.
| Parameter | Description | Values |
|---|---|---|
paymentMode | How the payment is initiated | IN_APP, WEB |
osType | Customer's operating system | IOS, ANDROID |
lpmsInfo | Local payment method details | JSON string with lpmsType |
{
"productType": "LPMS",
"subProductType": "DIRECT",
"txnType": "SALE",
"paymentMode": "IN_APP",
"osType": "IOS",
"lpmsInfo": "{\"lpmsType\":\"WeChat\"}"
}
{
"productType": "LPMS",
"subProductType": "DIRECT",
"txnType": "SALE",
"paymentMode": "IN_APP",
"osType": "ANDROID",
"lpmsInfo": "{\"lpmsType\":\"DANA\"}"
}