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 USD collection account for a customer
await swervpay.collection.create({
customer_id: "user",
currency: "USD",
merchant_name: "Ada Okafor",
amount: 0,
type: "DEFAULT",
additional_information: {
account_type: "INDIVIDUAL",
nin: "12345678901",
tax_number: "12345678901",
date_of_birth: "1994-04-12",
employment_status: "EMPLOYED",
account_designation: "PERSONAL",
income_band: "UNDER_10000",
source_of_income: "SALARY",
address: {
street: "12 Admiralty Way",
city: "Lagos",
state: "Lagos",
country: "Nigeria",
zip_code: "100001"
},
document: {
type: "NIN",
number: "12345678901",
issue_date: "2020-01-01",
expiry_date: "2030-01-01",
urls: ["https://example.com/document-front.jpg"]
},
utility_bill: "https://example.com/utility-bill.pdf",
bank_statement: "https://example.com/bank-statement.pdf"
}
})
// Create a new payout
await swervpay.payout.create({
bank_code: "user",
account_number: "user",
amount: "user",
currency: "NGN",
reference: "user",
narration: "user"
})