BeelineNet.LeadGenerator 0.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package BeelineNet.LeadGenerator --version 0.1.1
                    
NuGet\Install-Package BeelineNet.LeadGenerator -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BeelineNet.LeadGenerator" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BeelineNet.LeadGenerator" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="BeelineNet.LeadGenerator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BeelineNet.LeadGenerator --version 0.1.1
                    
#r "nuget: BeelineNet.LeadGenerator, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BeelineNet.LeadGenerator@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BeelineNet.LeadGenerator&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=BeelineNet.LeadGenerator&version=0.1.1
                    
Install as a Cake Tool

<table> <tr> <td width="150" align="center" valign="middle"> <img src="https://raw.githubusercontent.com/ai-iskuzhin/BeelineNet.LeadGenerator/main/assets/logo.png" width="120" alt="BeelineNet.LeadGenerator logo" /> </td> <td valign="middle"> <h1>BeelineNet.LeadGenerator</h1> <p>A System.Text.Json-native .NET client for the <b>beeline B2B Lead Generator</b> partner API — submit leads as a beeline advertising agent, search/poll their status, read the product catalogue, and upload product template files.</p> <p> <a href="https://www.nuget.org/packages/BeelineNet.LeadGenerator"><img src="https://img.shields.io/nuget/v/BeelineNet.LeadGenerator?logo=nuget&style=flat-square" alt="NuGet" /></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License" /></a> <img src="https://img.shields.io/badge/target-net8.0-512BD4?logo=dotnet&style=flat-square" alt="Target" /> </p> </td> </tr> </table>

The client covers the partner surface (/external/*): create a lead, search leads, list products, and upload a product template. Built from Beeline's partner API spec (PDF v1.1.9 + OpenAPI 3.0.1), which is proprietary and not redistributed here. Part of the BeelineNet SDK family.

Authentication — mutual TLS

The partner gateway authenticates with a client certificate (mTLS), not an API key or token. During onboarding you generate a private key + CSR and receive a signed certificate; the endpoint is also IP-allowlisted to the server whose IP you declared — calls only succeed from that host. A bare .crt (public certificate) cannot authenticate; you need the certificate and its private key.

# smoke test from the allowlisted server:
curl -v --cert ./client_crt.pem --key ./client_key.pem \
  https://api-partner.beeline.ru/leadgenerator-lead-api/v1/external/offers

Installation

dotnet add package BeelineNet.LeadGenerator

Quick start (dependency injection)

using BeelineNet.LeadGenerator;
using Microsoft.Extensions.DependencyInjection;

services.AddBeelineLeadGenerator(o =>
{
    o.ClientCertificate = BeelineCertificate.FromPemFiles("client_crt.pem", "client_key.pem");
    o.AgreementNumber   = "ПМ999999"; // your partner agreement — used as the default on every call
});

Then inject IBeelineLeadGeneratorClient:

using BeelineNet.LeadGenerator.Models;
using BeelineNet.LeadGenerator.Requests;

public sealed class LeadForwarder(IBeelineLeadGeneratorClient beeline)
{
    public async Task<string> ForwardAsync(string phone, CancellationToken ct)
    {
        var lead = await beeline.CreateLeadAsync(new CreateLeadRequest
        {
            Offers  = ["143"],                                    // product ids from GetOffersAsync
            Contact = new Contact("Иванов Василий", BeelineFormats.NormalizePhone(phone)),
            Inn     = "7727563778",
            Comment = "Interested via our B2B ad",
        }, ct);

        return lead.Id; // lead.LifecycleStatus.Id → LeadStatuses.NewLead, etc.
    }
}

Standalone (no DI)

using var client = BeelineLeadGeneratorClient.Create(new BeelineClientOptions
{
    ClientCertificate = BeelineCertificate.FromPfx("partner.pfx", "password"),
    AgreementNumber   = "ПМ999999",
});

var offers = await client.GetOffersAsync();

API surface

Method Endpoint Purpose
CreateLeadAsync POST /external/leads Submit a lead
SearchLeadsAsync POST /external/leads/search Search leads / poll status (paged)
GetOffersAsync GET /external/offers Product catalogue
UploadOfferAttachmentAsync POST /external/offers/{id}/attachment Upload a product template file (v1.1.9+)
  • Statuses are an open string set — compare lead.LifecycleStatus.Id against LeadStatuses.* (NewLead, Processed, Rejected, Success, …). The API has been seen returning ids outside its own documented list (e.g. "NEW CASE"), so unknown values are preserved, not rejected.
  • Product connection type is ConnectionTypes.Mobile / ConnectionTypes.Fixed (string constants).
  • Formats: Contact.Phone must be 10 national digits — use BeelineFormats.NormalizePhone; Inn is 10 or 12 digits — check with BeelineFormats.IsValidInn.

Errors

Non-success responses throw BeelineApiException with StatusCode, the parsed Error (ErrorCode, TraceId, …), and the raw ResponseBody. Quote TraceId to support (beelego@beeline.ru).

Partner onboarding status

Verified against production from the whitelisted server on 2026-08-27:

  • mTLS works — the client certificate authenticates. The client must present the full chain (leaf + Vimpelcom InternalCA G3); leaf-only is rejected with unknown ca. Load via BeelineCertificate.FromPfx(...) so the chain is sent.
  • Subscription pending — all three live endpoints return 403 900908 ("API Subscription validation failed"). The certificate is recognised but not yet subscribed to the Lead API on Beeline's gateway; this is a Beeline-side activation step (contact beelego@beeline.ru).
  • Attachment endpoint not deployed — the gateway runs the OpenAPI v1.1.0 surface (3 paths); POST /external/offers/{id}/attachment (PDF v1.1.9) returns 404 until Beeline upgrades.
  • The endpoint is IP-allowlisted to the server declared at onboarding — calls only work from there.

License

MIT — see LICENSE.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.2 107 8/27/2026
0.1.1 116 8/27/2026
0.1.0 103 8/27/2026