Tour of the API

See how Onerway API objects fit together and learn best practices for combining them.

The Onerway APIs are powerful and flexible if you know how to use them. This tour covers key information to help you understand the APIs more deeply:

  • The core concepts we use across the APIs
  • The path a successful payment takes
  • The objects that play a role and how to determine when they're needed
  • Common patterns and best practices for using those objects together

Understanding these patterns helps you move beyond the pre-written code in Onerway tutorials. You can combine simple patterns in novel ways and plan for future growth.

Core concepts

Transaction lifecycle

Every transaction in Onerway is tracked using a unique transaction ID. Whether it's a payment, refund, or dispute, Onerway generates a transaction ID that follows the payment through its entire lifecycle.

Each checkout session has a 30-minute lifecycle, during which customers can complete their payment. After this window, the session expires and a new session must be created.

You can query transaction statusPayments API to check the current state of any transaction ID.

Structured data objects

Onerway uses structured data objects to handle payment information. Each API request follows a clearly defined data structure to ensure accuracy, completeness, and security.

A payment request consists of multiple data objects, each responsible for transmitting specific types of information:

Core transaction objects

ObjectPurposeKey Fields
TxnOrderMsgOrder and merchant contextReturn URL, notification URL, product list, customer platform, browser fingerprint data
ProductsLine items for the orderProduct name, price, quantity, currency, type (physical/virtual/discount/shipping)
TransactionAddressCustomer contact and locationEmail (required), name, phone, postal code, full address, country (ISO 3166-1 alpha-2)

Payment method objects

ObjectPurposeKey Fields
CardInfoCard payment credentialsCardholder name, card number, expiration month/year, CVV security code
TokenInfoSaved payment methodsToken identifier for repeat payments without re-entering card details
LpmsInfoLocal payment configurationPayment method type (e.g., WeChat, Alipay), regional wallet settings

Security and subscription objects

ObjectPurposeKey Fields
mpiInfo3D Secure authenticationECI (Electronic Commerce Indicator), CAVV, XID (v1) or dsTransID (v2)
SubscriptionRecurring billing setupBilling cycle (frequency type/point), trial period (days/end date), expiration, notification email
Data format: All nested objects must be serialized as JSON strings before submission. For example, cardInfo is passed as a stringified JSON object, not a native object.

Example structure:

{
  "merchantNo": "800209",
  "merchantTxnId": "txn-12345",
  "orderAmount": "99.99",
  "orderCurrency": "USD",
  "productType": "CARD",
  "subProductType": "DIRECT",
  "txnType": "SALE",
  "txnOrderMsg": "{\"returnUrl\":\"https://example.com/return\",\"notifyUrl\":\"https://example.com/webhook\",\"products\":\"[{...}]\"}",
  "cardInfo": "{\"holderName\":\"John Doe\",\"cardNumber\":\"4111111111111111\",\"month\":\"12\",\"year\":\"25\",\"cvv\":\"123\"}",
  "billingInformation": "{\"email\":\"customer@example.com\",\"country\":\"US\",...}",
  "shippingInformation": "{\"email\":\"customer@example.com\",\"country\":\"US\",...}"
}

Regardless of how you integrate Onerway—through direct API calls, SDK integration, or hosted checkout—you need to organize and transmit information according to these predefined structures.

Integration methods

Onerway offers multiple integration options to meet different business needs. Each option balances user experience, development complexity, and brand presentation differently.

Redirect customers to an Onerway-hosted payment page. This option minimizes frontend development work and gets you up and running quickly.

How it works:

PCI compliance: Onerway handles all sensitive card data, so your integration is automatically PCI compliant without additional certification.

Best for: Businesses that want the fastest time to market with minimal development effort.

Choose your integration path

The following table compares the three integration options to help you choose the best fit for your business:

FeatureHosted CheckoutEmbedded CheckoutDirect API
Setup complexityLowMediumHigh
PCI complianceOnerway handlesOnerway handlesYou handle
UI customizationLimitedModerateFull control
BrandingShows OnerwayMinimal OnerwayNo Onerway branding
User experienceRedirect requiredOn-pageFully customized
Time to integrateFastestModerateLongest

Each option has trade-offs between development time, customization, and compliance requirements. Choose based on your technical resources and business needs.