This guides demonstrate how to use Swervpay NodeJS SDK to integrate Swervpay into your NodeJS application.

Setup

Make sure you have create a Swervpay business and have your API keys ready. Don’t forget to check our recommended go live checklist.

Install the SDK

Install swervpay-node sdk into your new or existing NodeJS application using any of your favorite package manager.

Usage

NodeJS
import { SwervpayClient } from "@swervpaydev/sdk";

const config = {
    secretKey: "<SECRET_KEY>",
    businessId: "<BUSINESS_ID>"
}

const swervpay = new SwervpayClient(config);

// Create a new customer
await swervpay.customer.create({
    firstname: "user",
    lastname: "user",
    middlename: "user",
    country: "user",
    email: "[email protected]"
})

// Create a new card
await swervpay.card.create({
    customer_id: "user",
    amount: 10,
    currency: "USD",
    provider: "MASTERCARD",
    type: "DEFAULT"
})

// Create a new payout
await swervpay.payout.create({
    bank_code: "user",
    account_number: "user",
    amount: "user",
    currency: "NGN",
    reference: "user",
    narration: "user"
})

Here, we initialize the Swervpay client with our secret key and business id. Then we create a new customer, card and payout.

Next Steps

Other SDKs