Developer Tools
Server SDKs
In a nutshell
Install Paystack's official server SDKs for Node.js, Python and Ruby, and find community libraries for other languages.
Paystack's server SDKs call the Paystack API from your backend with your secret key. Use one to initialize and verify transactions, manage customers, send transfers and handle any other server-side call. If your language isn't listed, call the API with any HTTP client.
Keep your secret key on your server
Read your secret key from an environment variable or a secrets manager. Don't commit it to source control or ship it in frontend or mobile code. See API keys.
Copy linkOfficial SDKs
| SDK | Package | Repository |
|---|---|---|
| Node.js | @paystack/paystack-sdk | PaystackOSS/paystack-node |
| Python | paystack-sdk | PaystackOSS/paystack-python |
| Ruby | paystack-ruby | PaystackOSS/paystack-ruby |
Copy linkInstall
npm install @paystack/paystack-sdk
pip install paystack-sdk
gem install paystack-ruby
Copy linkInitialize a transaction
Each example reads your secret key from the PAYSTACK_SECRET_KEY environment variable and calls Initialize Transaction. The amount is in cents. Use your test secret key (sk_test_...) while you build.
const { Paystack } = require('@paystack/paystack-sdk');
const paystack = new Paystack(process.env.PAYSTACK_SECRET_KEY);
paystack.transaction
.initialize({ email: '[email protected]', amount: 20000 })
.then((response) => console.log(response.data.authorization_url))
.catch((error) => console.error(error));
import os
import paystack
paystack.api_key = os.environ['PAYSTACK_SECRET_KEY']
response = paystack.Transaction.initialize(email='[email protected]', amount=20000)
print(response)
require "paystack"
paystack = Paystack::Client.new(ENV.fetch("PAYSTACK_SECRET_KEY"))
result = paystack.transaction.initialize({ email: "[email protected]", amount: 20000 })
puts result.data[:authorization_url]
Send the customer to the returned authorization_url, or pass the access_code to InlineJS to complete the payment on your page. Then verify the payment on your server before you deliver value.
Each repository's README lists every resource and method the SDK supports.
Copy linkCommunity server libraries
Warning
Community maintainers own these libraries, not Paystack. If you have an issue with one, contact the maintainer or open an issue on its repository.
| Language | Library | Repository |
|---|---|---|
| .Net | Paystack .Net | adebisi-fa/paystack-dotnet |
| .Net | Paystack .Net SDK | developerslearnit/Paystack.Net.SDK |
| Erlang/OTP (rebar3) | Erl Paystack | abimbola/erlpaystack |
| Go | Paystack Go | rpip/paystack-go |
| Groovy/Grails | Paystack Grails | dubems/paystack-grails |
| Java | Paystack Java | SeunAdelekan/PaystackJava |
| NodeJS | Paystack | kehers/paystack |
| NodeJS | Paystack API | pariola/paystack |
| PHP | CakePHP Paystack | jtad009/cakephp-paystack |
| PHP | Cashier Paystack | wisdomanthoni/cashier-paystack |
| PHP | Laravel Paystack | unicodeveloper/laravel-paystack |
| PHP | Paystack PHP | perfectmak/paystack-php |
| PHP | Paystack | matscode/paystack |
| Python | Py Paystack | edwardpopoola/pypaystack |
| Python | Paystack | ojengwa/paystack |
| Python | Paystack Python | andela-sjames/paystack-python |
| Python | Python Paystack | Chibuzor-IN/python-paystack |
| Python | Py Paystack | frier17/pypaystack |
| R | Paystack | ebinabo/paystack |
| Ruby | Paystackr | ojengwa/paystackr |
| Ruby | Paystack Ruby | IkoroVictor/paystack-ruby |
| Ruby | Paystack Ruby API | samuel52/PaystackRubyApi |
| Yii | Yii 2 Paystack | smladeoye/yii2-paystack |
Copy linkCommunity client libraries
These wrap Paystack Popup or the mobile SDKs for frontend and mobile frameworks. They run on the customer's device, so use them with your public key only. For Flutter, Paystack maintains the official Flutter SDK.
| Framework | Library | Repository |
|---|---|---|
| Angular | Angular Paystack | toniton/angular-paystack |
| Angular | Angular 4 Paystack | ashinzekene/angular4-paystack |
| Cordova | Cordova Plugin Paystack | tolu360/Cordova-Plugin-Paystack |
| Cordova | Paystack Cordova V2 | mrfoh/paystackcordovav2 |
| Flutter | Paystack Flutter | mtellect/Flutter_Paystack |
| Flutter | Flutter Paystack | wilburt/flutter_paystack |
| NativeScript | NativeScript Paystack | jogboms/nativescript-paystack |
| React JS | React Paystack | iamraphson/react-paystack |
| React Native | React Native Paystack | tolu360/React-Native-Paystack |
| React Native | React Native Paystack Webview | just1and0/React-Native-Paystack-Webview |
| Vue JS | Vue Paystack | iamraphson/vue-paystack |
| Xamarin | PaystackInline Forms Plugin | Akinnagbe/PaystackInline.Forms.Plugin |