DoliSharp 8.0.6

dotnet add package DoliSharp --version 8.0.6
                    
NuGet\Install-Package DoliSharp -Version 8.0.6
                    
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="DoliSharp" Version="8.0.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DoliSharp" Version="8.0.6" />
                    
Directory.Packages.props
<PackageReference Include="DoliSharp" />
                    
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 DoliSharp --version 8.0.6
                    
#r "nuget: DoliSharp, 8.0.6"
                    
#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 DoliSharp@8.0.6
                    
#: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=DoliSharp&version=8.0.6
                    
Install as a Cake Addin
#tool nuget:?package=DoliSharp&version=8.0.6
                    
Install as a Cake Tool

DoliSharp

.NET libraries for the Dolibarr REST API, plus an optional Shopify ↔ Dolibarr connector (orders via webhooks, stock sync).

Package Description
DoliSharp Typed HTTP client / SDK for Dolibarr (products, orders, third parties)
DoliSharp.Shopify MediatR webhook handlers and stock sync using ShopifySharp

Target framework: .NET 8

Features

DoliSharp

  • IProductService — list products, product stock
  • IOrderService — CRUD-ish order flow (create, validate, draft, invoice, deliver, reopen, delete)
  • IThirdPartyService — list / get / create / update third parties
  • Fluent filters (GetProductFilter, …) for Dolibarr query params and SQL filters
  • Newtonsoft-based serialization tuned for Dolibarr payloads
  • Results as HttpResponseResult<T> (wraps ErrorOr)

DoliSharp.Shopify

  • Webhook topics: orders/create, orders/updated, orders/cancelled
  • Maps Shopify customers/orders to Dolibarr third parties and orders
  • ISyncStockService — push Dolibarr warehouse stock to Shopify inventory levels
  • FulfillShopifyOrderCommand — mark a Shopify order fulfilled (fulfillment orders)

Installation

dotnet add package DoliSharp
dotnet add package DoliSharp.Shopify   # optional connector

Or via PackageReference:

<ItemGroup>
  <PackageReference Include="DoliSharp" Version="0.1.0" />
  
  <PackageReference Include="DoliSharp.Shopify" Version="0.1.0" />
</ItemGroup>

Quick start — Dolibarr SDK

using DoliSharp;
using DoliSharp.Credentials;
using DoliSharp.Filters;
using Microsoft.Extensions.DependencyInjection;

var services = new ServiceCollection();

services.AddDoliSharp(new DolibarrCredentials(
    Url: "https://your-dolibarr.example.com",
    Token: "YOUR_DOLAPIKEY"
));

var provider = services.BuildServiceProvider();
var products = provider.GetRequiredService<DoliSharp.Services.Products.IProductService>();

var result = await products.GetProducts(
    new GetProductFilter().WithLimit(50).FilterOnProductRef("SKU-001", "SKU-002")
);

if (result.IsError)
{
    // result.Errors / result.FirstError
    return;
}

foreach (var product in result.Value)
{
    Console.WriteLine($"{product.Ref} — {product.Label}");
}

You can also construct services directly:

var orders = new OrderService(new DolibarrCredentials(url, token));
var created = await orders.CreateOrderAsync(order);

Quick start — Shopify connector

Requires DoliSharp registered as well (order / product / third-party services).

services.AddDoliSharp(new DolibarrCredentials(dolibarrUrl, dolibarrToken));
services.AddShopifyConnector(shopifyUrl: "https://your-shop.myshopify.com", shopAccessToken: "shpat_...");

Process a webhook

Forward the raw body and Shopify headers to MediatR:

using DoliSharp.Shopify.Webhooks.Commands;
using DoliSharp.Shopify.Webhooks.Domain;
using MediatR;

var webhook = new WebhookRequest(
    Id: someId,
    Body: rawJsonBody,
    Headers: headerDictionary // includes X-Shopify-Topic, etc.
);

ErrorOr<Success> outcome = await sender.Send(new ProcessShopifyWebhookCommand(webhook));

Supported topics (see ShopifyWebhookTopics):

Topic Behavior
orders/create Ensure third party exists, create & validate Dolibarr order
orders/updated Update matching Dolibarr order (lines / third party; status unchanged)
orders/cancelled Delete / cancel matching Dolibarr order

Sync stock Dolibarr → Shopify

using DoliSharp.Shopify.Stock;
using DoliSharp.Shopify.Stock.Abstractions;

var sync = provider.GetRequiredService<ISyncStockService>();

var request = new StockSyncRequest()
    .AddStockSyncWarehouse(dolibarWarehouseId: 1, shopifyWarehouseId: 123456789);

var movement = await sync.SynchroniseDolibarrWithShopifyAsync(request);

Solution layout

src/
  DoliSharp/                 # Dolibarr SDK  → PackageId: DoliSharp
  DoliSharp.Shopify/         # Shopify connector → PackageId: DoliSharp.Shopify
  DoliSharp.Tests/
  DoliSharp.Shopify.Tests/

Error handling

  • Prefer ErrorOr<T> / HttpResponseResult<T> over exceptions for expected failures.
  • Shared codes live in DoliSharp.Domain.DomainErrors and DoliSharp.Shopify.Domain.DomainErrors.
if (result.IsError)
    return result.FirstError.Description;

Development

dotnet restore
dotnet build
dotnet test

Format C# with CSharpier (config at repo root):

dotnet tool restore
dotnet tool run csharpier format src

License

Licensed under the Apache License 2.0.

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 (1)

Showing the top 1 NuGet packages that depend on DoliSharp:

Package Downloads
DoliSharp.Shopify

Shopify ↔ Dolibarr connector for DoliSharp (webhooks, orders, stock sync).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.6 120 9/12/2026
8.0.5 117 9/12/2026
8.0.4 112 9/12/2026
8.0.3 113 9/12/2026
8.0.2 119 9/1/2026
8.0.1 117 9/1/2026
8.0.0 158 8/13/2026
0.1.0 136 8/11/2026