Choose a Bayarcash SDK
Bayarcash publishes official SDKs for eight languages and packages for Laravel and Django. Each one handles the base URL, your Personal Access Token, request checksums and callback verification, so you write less code. All of them are open source at github.com/bayarcash.
Language SDKs
Section titled “Language SDKs”Install the SDK for your language with its package manager:
| Language | Package | Install | Needs | Source |
|---|---|---|---|---|
| PHP | bayarcash/php-sdk |
composer require bayarcash/php-sdk |
PHP 7.4 or newer | php-sdk |
| Node.js and TypeScript | bayarcash |
npm install bayarcash |
Node.js 18 or newer | node-sdk |
| Python | bayarcash |
pip install bayarcash |
Python 3.8 or newer | python-sdk |
| Go | github.com/bayarcash/go-sdk |
go get github.com/bayarcash/go-sdk |
Go 1.21 or newer | go-sdk |
| C# and .NET | Bayarcash |
dotnet add package Bayarcash |
.NET Standard 2.0 or newer | dotnet-sdk |
| Dart and Flutter | bayarcash |
dart pub add bayarcash |
Dart 2.17 or newer | dart-sdk |
| Ruby | bayarcash |
gem install bayarcash |
Ruby 2.7 or newer | ruby-sdk |
| Rust | bayarcash |
cargo add bayarcash |
Rust 1.75 or newer | rust-sdk |
Minimum versions are as at the time of writing. Each repository’s README has the current requirements, a full guide and examples.
Framework packages
Section titled “Framework packages”If your app runs on Laravel or Django, use the framework package instead of the plain SDK. It adds configuration, ready-made callback and return routes that verify the checksum for you, optional database records and scheduled reconciliation.
| Framework | Package | Install | Needs | Source |
|---|---|---|---|---|
| Laravel | bayarcash/laravel |
composer require bayarcash/laravel |
PHP 8.1 or newer, Laravel 10 to 12 | laravel |
| Django | django-bayarcash |
pip install django-bayarcash |
Python 3.8 or newer, Django 3.2 to 5 | django |
Both packages always use API v3.
Switch the SDK to API v3
Section titled “Switch the SDK to API v3”The language SDKs support API v2 and v3, and start on v2. API v2 is deprecated, so switch to v3 as soon as you create the client. Some methods, such as searching transactions, only work on v3.
| SDK | Switch to v3 | Use the sandbox |
|---|---|---|
| PHP | $bayarcash->setApiVersion('v3') |
$bayarcash->useSandbox() |
| Node.js | bayarcash.setApiVersion('v3') |
bayarcash.useSandbox() |
| Python | bayarcash.set_api_version("v3") |
bayarcash.use_sandbox() |
| Go | bayarcash.WithAPIVersion("v3") option |
bayarcash.WithSandbox(true) option |
| .NET | bayarcash.SetApiVersion("v3") |
bayarcash.UseSandbox() |
| Dart | bayarcash.setApiVersion('v3') |
bayarcash.useSandbox() |
| Ruby | bayarcash.set_api_version("v3") |
bayarcash.use_sandbox |
| Rust | .set_api_version(ApiVersion::V3) |
.use_sandbox() |
Remove the sandbox call in production. For a full walkthrough in PHP, see Accept payments with the PHP SDK.
No-code option
Section titled “No-code option”To use Bayarcash in automated workflows without writing code, see Use Bayarcash in n8n.
- Keep your token and secret key in environment variables. Every SDK README uses placeholders such as
YOUR_API_TOKEN; never commit real keys to your repository. - Pin the SDK version in your project. Your package manager’s lock file stops an update from changing behaviour between deploys. Read the SDK’s changelog before you upgrade.
Common issues
I installed the SDK but a method says it is only available for API version v3. Why?
Most SDKs start on API v2. Switch the client to v3 before you make any request, for example setApiVersion('v3') in PHP. The Laravel and Django packages are already set to v3.
Which SDK should I pick if my language is not listed?
Call the REST API directly. Send your Personal Access Token as a bearer token and follow api-reference.bayarcash.com. See Build on the Bayarcash API.
Was this article helpful?
Thanks for your feedback.
Sorry this didn't help. WhatsApp us and we'll sort it out with you.

