Pg.Pulse
1.0.5
dotnet add package Pg.Pulse --version 1.0.5
NuGet\Install-Package Pg.Pulse -Version 1.0.5
<PackageReference Include="Pg.Pulse" Version="1.0.5" />
<PackageVersion Include="Pg.Pulse" Version="1.0.5" />
<PackageReference Include="Pg.Pulse" />
paket add Pg.Pulse --version 1.0.5
#r "nuget: Pg.Pulse, 1.0.5"
#:package Pg.Pulse@1.0.5
#addin nuget:?package=Pg.Pulse&version=1.0.5
#tool nuget:?package=Pg.Pulse&version=1.0.5
Pulse API SDK for .NET
The official .NET SDK for Protect Group's Pulse API - a comprehensive solution for managing refundable bookings, quotes, sales, and transactions in the hospitality and travel industries.
What is Pulse API?
Pulse API enables travel and hospitality businesses to offer flexible refund protection to their customers. With this SDK, you can:
- 💰 Create and manage refundable booking quotes
- 🎫 Process sales and bookings with refund protection
- 💳 Handle payments and transaction statuses
- 👥 Manage customer information
- 📅 Update event and travel dates
- 🔄 Cancel sales and individual items
Installation
Install via NuGet Package Manager:
Install-Package Pg.Pulse
Or using .NET CLI:
dotnet add package Pg.Pulse
Quick Start
1. Add Configuration
Add your Pulse API credentials to appsettings.json:
{
"Pulse": {
"Environment": "Test",
"Region": "Global",
"MemberVendorCode": "<<YourVendorCode>>",
"ClientId": "<<YourClientId>>",
"ClientSecret": "<<YourClientSecret>>"
}
}
2. Register the Service
In your Program.cs or Startup.cs:
using Pg.Pulse.Extensions;
builder.Services.AddPulseApiClient();
3. Use in Your Code
using Pg.Pulse;
using Pg.Pulse.Models.Quote.Request;
using Pg.Pulse.Models.Sale.Request;
public class BookingService
{
private readonly IPulseApiClient _pulseClient;
public BookingService(IPulseApiClient pulseClient)
{
_pulseClient = pulseClient;
}
public async Task<string> CreateProtectedBookingAsync(decimal amount, int guests)
{
// Create a quote
var quoteRequest = new QuoteRequest
{
CurrencyCode = "USD",
LanguageCode = "en",
TotalValue = amount,
EventTravelDateTime = DateTime.Now.AddMonths(3).ToString("yyyy-MM-ddTHH:mm:ss.ffffffzzz"),
NumberOfTickets = guests,
ReturnHtml = true
};
var quoteResponse = await _pulseClient.CreateQuoteAsync(quoteRequest);
// Create a sale
var saleRequest = new SaleRequest
{
QuoteId = quoteResponse.Data.QuoteId,
BookingReference = "ABC4567",
IsPaidInFull = true,
TransactionDate = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.ffffffzzz"),
Customers = new[]
{
new CustomerModel
{
FirstName = "John",
LastName = "Doe",
Email = "john.doe@example.com",
Telephone = "+11234567890"
}
},
Products = new[]
{
new SaleProduct
{
ProductId = 16,
Sold = true
}
}
};
var saleResponse = await _pulseClient.CreateSaleAsync(saleRequest);
return saleResponse.Data.SaleId;
}
}
Error Handling
All methods return response objects with Success property and detailed error information:
var response = await _pulseClient.CreateQuoteAsync(request);
if (!response.Success)
{
_logger.LogError("Quote creation failed: {Error}", response.Error?.Message);
// Handle error
return;
}
// Process successful response
var quoteId = response.Data.QuoteId;
API Reference
| Method | Description |
|---|---|
CreateQuoteAsync |
Create a new refundable booking quote |
GetQuoteAsync |
Retrieve an existing quote |
UpdateQuoteAsync |
Update quote details |
CreateSaleAsync |
Create a sale from a quote |
GetSaleAsync |
Retrieve sale information |
UpdateSaleAsync |
Update an existing sale |
HoldSaleAsync |
Put a sale on hold |
CancelSaleAsync |
Cancel an entire sale |
CancelSaleItemAsync |
Cancel a specific item |
UpdateTransactionStatusAsync |
Update transaction status |
UpdateTransactionItemStatusAsync |
Update item status |
AcceptPaymentAsync |
Record a payment |
UpdateCustomersAsync |
Update customer information |
UpdateEventDateAsync |
Change event/travel date |
Requirements
- .NET 8.0 or higher
- Valid Pulse API credentials (API Key and Member ID)
Support & Documentation
- If you need further assistance or have questions not covered in the documentation, please contact your assigned Integration Manager.
License
This project is licensed under a Proprietary License. Use of this package is permitted only for authorized partners who have received valid credentials from us.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
# Release Notes
## 1.0.5
- Updated date-related fields across request models from string to DateTimeOffset
## 1.0.4
- Added values array for quote request
## 1.0.3
- Added release notes support
## 1.0.1
- Bug Fixes
## 1.0.0
- Initial release