About · Requirements · Installation · Getting started · Server-side use only · Testing · Support · Contribute
Buckaroo is a Dutch Payment Service Provider. More than 54,000 organisations rely on the Buckaroo platform to process their payments, subscriptions and unpaid invoices.
This is Buckaroo's official Node SDK: a modern, open source library that connects a JavaScript or TypeScript application to the Buckaroo API. It ships CommonJS and ES module builds along with TypeScript declarations, so it works in either module system without extra configuration.
Full SDK documentation on docs.buckaroo.io, and the API reference for request parameters and service codes.
| Requirement | Supported versions |
|---|---|
| Node.js | 6.14 or higher |
You also need a Buckaroo account. Don't have one yet? Request an account.
npm install @buckaroo/buckaroo_sdkOr with yarn:
yarn add @buckaroo/buckaroo_sdkYou can find your Store key and Secret key under API credentials in Buckaroo Plaza. Set mode to TEST while developing and to LIVE in production.
import Buckaroo from '@buckaroo/buckaroo_sdk';
const buckarooClient = Buckaroo.InitializeClient(
{
websiteKey: 'YOUR_STORE_KEY',
secretKey: 'YOUR_SECRET_KEY',
},
{
mode: 'TEST', // or 'LIVE'
currency: 'EUR',
returnURL: 'https://example.com/return',
pushURL: 'https://example.com/push',
}
);Note
The websiteKey option takes your Store key. The Store key was previously called the Website key, and the option name has been kept for backwards compatibility.
Tip
Keep your Secret key out of version control. Load both keys from environment variables instead — the repository ships an .env.example to start from.
Every payment method takes a slightly different payload. This example charges a Mastercard:
const payment = await buckarooClient
.method('mastercard')
.pay({
amountDebit: 100,
})
.request();Swap mastercard for any other service code to use a different payment method. Service codes and their parameters are listed in the API reference.
Once a transaction exists you can query it on demand:
const transaction = buckarooClient.transaction(payment.getTransactionKey());
await transaction.status(); // transaction status
await transaction.refundInfo(); // refund info
await transaction.cancelInfo(); // cancellation infoMore runnable examples are in example/.
Warning
Use this library from your server only. Never bundle it into a website or mobile app.
This library is written in JavaScript, so it is technically possible to include it in front-end code — but doing so exposes your Secret key to everyone who loads the page. Anyone holding that key can act on your account's behalf.
In the intended setup, your server holds the Secret key and calls the Buckaroo API through this SDK. Nothing sensitive reaches the browser.
npm install
npm testTests run with Jest. Formatting is handled by Prettier:
npm run prettierTests that talk to the Buckaroo test environment need credentials, so copy .env.example to .env and fill in your test Store key and Secret key first.
Having trouble? Work through this list before reaching out:
- Check the SDK documentation and the API reference.
- Confirm you are on the latest release.
- Reproduce the issue with
mode: 'TEST'and inspect the full response, including the status subcode and message. - Verify that your push URL is reachable from outside your network. Buckaroo sends push messages from fixed IP addresses and ports, so make sure these are on your allow list. See push messages for the current list.
Still stuck? Contact us and include your Node.js version, SDK version, the service and action you called, the error message and the transaction key.
- Bug reports and feature requests: open an issue
- Technical support: support@buckaroo.nl
- Phone: +31 (0)30 711 50 50
- Gateway status: status.buckaroo.io
We really appreciate it when developers help improve the Buckaroo SDKs. Please read our Contribution Guidelines before opening a pull request, and target the master branch.
Found a security issue? Please report it privately to support@buckaroo.nl instead of opening a public issue.
We follow semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR — breaking changes that require additional testing and caution.
- MINOR — new functionality with limited impact.
- PATCH — bug fixes and hotfixes only.
All changes are documented in the changelog and on the releases page.
This SDK is open source software licensed under the MIT license.
Made with care by Buckaroo.
This document is subject to change; typos and language errors are possible.