WistfareWistfare Docs

Quick Start

Install the SDK, create a client, and make your first Wistfare API call.

This is the shortest path from zero to a working Wistfare integration.

1. Install the SDK

npm install @wistfare/core @wistfare/payments
pip install wistfare
go get github.com/wistfare/wistfare-go
dependencies:
  wistfare_core: ^0.1.0
  wistfare_payments: ^0.1.0
cargo add wistfare
dependencies: [
  .package(path: "../sdks/swift")
]
implementation("com.wistfare:sdk:0.1.0")
dotnet add package Wistfare.Core
dotnet add package Wistfare.Payments

2. Create a Client

import { Wistfare } from '@wistfare/core';
import { PaymentsClient } from '@wistfare/payments';

const wf = new Wistfare({
  apiKey: process.env.WISTFARE_API_KEY!,
});

const payments = new PaymentsClient(wf);
from wistfare import Wistfare

wf = Wistfare(api_key="wf_live_xxx")
payments = wf.payments
import (
  "os"

  "github.com/wistfare/wistfare-go/core"
  "github.com/wistfare/wistfare-go/payments"
)

client := core.New(os.Getenv("WISTFARE_API_KEY"))
paymentsClient := payments.New(client)
import 'package:wistfare_core/wistfare_core.dart';
import 'package:wistfare_payments/wistfare_payments.dart';

final wf = Wistfare(apiKey: 'wf_live_xxx');
final payments = PaymentsClient(wf);
use wistfare::Wistfare;

let client = Wistfare::new("wf_live_xxx")?;
let payments = client.payments();
import Wistfare

let client = try Wistfare(apiKey: "wf_live_xxx")
let payments = client.payments
import com.wistfare.sdk.Wistfare
import com.wistfare.sdk.WistfareConfig

val client = Wistfare(WistfareConfig(apiKey = "wf_live_xxx"))
val payments = client.payments
using Wistfare.Core;
using Wistfare.Payments;

var client = new WistfareClient(new WistfareOptions
{
    ApiKey = Environment.GetEnvironmentVariable("WISTFARE_API_KEY")!,
});

var payments = new PaymentsClient(client);

3. Make a Payment Collection

const collection = await payments.initiateCollection({
  businessId: 'biz_123',
  walletId: 'wal_456',
  customerPhone: '250788000000',
  amount: '10000',
  paymentMethod: 'mtn',
  currency: 'RWF',
  referenceId: 'inv_1234',
  description: 'Invoice #1234',
});
collection = wf.payments.initiate_collection(
    business_id="biz_123",
    wallet_id="wal_456",
    customer_phone="250788000000",
    amount="10000",
    payment_method="mtn",
    currency="RWF",
    reference_id="inv_1234",
    description="Invoice #1234",
)
result, err := paymentsClient.InitiateCollection(ctx, &payments.InitiateCollectionParams{
  BusinessID:    "biz_123",
  WalletID:      "wal_456",
  CustomerPhone: "250788000000",
  Amount:        "10000",
  PaymentMethod: "mtn",
  Currency:      "RWF",
  ReferenceID:   "inv_1234",
  Description:   "Invoice #1234",
})
final collection = await payments.initiateCollection(
  InitiateCollectionParams(
    businessId: 'biz_123',
    walletId: 'wal_456',
    customerPhone: '250788000000',
    amount: '10000',
    paymentMethod: 'mtn',
    currency: 'RWF',
    referenceId: 'inv_1234',
    description: 'Invoice #1234',
  ),
);
use wistfare::InitiateCollectionParams;

let collection = payments
    .initiate_collection(InitiateCollectionParams {
        business_id: "biz_123".into(),
        wallet_id: Some("wal_456".into()),
        business_wallet_id: None,
        customer_phone: "250788000000".into(),
        amount: "10000".into(),
        payment_method: "mtn".into(),
        customer_name: None,
        description: Some("Invoice #1234".into()),
        currency: Some("RWF".into()),
        reference_id: Some("inv_1234".into()),
        payment_request_id: None,
    })
    .await?;
let collection = try await payments.initiateCollection(
  .init(
    businessId: "biz_123",
    walletId: "wal_456",
    customerPhone: "250788000000",
    amount: "10000",
    paymentMethod: "mtn",
    description: "Invoice #1234",
    currency: "RWF",
    referenceId: "inv_1234"
  )
)
val request = payments.initiateCollection(
    businessId = "biz_123",
    walletId = "wal_456",
    customerPhone = "250788000000",
    amount = "10000",
    paymentMethod = "mtn",
    currency = "RWF",
    referenceId = "inv_1234",
    description = "Invoice #1234",
)
var result = await payments.InitiateCollectionAsync(new InitiateCollectionParams
{
    BusinessId = "biz_123",
    WalletId = "wal_456",
    CustomerPhone = "250788000000",
    Amount = "10000",
    PaymentMethod = "mtn",
    Currency = "RWF",
    ReferenceId = "inv_1234",
    Description = "Invoice #1234",
});

Next Steps

On this page