![]() |
VOOZH | about |
dotnet add package VantagePay.SDK --version 1.2026.602.6
NuGet\Install-Package VantagePay.SDK -Version 1.2026.602.6
<PackageReference Include="VantagePay.SDK" Version="1.2026.602.6" />
<PackageVersion Include="VantagePay.SDK" Version="1.2026.602.6" />Directory.Packages.props
<PackageReference Include="VantagePay.SDK" />Project file
paket add VantagePay.SDK --version 1.2026.602.6
#r "nuget: VantagePay.SDK, 1.2026.602.6"
#:package VantagePay.SDK@1.2026.602.6
#addin nuget:?package=VantagePay.SDK&version=1.2026.602.6Install as a Cake Addin
#tool nuget:?package=VantagePay.SDK&version=1.2026.602.6Install as a Cake Tool
VantagePay.SDK is the official C# client SDK for integrating with VantagePay APIs.
It provides:
The TypeScript SDK on NPM covers client capabilities only. This .NET SDK includes both client and admin capabilities.
dotnet add package VantagePay.SDK
Or with NuGet Package Manager Console:
Install-Package VantagePay.SDK
VantagePay.SDK currently targets:
.NET 8 (net8.0).NET 9 (net9.0).NET 10 (net10.0)Use the client that matches your integration model:
| Client | Intended use | Authentication model |
|---|---|---|
VantagePayClient |
Client-facing integrations (web/mobile apps, POS apps, merchant/consumer flows) | Access/refresh token session (LoginAsync) |
VantagePayAdminClient |
Trusted server-side admin integrations | API key (apiKey) |
VantagePayClient (client-facing)using VantagePay.SDK;
using VantagePay.Models.Lookups;
var client = new VantagePayClient("https://sandbox-api.vantagepay.dev");
await client.Authentication.LoginAsync("233548306110", "Password123!");
var currencies = await client.Lookups.GetCurrenciesAsync();
var summary = await client.Reports.GetTransactionSummaryAsync(Currency.GHS);
VantagePayAdminClient (server-side)using VantagePay.SDK;
var adminClient = new VantagePayAdminClient(
"https://sandbox-api.vantagepay.dev",
apiKey: "your-admin-api-key");
var userReference = await adminClient.Users.CreateUserAsync("partner.user", "StrongPassword123!");
VantagePayClient:
new VantagePayClient(environmentUrl)new VantagePayClient(environmentUrl, loggerFactory)new VantagePayClient(environmentUrl, accessToken, refreshToken)new VantagePayClient(environmentUrl, accessToken, refreshToken, loggerFactory)VantagePayAdminClient:
new VantagePayAdminClient(environmentUrl, apiKey)new VantagePayAdminClient(environmentUrl, apiKey, loggerFactory)Pass an ILoggerFactory to integrate SDK logs into your logging pipeline.
using Microsoft.Extensions.Logging;
using VantagePay.SDK;
using var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
var client = new VantagePayClient(
"https://sandbox-api.vantagepay.dev",
accessToken: null,
refreshToken: null,
loggerFactory: loggerFactory);
refreshToken.var token = await client.Authentication.LoginAsync("233548306110", "Password123!");
// Tokens are persisted in-memory on the client instance.
string? accessToken = client.ApiTokens.AccessToken;
string? refreshToken = client.ApiTokens.RefreshToken;
var client = new VantagePayClient(
"https://sandbox-api.vantagepay.dev",
accessToken: storedAccessToken,
refreshToken: storedRefreshToken);
bool loggedIn = client.Authentication.IsLoggedIn();
await client.Authentication.RefreshAsync();
await client.Authentication.LogoutAsync();
var userReference = client.Authentication.GetCurrentUserReference();
var merchantReference = client.Authentication.GetCurrentMerchantReference();
var consumerReference = client.Authentication.GetCurrentConsumerReference();
var terminalReference = client.Authentication.GetCurrentTerminalReference();
var emailAddress = client.Authentication.GetCurrentEmailAddress();
SDK operations throw ApiException derivatives for API failures.
Primary exception types:
ApiValidationException (400)ApiAuthorizationException (401)ApiForbiddenException (403)ApiNotFoundException (404)ApiException (other status codes)using VantagePay.SDK.Exceptions;
try
{
await client.Authentication.LoginAsync("user", "wrong-password");
}
catch (ApiAuthorizationException ex)
{
Console.WriteLine($"Unauthorized ({ex.StatusCode}): {ex.Message}");
if (ex.ErrorResponse?.MustChangePassword == true)
{
await client.Authentication.ChangePasswordAsync("OldPassword", "NewPassword123!");
}
if (ex.ErrorResponse?.MustValidatePhoneNumber == true ||
ex.ErrorResponse?.MustValidateEmailAddress == true)
{
await client.Authentication.ResendOtpAsync();
await client.Authentication.ValidateOtpAsync("123456");
}
}
catch (ApiValidationException ex)
{
Console.WriteLine($"Validation error ({ex.StatusCode}): {ex.Message}");
}
catch (ApiException ex)
{
Console.WriteLine($"API error ({ex.StatusCode}): {ex.Message}");
throw;
}
Note:
Get* methods return null when an entity is not found.CancellationToken is supported across all async methods.VantagePayClient modules| Module | Purpose |
|---|---|
Authentication |
Login/logout, refresh, OTP, password, face/liveness checks |
Lookups |
Countries, currencies, languages, banks, wallet operators, categories, product types, address resolution |
Consumers |
Consumer profile operations, files, limits, debit orders, broadcast listener |
Merchants |
Merchant profile operations, OTP verify, terminal setup/config, QR code retrieval, telemetry, broadcast listener |
Products |
Global product catalog browsing and merchant product management, broadcast listener |
Payments |
Payment and refund workflows, tokenization, status monitoring, interactive payment signals |
Notifications |
In-app message retrieval and lifecycle |
QrCodes |
Dynamic QR generation and QR validation |
Reports |
Recent transactions, summaries, daily and detailed transaction reporting |
System |
Health ping |
// Lookups
var banks = await client.Lookups.GetBanksAsync();
// Consumer profile
var consumer = await client.Consumers.GetConsumerAsync();
// Merchant profile
var merchant = await client.Merchants.GetMerchantAsync();
// Products
var productTypes = await client.Products.GetActiveProductTypesAsync();
// Notifications
var messages = await client.Notifications.GetMessagesAsync();
// Reports
var recent = await client.Reports.GetRecentTransactionsAsync(limit: 10, successfulOnly: true);
// Health
bool isOnline = await client.System.PingAsync();
Payments supports both request/response and event-driven processing.
using System.Collections.Generic;
using VantagePay.Models.Lookups;
using VantagePay.Models.Payments;
using VantagePay.Models.Payments.Requests;
var payment = new PaymentRequest
{
YourReference = "ORDER-1001",
PaymentSources = new PaymentSources
{
MobileWallets = new List<MobileWalletSource>
{
new MobileWalletSource
{
MobileWalletOperator = MobileWalletOperator.MTN,
Msisdn = "233555666112",
AmountInCents = 5000,
Currency = Currency.GHS,
}
}
},
PaymentDestinations = new PaymentDestinations
{
Merchants = new List<MerchantDestination>
{
new MerchantDestination
{
MerchantReference = "merchant-reference",
AmountInCents = 5000,
Currency = Currency.GHS,
PaymentType = MerchantPaymentType.BuyingGoods,
}
}
}
};
var initialStatus = await client.Payments.PayAsync(payment);
using VantagePay.Models.Lookups;
using VantagePay.Models.Common;
client.Payments.OnPaymentStatusUpdate = status =>
{
Console.WriteLine($"{status.PaymentReference}: {status.PercentageComplete}%");
};
client.Payments.OnPaymentComplete = status =>
{
Console.WriteLine($"Payment complete: {status.PaymentReference}");
};
client.Payments.OnRequiresPin = data =>
{
var pin = "1234";
_ = client.Payments.SubmitPinCodeAsync(data.TransactionReference, pin);
};
client.Payments.OnRequiresConfirmation = data =>
{
_ = client.Payments.SubmitConfirmationAsync(data.TransactionReference, confirm: true);
};
client.Payments.OnRequiresAddress = data =>
{
var address = new Address
{
AddressType = AddressType.Billing,
AddressLine1 = "10 Main Road",
City = "Johannesburg",
CountryIsoCode = Country.ZAF,
PostalCode = "2196",
};
_ = client.Payments.SubmitAddressAsync(data.TransactionReference, address);
};
client.Payments.OnRequires3DSecure = data =>
{
Console.WriteLine($"Open 3DS URL: {data.ThreeDSecureUrl}");
};
client.Payments.OnComplete3DSecure = () =>
{
Console.WriteLine("3DS flow completed");
};
var finalStatus = await client.Payments.WaitForPaymentCompleteAsync();
client.Consumers.OnConsumerUpdate = () =>
{
Console.WriteLine("Consumer profile updated");
};
client.Merchants.OnMerchantUpdate = () =>
{
Console.WriteLine("Merchant profile updated");
};
client.Products.OnProductUpdate = () =>
{
Console.WriteLine("Product catalog updated");
};
await client.Consumers.StartConsumerBroadcastListenerAsync();
await client.Merchants.StartMerchantBroadcastListenerAsync();
await client.Products.StartProductBroadcastListenerAsync();
await client.Payments.StartPaymentStatusCheckingAsync(); // listen for external incoming payment
await client.Payments.StopPaymentStatusCheckingAsync(); // stop all
using VantagePay.Models.Lookups;
using VantagePay.Models.Tokens;
var cardToken = await client.Payments.CreateCardTokenAsync(new CardRequest
{
CardNumber = "4111111111111111",
NameOnCard = "Jane Doe",
ExpiryMonth = Month.March,
ExpiryYear = 2027,
});
if (cardToken?.Token is not null)
{
await client.Payments.ActivateCardTokenAsync(cardToken.Token);
}
var receipt = await client.Payments.GetPaymentReceiptAsync(paymentReference);
await client.Payments.SendEmailNotificationAsync(paymentReference.ToString(), "customer@example.com");
Use VantagePayAdminClient with API key authorization for administrative workflows.
| Module | Purpose |
|---|---|
Authentication |
Generate consumer/merchant tokens, reset passwords, OTP send/validate, lock/unlock/logout user |
Consumers |
Manage consumers, files, and KYC state |
Merchants |
Manage merchants, files, KYB state, business hierarchy, device lookup |
Notifications |
Manage templates and send targeted merchant/consumer in-app messages |
Products |
Assignable products, merchant product management, apply product catalogs |
Payments |
Admin payment/refund initiation and status/receipt operations (IPaymentsAdminApi) |
Users |
Create and deactivate users |
// Generate a merchant-scoped token pair from the server side.
var merchantToken = await adminClient.Authentication.GenerateMerchantTokenAsync(merchantReference);
// Reset a user password.
await adminClient.Authentication.ResetPasswordAsync("partner.user", "NewStrongPassword123!");
// Create a targeted merchant message.
using VantagePay.Models.Notifications;
using VantagePay.Models.Notifications.Requests;
await adminClient.Notifications.CreateMerchantMessageAsync(
new CreateMessageRequest
{
MessageType = MessageType.Information,
MessageTarget = MessageTarget.Portal,
MessagePlacement = MessagePlacement.Dashboard,
Header = "Planned Maintenance",
Body = "Service window starts at 22:00 UTC.",
VisibleUntilDate = DateTimeOffset.UtcNow.AddDays(7),
},
merchantReference);
If migrating from ZGA.Core.Web.Api.Client, apply these namespace/package updates:
ZGA.Core.Web.Api.Client with VantagePay.SDKZGA.Core.Models with VantagePay.Models| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2026.602.6 | 117 | 6/2/2026 |
| 1.2026.505.3 | 119 | 5/8/2026 |
| 1.2026.313.1 | 134 | 3/12/2026 |
| 1.2026.218.5 | 155 | 2/18/2026 |
| 1.2026.206.11 | 233 | 2/10/2026 |
| 1.2026.129.6 | 125 | 1/29/2026 |
| 1.2025.1211.5 | 471 | 12/11/2025 |
| 1.2025.1119.3 | 463 | 11/19/2025 |
| 1.2025.1112.10 | 340 | 11/12/2025 |
| 1.2025.1015.3 | 270 | 10/15/2025 |
| 1.2025.1006.5 | 272 | 10/6/2025 |
| 1.2025.829.3 | 294 | 8/29/2025 |
| 1.2025.814.3 | 243 | 8/14/2025 |
| 1.2025.701.3 | 252 | 7/8/2025 |
| 1.2025.604.3 | 324 | 6/4/2025 |
| 1.2025.516.5 | 341 | 5/19/2025 |
| 1.2025.410.2 | 323 | 4/10/2025 |
| 1.2025.325.5 | 581 | 3/25/2025 |
- Target .NET 10