Home/Guides/Integration & E-commerce Guides
Integration & E-commerce Guides

SSLCommerz Integration: A Step-by-Step Guide for Developers.

SSLCommerz is one of the most used payment aggregators in Bangladesh. The integration is simple to start and easy to get subtly wrong — especially payment validation.

Short answer

To integrate SSLCommerz you register a sandbox store to get a store ID and store password, create a payment session from your server with the order amount, currency, transaction ID, customer details and your success, fail, cancel and IPN URLs, then redirect the customer to the gateway page returned by the session API. When the customer returns or the IPN arrives, call SSLCommerz's order validation API from your server with the validation ID and only mark the order paid if the status is valid and the amount, currency and transaction ID match your order. After testing, apply for a live store and swap credentials.

Before you write code

  • Create a sandbox account on the SSLCommerz developer site to receive test store credentials.
  • Decide your integration type: hosted payment page (simplest and most common), easy checkout popup, or an official plugin for WooCommerce and other platforms.
  • Make sure your live website has product pages, prices, contact details and terms, privacy and refund policies — live store approval depends on them.
  • Keep store ID and password only in server-side configuration.

The payment flow

StepWhoDetail
1. Create sessionYour serverPOST order data (total amount, currency, tran_id, product and customer fields, success/fail/cancel/IPN URLs) to the session API
2. RedirectBrowserSend the customer to the gateway URL returned in the response
3. PayCustomerChooses card, mobile banking or internet banking on the SSLCommerz page
4. Return + IPNSSLCommerzPosts the result to your success/fail/cancel URL and separately to your IPN listener
5. ValidateYour serverCalls the validation API with val_id; checks status, amount, currency and tran_id
6. FulfilYour serverMarks the order paid exactly once and sends confirmation

Field and endpoint names follow the SSLCommerz developer documentation; always build against the current version.

Why the IPN and validation step matter

The browser redirect can fail — the customer closes the tab, mobile data drops, or someone forges a POST to your success URL. The IPN (instant payment notification) is a server-to-server message that arrives even when the browser does not, and the validation API is your proof that SSLCommerz actually recorded the payment. Use both: process whichever arrives first, validate it, and make the handler idempotent so the second arrival does nothing.

Also store the bank transaction ID and card or wallet type returned by validation; your accounts team will need them for reconciliation and refunds.

Common SSLCommerz integration mistakes

  • Trusting the success URL — never mark paid from the redirect alone; always validate on the server.
  • Reusing transaction IDs — generate a unique tran_id per attempt so retries do not collide.
  • Amount drift — compare validated amount with the order total stored on your server, not the value posted back.
  • Sandbox credentials in production — a surprisingly common go-live bug; keep environments in separate config.
  • Ignoring risk flags — validation can return a risk level; hold risky orders for manual review instead of auto-shipping.

Go-live checklist

  1. Test successful, failed, cancelled and abandoned payments in sandbox.
  2. Simulate a lost redirect and confirm the IPN alone completes the order.
  3. Test a refund through the refund API or merchant panel and record it against the order.
  4. Apply for the live store with complete business documents and switch to live credentials and endpoints.
  5. Reconcile the first weeks of settlements against your order list daily.

How DreamIT can help

DreamIT has integrated payments, messaging and e-commerce systems for Dream Group brands and client projects. If you need help with SSLCommerz integration, we can scope the integration, test it end to end and hand it over with documentation. Contact DreamIT.

Frequently asked questions

Does SSLCommerz support bKash and Nagad?

SSLCommerz's hosted page offers cards, mobile banking and internet banking; the exact wallets and banks enabled depend on your merchant agreement, so confirm with SSLCommerz.

Is there an SSLCommerz plugin for WooCommerce?

Yes, SSLCommerz provides plugins and SDKs for common platforms. Keep them updated and still confirm that the plugin performs server-side validation.

What is the difference between the IPN and the success URL?

The success URL is where the customer's browser lands; the IPN is a separate server-to-server notification. The IPN is more reliable and should drive fulfilment after validation.

How do I get a live SSLCommerz store?

After sandbox testing, apply for a live store with your business documents and a complete website. SSLCommerz reviews the application and issues live credentials.

Sources and further reading

Editorial note: this guide is written for general information and reviewed by the DreamIT team. We do not publish prices or fees we cannot source; always confirm current pricing, fees and requirements with the provider before you decide. Last reviewed 27 Nov 2026.

Need help with SSLCommerz integration?

Book a free 30-minute call with the DreamIT team. We will tell you honestly what we would do.