Create your WayPay account
To use the WayPay Merchant APIs, first create an account:- Go to: https://portal.dev.waypay.live
- Click Sign Up and complete the registration form (business name, contact, email, phone).
- Verify your email address via the link sent to your inbox.
- Provide required business details and documents for compliance (KYC/KYB).
- Submit for review and wait for approval. You’ll be notified once your account is active.
Your API access becomes available only after your account is approved and
active. Approval timelines vary based on compliance review completeness.
Get your API key
Once approved:- Sign in to the merchant portal.
- Locate your API key in the dashboard.
- Copy it securely. Never commit keys to source control.
- Use separate keys per environment and rotate them periodically.
Understanding Test Mode
Test Mode vs Production ModeWayPay provides two environments to help you develop and test your integration safely:
Test Mode (Sandbox)
When using API keys that start withpk_test_, you are in test mode:
- ✅ No real money is processed - All transactions are simulated
- ✅ Free unlimited testing - Test as many transactions as you need
- ✅ Instant processing - No waiting for real bank confirmations
- ✅ Same API behavior - Test mode mirrors production functionality
- ✅ Separate data - Test transactions never affect production data
Test Credentials
Always use these standardized test credentials in sandbox mode:Test Phone Number
03123456789Use for all mobile wallet and customer phone fieldsTest CNIC
Full:
3520108345678Last 6 digits: 345678Test OTP
123456Use when completing mobile wallet verificationTest Bank Account
IBAN:
PK36SCBL0000001123456702Bank: Standard Chartered BankAccount Title: Test UserProduction Mode
When using API keys that start withpk_live_:
- ⚠️ Real money is processed - Actual charges and transfers occur
- 💳 Real customer data required - Use actual phone numbers, CNICs, bank accounts
- 🏦 Real banking delays - Transactions follow actual bank processing times
- 📊 Affects live balances - All transactions update production wallet balances
Make your first test API call
Set your test API key in the terminal:Example 1: Create a test checkout session
paymentIntentId and checkoutUrl:
checkoutUrl to complete the test payment.
Example 2: Test mobile wallet deposit
In test mode, use OTP
123456 to complete the mobile wallet verification.Example 3: Test bank withdrawal/payout
Additional Test Examples
Check test wallet balance
Get test transaction details
Issue a test refund
About Signatures in ExamplesThe
signature field values shown in the examples above (e.g., a1b2c3d4e5f6789012345678abcdef12) are placeholders. In production, you must generate valid signatures using your secret key.See the Signature Generation Guide for step-by-step instructions on how to generate signatures in C#, Node.js, Python, PHP, and Java.Going Live Checklist
Before switching to production mode:- ✅ Test all payment flows thoroughly in sandbox
- ✅ Implement proper error handling for all endpoints
- ✅ Set up and test webhook endpoints
- ✅ Test transaction status polling/verification
- ✅ Implement idempotency for all payment requests
- ✅ Set up proper logging and monitoring
- ✅ Review and implement security best practices
- ✅ Validate all required field formats (CNIC, phone, bank account)
- ✅ Complete KYC/KYB verification
- ✅ Obtain production API key (
pk_live_) - ✅ Update environment variables with production key
- ✅ Switch to using real customer data (phone, CNIC, bank accounts)
- ✅ Test a small transaction in production
- ✅ Monitor first few production transactions closely
Troubleshooting
401 Unauthorized
Ensure the header is present and correct:- Missing
SWICH-API-Keyheader - Incorrect API key
- Using test key in production or vice versa
- API key has been revoked
400 Bad Request
Check your payload fields and formats:descriptionmust be 1-200 alphanumeric characters and spacesamountmust be greater than 10currencymust be exactly 3 characters (e.g., “PKR”)- Required fields are present (name, email, cnic, phone)
- In test mode, use correct test credentials
- Phone must match pattern:
^(\+92|0)?3\d{9}$ - CNIC must be 13 digits:
^\d{13}$
422 Validation Error
Your request passed basic validation but failed business logic:- Insufficient balance
- Invalid mobile number format (must be
03123456789in test mode) - Transaction already refunded
- CNIC format incorrect (must be
3520108345678in test mode) - Bank account number length invalid (10-24 characters)
- Email format invalid
See the full API reference and schema at the API Reference, and detailed endpoint examples under API Reference → Endpoints.
Next steps
API reference
Explore endpoints, payloads, and examples powered by OpenAPI.
Authentication
Learn about API key management and security best practices.
Payment Endpoints
Deep dive into payment processing options.
Deposit Orders
Collect payments from mobile wallets.
Withdrawal Orders
Process payouts to bank accounts.
Webhooks
Set up real-time event notifications.
Need help? Contact support@waypay.live or check our documentation.