WistfareWistfare Docs

Fees

Read the fee setup for a business, list fee rules, and calculate fees before you charge or disburse.

Fee inspection matters for both developer ergonomics and customer transparency. The SDKs let you read the effective fee config, list all fee rules for a business, and calculate fees before you create a collection or a disbursement.

Install

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

Get the Fees Client

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

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

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

wf = Wistfare(api_key="wf_live_xxx")

fees = wf.payments
import (
  "os"

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

client := core.New(os.Getenv("WISTFARE_API_KEY"))
fees := 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 fees = PaymentsClient(wf);
use wistfare::Wistfare;

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

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

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

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

var fees = new PaymentsClient(client);

Get the Effective Fee Config

Use this when you want the current fee rule for a business and transaction type.

const feeConfig = await fees.getFeeConfig('biz_123', 'collection');
fee_config = fees.get_fee_config("biz_123", "collection")
feeConfig, err := fees.GetFeeConfig(ctx, "biz_123", "collection")
final feeConfig = await fees.getFeeConfig('biz_123', 'collection');
var feeConfig = await fees.GetFeeConfigAsync("biz_123", "collection");
curl -X GET "https://api-production.wistfare.com/v1/fees/biz_123?transaction_type=collection" \
  -H "X-API-Key: wf_live_xxx"

List All Fee Rules

Use this when your business has multiple overrides or when you need to build an operator-facing fee screen.

const feeConfigs = await fees.listFeeConfigs('biz_123', {
  page: 1,
  perPage: 20,
});
fee_configs = fees.list_fee_configs("biz_123", page=1)
feeConfigs, err := fees.ListFeeConfigs(ctx, "biz_123", &core.PaginationParams{
  Page:    1,
  PerPage: 20,
})
final feeConfigs = await fees.listFeeConfigs(
  'biz_123',
  page: 1,
  perPage: 20,
);
var feeConfigs = await fees.ListFeeConfigsAsync(
    "biz_123",
    new PaginationParams
    {
        Page = 1,
        PerPage = 20,
    });
curl -X GET "https://api-production.wistfare.com/v1/fees?business_id=biz_123&page=1&perPage=20" \
  -H "X-API-Key: wf_live_xxx"

On this page