SUWAPAY DEVELOPER PLATFORM

Merchant Payment API

Create a payment request on your backend, redirect the customer to SuwaPay Checkout, then verify the final status from your backend. This build uses manual wallet payment and human verification; it is not connected to an automatic mobile-money provider.

Flow
  1. Create pay-in via API.
  2. Redirect customer to the returned checkout_url.
  3. Customer transfers funds and submits the transaction ID.
  4. Admin/wallet operator verifies the real transaction.
  5. Merchant polls status and fulfils the order only after approved.
PHP integration kit

Download the source package and see docs/third-party-integration/README-BN.md plus suwapay-client.php for a server-side signed request example.

Authentication

All /api/v1/* requests use HMAC request signing. Headers:

X-SuwaPay-Key: YOUR_API_KEY
X-SuwaPay-Timestamp: UNIX_TIMESTAMP
X-SuwaPay-Nonce: unique_random_string_16_chars_or_more
X-SuwaPay-Signature: hex_hmac_sha256

Signature input is timestamp + "\n" + nonce + "\n" + exact_raw_request_body, signed with the merchant API secret. For GET requests, sign an empty body. Keep the API secret on your server only.

Create payment

POST /api/v1/payins

{
  "merchant_reference": "ORDER-1001",
  "amount": 100,
  "callback_url": "https://merchant.example/webhook"
}

Successful response (HTTP 201) includes:

{
  "ok": true,
  "data": {
    "payment_id": "32-character-payment-id",
    "checkout_url": "https://suwapay.pro/checkout/32-character-payment-id",
    "merchant_reference": "ORDER-1001",
    "amount": "100.00",
    "currency": "BDT",
    "status": "pending",
    "payment_method": "nagad",
    "instructions": { "wallet_label": "Main wallet", "wallet_number": "01XXXXXXXXX" }
  }
}

The payment_method must be bkash, nagad or rocket. SuwaPay selects an active wallet of that method whose amount limits match. Once an operator verifies or rejects the deposit, a webhook event is queued for delivery by the CLI worker. Verify X-SuwaPay-Timestamp and X-SuwaPay-Signature using HMAC-SHA256 over timestamp + newline + exact raw JSON body; use the merchant API secret and reject old timestamps. Always confirm status through the authenticated status endpoint; never treat the browser redirect as payment confirmation.

Payment status

GET /api/v1/payins/{payment_id}

The response is scoped to the authenticated merchant. Possible states include pending, approved, rejected, failed and expired. This system marks a manual pay-in approved only after an authorized operator verifies it.

Submit transaction reference by API

POST /api/v1/payins/{payment_id}/reference

{ "transaction_reference": "REAL-TRANSFER-TXN-ID" }

Balance

GET /api/v1/balance

Payout request

POST /api/v1/payouts

{
  "merchant_reference": "PAYOUT-1001",
  "amount": 500,
  "method": "bkash",
  "account": "01XXXXXXXXX"
}

Payouts reserve available balance and are queued for admin review; automated disbursement is not included unless an approved provider adapter is separately configured. Check GET /api/v1/payouts/{payout_id} for the current state.

Errors

Security notes

Return to SuwaPay