Nager.Moco 1.0.0-beta1

Prefix Reserved
This is a prerelease version of Nager.Moco.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Nager.Moco --version 1.0.0-beta1
                    
NuGet\Install-Package Nager.Moco -Version 1.0.0-beta1
                    
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="Nager.Moco" Version="1.0.0-beta1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nager.Moco" Version="1.0.0-beta1" />
                    
Directory.Packages.props
<PackageReference Include="Nager.Moco" />
                    
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 Nager.Moco --version 1.0.0-beta1
                    
#r "nuget: Nager.Moco, 1.0.0-beta1"
                    
#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 Nager.Moco@1.0.0-beta1
                    
#: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=Nager.Moco&version=1.0.0-beta1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Nager.Moco&version=1.0.0-beta1&prerelease
                    
Install as a Cake Tool

Nager.Moco

A lightweight .NET client for the MOCO API. This library simplifies the interaction with MOCO, allowing you to manage companies, invoices, and more directly from your C# applications.

Features

  • Simple authentication using API keys.
  • Manage Companies (List, Create, Delete).
  • Manage Invoices (Create, Send via Email).
  • Asynchronous implementation (Task-based).

Usage

Initialize the Client

To start using the API, you need your MOCO subdomain and an API key (Personal API Token).

using Nager.Moco;

var serviceProvider = new ServiceCollection().AddHttpClient().BuildServiceProvider();
var httpClientFactory = serviceProvider.GetRequiredService<IHttpClientFactory>();

var mocoClient = new MocoClient(httpClientFactory, "mycustomdomain", "my_api_key");

Examples

Working with Companies
using Nager.Moco.Models;

// Get all companies
var companies = await mocoClient.GetCompaniesAsync();

// Create a new company
var companyCreateRequest = new CompanyCreateRequest
{
    Name = "My Test Company",
    Currency = "EUR",
    CountryCode = "DE",
    VatIdentifier = "DE123456789"
};

var newCompany = await mocoClient.CreateCompanyAsync(companyCreateRequest);

// Delete a company
var isDeleted = await mocoClient.DeleteCompanyAsync(newCompany.Id);

Creating and Sending an Invoice
var invoiceCreateRequest = new InvoiceCreateRequest
{
    CustomerId = 12345, // ID of the company
    RecipientAddress = "Test Address 1b",
    Date = "2026-04-01",
    DueDate = "2026-04-01",
    Title = "Auto Invoice",
    Tax = 19,
    Currency = "EUR",
    Items = new []
    {
        new InvoiceItem
        {
            Type = "title",
            Title = "Development Services"
        },
        new InvoiceItem
        {
            Type = "item",
            Title = "Hosting Fees",
            Quantity = 1,
            Unit = "Stk",
            UnitPrice = 10.00
        }
    }
};

// Create the invoice
var invoice = await mocoClient.CreateInvoiceAsync(invoiceCreateRequest);

// Send the invoice via Email
var sendResponse = await mocoClient.SendInvoiceAsync(invoice.Id, new InvoiceSendEmailRequest
{
    EmailsTo = "client@example.com",
    Subject = "Your Invoice",
    Text = "Please find your invoice attached."
});

Requirements

  • .NET 10.0 or higher
  • A valid MOCO account
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
1.2.1 78 4/7/2026
1.2.0 84 4/6/2026
1.1.0 84 4/6/2026
1.0.0 83 4/3/2026
1.0.0-beta3 78 4/3/2026
1.0.0-beta2 85 4/3/2026
1.0.0-beta1 85 3/4/2026