Define payment scenarios

Learn how to configure payment flows using productType, subProductType, and txnType parameters.

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.

ParameterPurposeExamples
productTypePayment productCard, local payment method, QR code
subProductTypePayment modelDirect, tokenized, subscription, installment
txnTypeTransaction typeSale, refund, authorization, capture

Choose a product type

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.

The local payment methods available to you depend on your account configuration and geographic region.

Product type selection guide

If your business...UseWhy
Serves international customers or operates cross-borderCARDSupports global card networks
Operates in regions with strong local payment preferencesLPMSOffers familiar options like WeChat Pay
Has physical retail locationsPAYMENT_CODEFast in-person checkout
Uses self-service kiosks or unmanned retailORDER_CODECustomers pay without staff
Set productType: "ALL" to display an aggregated checkout page with all enabled payment methods.

Choose a payment model

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"
}

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"
}
Tokenization reduces your PCI (Payment Card Industry) compliance scope because you never store actual card numbers.

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"
}

Payment model selection guide

If you need to...UseKey benefit
Process one-time paymentsDIRECTSimple and immediate settlement
Save payment methods securelyTOKENReduced PCI scope, faster repeat purchases
Charge customers on a recurring scheduleSUBSCRIBEAutomated billing, improved retention
Offer flexible payment termsINSTALLMENTLower barriers, higher conversion

Payment model compatibility

Product TypeSupported Payment Models
CARDDIRECT, TOKEN, SUBSCRIBE, INSTALLMENT
LPMSDIRECT, SUBSCRIBE
PAYMENT_CODEDIRECT
ORDER_CODEDIRECT

Specify the transaction type

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"
}

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.

Authorizations expire after 7 days by default. Configure this in your account settings. Uncaptured funds are automatically released.
You can capture less than the authorized amount. For example, authorize $100, capture $75, and the remaining $25 is automatically released.

Mobile wallet integration

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.

ParameterDescriptionValues
paymentModeHow the payment is initiatedIN_APP, WEB
osTypeCustomer's operating systemIOS, ANDROID
lpmsInfoLocal payment method detailsJSON string with lpmsType
{
  "productType": "LPMS",
  "subProductType": "DIRECT",
  "txnType": "SALE",
  "paymentMode": "IN_APP",
  "osType": "IOS",
  "lpmsInfo": "{\"lpmsType\":\"WeChat\"}"
}
For a complete list of supported local payment methods and their integration requirements, see Local payment methods guideAPI.