Skip to main content

Create your WayPay account

To use the WayPay Merchant APIs, first create an account:
  • Go to: https://waypay-dev-web.icydesert-41d42f7e.uaenorth.azurecontainerapps.io
  • 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.
All API requests must include this header:
  • Swich-API-Key: YOUR_API_KEY
Treat your API key like a password. Rotate it immediately if exposed.

Make your first API call

Set your key in the terminal:
export SWICH_API_KEY="sk_live_XXXX"
Create a hosted checkout payment intent:
curl -X POST "https://waypay-merchant-api.icydesert-41d42f7e.uaenorth.azurecontainerapps.io/Gateway/v1/Payment/initiate" \
  -H "Content-Type: application/json" \
  -H "Swich-API-Key: $SWICH_API_KEY" \
  -d '{
    "amount": 50000,
    "currency": "PKR",
    "description": "Order 12345",
    "customerRef": {
    "name": "Ayesha Khan",
    "email": "ayesha@example.com",
    "phone": "+923001234567"
  },
    "orderRef": { "orderRef": "ORD12345" },
    "successUrl": "https://merchant.example.com/checkout/success",
    "cancelUrl": "https://merchant.example.com/checkout/cancel"
  }'
You should receive a response with paymentIntentId and checkoutUrl.

Charge a tokenized mobile wallet (optional)

curl -X POST "https://waypay-merchant-api.icydesert-41d42f7e.uaenorth.azurecontainerapps.io/Gateway/v1/Payment/charge-mobile-wallet" \
  -H "Content-Type: application/json" \
  -H "Swich-API-Key: $SWICH_API_KEY" \
  -d '{
    "token": "tok_mwallet_9xK3PQrA",
    "mobileNumber": "+923001234567",
    "amount": 1500.0,
    "billReference": "INV-98127",
    "description": "Wallet charge for order ORD-98127",
    "last6CNICDigits": "123456"
  }'

Issue a refund (optional)

curl -X POST "https://waypay-merchant-api.icydesert-41d42f7e.uaenorth.azurecontainerapps.io/Gateway/v1/Refunds" \
  -H "Content-Type: application/json" \
  -H "Swich-API-Key: $SWICH_API_KEY" \
  -d '{
    "trxnRef": "trx_7ZP8X2",
    "amount": 500.0,
    "reason": "Customer returned the item"
  }'

Troubleshooting

  • 401 Unauthorized
    Ensure the header is present and correct: -H “Swich-API-Key: $SWICH_API_KEY”
  • 400 Validation error
    Check your payload fields and formats (e.g., description length and characters).
See the full API reference and schema at /docs/api-reference/openapi.json, and endpoint examples under API Reference → Endpoints.

Next steps

Need help? See the Mintlify docs or join the community.