QPay payments in Go
Official SDK libraries for the QPay V2 Payment API. One consistent interface across 11 languages, 9 frameworks, and 7 CMS plugins.
Why QPay SDK?
- Automatic Token Management — Authenticate once. Tokens are obtained, cached, and refreshed behind the scenes. You never write auth code.
- Type-safe Models — Strongly typed request and response objects in every language. Catch errors at compile time, not in production.
- Comprehensive Error Handling — Structured error types with QPay error codes, HTTP status codes, and raw response bodies.
- Full API Coverage — Invoices, payments, refunds, cancellations, and ebarimt. Every V2 endpoint is supported.
- Consistent API Surface — The same method names and patterns across all 11 SDKs. Learn one, know them all.
- Environment Variable Config — Set five env vars and go. Or configure manually in code. Your choice.
Published SDKs
All core SDKs are released at v1.0.0 and available on their respective package registries.
| Language | Package | Registry | Install Command |
|---|---|---|---|
| Go | qpay-go | pkg.go.dev | go get github.com/qpay-sdk/qpay-go |
| JavaScript / TypeScript | qpay-js | npm | npm install qpay-js |
| Python | qpay-py | PyPI | pip install qpay-py |
| PHP | qpay-php | Packagist | composer require usukhbayar/qpay-php |
| Ruby | qpay-ruby | RubyGems | gem install qpay-sdk |
| Dart / Flutter | qpay-dart | pub.dev | dart pub add qpay |
| Rust | qpay-rust | crates.io | cargo add qpay |
| Java | qpay-java | Maven Central | See Java SDK docs |
| .NET (C#) | qpay-dotnet | NuGet | dotnet add package QPay |
| Swift | qpay-swift | SPM | Swift Package Manager |
| cURL | qpay-curl | GitHub | git clone (shell scripts) |
Framework Packages
Framework-specific integration packages built on top of the core SDKs. Each package follows the conventions of its framework — dependency injection, configuration, webhook routing, and UI components come pre-wired.
| Framework | Package | Registry | Install Command |
|---|---|---|---|
| Laravel | qpay-sdk/laravel | Packagist | composer require qpay-sdk/laravel |
| Django | django-qpay | PyPI | pip install django-qpay |
| Spring Boot | qpay-spring-boot-starter | Maven Central | Maven / Gradle |
| Express | @qpay-sdk/express | npm | npm install @qpay-sdk/express |
| NestJS | @qpay-sdk/nestjs | npm | npm install @qpay-sdk/nestjs |
| Rails | qpay-rails | RubyGems | gem install qpay-rails |
| ASP.NET Core | QPay.AspNetCore | NuGet | dotnet add package QPay.AspNetCore |
| Flutter | qpay_flutter | pub.dev | flutter pub add qpay_flutter |
| FastAPI | fastapi-qpay | PyPI | pip install fastapi-qpay |
See the Framework Packages documentation for setup guides and usage details.
CMS Plugins
Drop-in payment plugins for popular e-commerce and CMS platforms. These plugins integrate directly with the QPay V2 API — no SDK dependency required.
| Platform | Plugin | GitHub | Marketplace |
|---|---|---|---|
| WooCommerce | qpay-woocommerce | qpay-woocommerce | WordPress.org (submitted) |
| Shopify | qpay-shopify | qpay-shopify | Shopify App Store (pending) |
| OpenCart | qpay-opencart | qpay-opencart | OpenCart Marketplace (pending) |
| Magento | qpay-magento | qpay-magento | Adobe Commerce (in review) |
| PrestaShop | qpay-prestashop | qpay-prestashop | GitHub |
| WordPress | qpay-wordpress | qpay-wordpress | GitHub |
| Odoo | qpay-odoo | qpay-odoo | GitHub |
See the CMS Plugins documentation for installation and configuration guides.
Quick Links
| Section | Description |
|---|---|
| Getting Started | Step-by-step guide from zero to first payment |
| SDKs | Per-language SDK documentation with full API reference |
| Frameworks | Framework-specific integration packages |
| CMS Plugins | E-commerce platform plugins |
| Examples | Full-stack payment flow examples (Express, Go, FastAPI, Laravel, Django) |
| API Reference | QPay V2 endpoint reference (auth, invoices, payments, ebarimt) |
| Error Codes | Comprehensive error code reference and troubleshooting |
| Stats | Real-time download and star statistics |
API Environments
| Environment | Base URL | Purpose |
|---|---|---|
| Production | https://merchant.qpay.mn | Live payments with real money |
| Sandbox | https://merchant-sandbox.qpay.mn | Testing and development |
Open Source
All SDKs, framework packages, and CMS plugins are open source under the MIT license. Contributions are welcome.
- GitHub Organization: github.com/qpay-sdk
- Documentation: github.com/qpay-sdk/qpay-docs