Setup
To integrate with Onerway Payments, first activate a sandbox account, obtain API credentials, and configure the sandbox IP allowlist. Develop and test your integration in the sandbox before configuring the production environment and going live.
Integration steps
Activate your sandbox account
Contact Onerway technical support with your email address and test domain to receive a dashboard invitation. Once you click the link in that email, your merchant account is active in the sandbox.
If you show the Apple Pay button on your own pages through the Web SDK or the Direct API, every sandbox and production domain involved must pass Apple domain verification, either through your own Apple Developer account or registered by Onerway; the Onerway-hosted checkout page does not need this step. See Apple Pay setup.
For Google Pay through the Direct API, complete website registration before going live; Checkout and the Web SDK need no registration.
Retrieve your credentials
Obtain the environment-specific credentials from the merchant portal:
| Credential | Use |
|---|---|
merchantNo | Identifies the merchant; submit it as required by each endpoint. |
appId | Identifies the application or store; submit it as required by each endpoint. |
API Key of type API_KEY | Authenticates server-side Payments v2 requests through the ApiKey header. |
| Webhook signing key | Verifies notifications on your server; keep it separate from the API Key. |
Find these credentials in the merchant portal:
merchantNo: Settings → Business → Merchant details — Sandbox · Production.appId: Settings → Payment settings → Sites & Apps — Sandbox · Production.- API Keys and webhook signing keys: Developers → API Keys — Sandbox · Production.
Keep both kinds of key on your server. Do not embed them in client-side code, mobile binaries, version control, or logs. See Request authentication for API base URLs, request headers, and API Key rotation, and Webhook signature verification for notification verification.
Configure your IP allowlist
Before making your first server-side API request in the sandbox, you must add every public IP address from which your server calls Onerway to the sandbox IP allowlist. In the sandbox merchant portal, go to Developers → IP allowlist and add these addresses. Use your server's outbound IP addresses, not the IP addresses of customers visiting your website.
Configure the IP allowlist separately for the sandbox and production environments. Before going live, you must add all public outbound IP addresses used by your production servers in the production merchant portal. Add the IP addresses in each environment even if they are the same.
| Environment | When to configure | Portal link |
|---|---|---|
| Sandbox | Before your first server-side API request in the sandbox | Sandbox IP allowlist |
| Production | Before your first server-side API request in production | Production IP allowlist |
When the IP allowlist is enabled, requests from IP addresses that are not on the allowlist for the target environment may be rejected.
If you need to restrict the source IP addresses of webhook requests, configure your endpoint using the webhook source IP allowlist.
Build and test
After configuring the sandbox IP allowlist, use your sandbox credentials to develop and test your integration. Verify all payment flows, error handling, and webhooks. Before switching to the production API base URL and credentials, you must add your production servers' public outbound IP addresses to the production IP allowlist. Also complete any required payment method setup, such as Apple Pay domain verification or Google Pay website registration.
Dates and times
Dates and times generated by Onerway Payments use Beijing time (UTC+08:00), unless a field specifies otherwise. Merchant-supplied times and time zones, and third-party times returned unchanged, follow their respective field descriptions.
Transaction creation time is when Onerway creates a transaction after receiving the request. Transaction completion time is when Onerway updates the transaction status to successful or failed. Each field specifies its date and time format.
In refund notifications, txnTime is when Onerway submits the refund for processing, not when the refund request is created or the refund completes. In SDK order creation responses (status=U), txnTime is null and txnTimeZone is +08:00. The time zone value does not indicate payment completion.
Next steps
- Request authentication — send the
ApiKeyheader and retain the required IP allowlist - Currency and amount validation — validate
orderCurrency,orderAmount, and payment method limits before creating a payment request - Sandbox testing — use sandbox test cards to validate success, failure, subscription, and token payment scenarios