Sözer Logo Rest, Logo Yazılım ürünleriyle entegrasyon sağlamak için geliştirilmiş bir .NET kütüphanesidir. Bu paket, Cari Hesap, Cari Sevkiyat Adresi, Satış Siparişi ve Satınalma Siparişi gibi verileri Logo sistemine kolayca entegre etmenize olanak tanır.
License
—
Deps
11
Install Size
—
Vulns
✓ 0
Published
Feb 18, 2026
$ dotnet add package Sozer.Logo.RestSözer Logo Rest, Logo Yazılım ürünleriyle entegrasyon sağlamak için geliştirilmiş bir .NET kütüphanesidir. Bu paket, Cari Hesap, Cari Sevkiyat Adresi, Satış Siparişi ve Satınalma Siparişi gibi verileri Logo sistemine kolayca entegre etmenize olanak tanır.
En son güncellemeyle birlikte kütüphane, gönderme işlemi sırasında herhangi bir hata oluştuğunda fırlatılan özel bir PostException ile geliştirilmiş hata işleme özelliğini içermektedir.
Sözer Logo Rest'i NuGet üzerinden projelerinize ekleyebilirsiniz:
dotnet add package Sozer.Logo.Rest
veya Visual Studio NuGet Paket Yöneticisi'nden ekleyin:
Sozer Logo Rest aratın ve projeye ekleyin.Paketin kullanımı basittir. Genel işlemler için bir LogoClient içerir.
ELogoClient oturum açma işlemleri için appsettings.json dosyasına aşağıdaki gibi bilgileri vermeniz gerekiyor
{
"ELogoService": {
"username": "Kullanıcı_adi",
"password": "parola"
},
"LogoRestAPI": {
"Url": "Logo/Rest/API/Url",
"Client": "Logo Rest API Authorization Token"
}
}
appsettings.json'daki bilgilerin okunabilmesi için Configuration'ı pakete vermeniz gerekiyor
var builder = WebApplication.CreateBuilder(args);
IWebHostEnvironment env = builder.Environment;
builder.Configuration.SetBasePath(env.ContentRootPath).AddJsonFile("appsettings.json", optional: false).AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
builder.Services.AddSozerLogoRestPackage("<lisans anahtarı buraya>", builder.Configuration);
// Hata Handling ve lisans kontrolü için şart
var app = builder.Build();
app.ConfigureExceptionHandlingMiddleware();
Sözer Bilgisayar adresinden lisans anahtarınız için kayıt olabilirsiniz
Bir hesap eklerken, TaxPayerCode alanı sağlanmışsa:
TaxPayerCode 10 karakter uzunluğundaysa, hesap kurumsal bir varlık olarak değerlendirilir.PostLabel ve SenderLabel gibi belirli alanları günceller.[Route("api/[controller]/[action]")]
[ApiController]
public class AccountsRpController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostAccountsRPs(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [ new AccountsRP()
{
Code = "Cari Hesap Kodu",
TaxPayerCode = "1234567890" // Hesap türünü doğrular ve belirler
} ], cancellationToken));
}
Yeni INTERNAL_REFERENCE alanı ile eğer alan null değilse sistem veriyi, verilen alanlarla günceller. INTERNAL_REFERENCE null ise yeni bir kayıt oluşturulur.
[Route("api/[controller]/[action]")]
[ApiController]
public class ArpShipLicsController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostArpShipLics(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [ArpShipLic() {
ArpCode = "Cari Hesap Kodu",
Code = "Sevkiyat Adresi Kodu"
}], cancellationToken));
}
Yeni INTERNAL_REFERENCE alanı ile eğer alan null değilse sistem veriyi, verilen alanlarla günceller. INTERNAL_REFERENCE null ise yeni bir kayıt oluşturulur.
[Route("api/[controller]/[action]")]
[ApiController]
public class OrdersController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostOrders(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [
new Order() {
Number = "Satış Siparişi Numarası"
}
], cancellationToken));
}
Yeni INTERNAL_REFERENCE alanı ile eğer alan null değilse sistem veriyi, verilen alanlarla günceller. INTERNAL_REFERENCE null ise yeni bir kayıt oluşturulur.
[Route("api/[controller]/[action]")]
[ApiController]
public class PurchOrdersController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostPurchOrders(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [new PurchOrder() {
Number = "Satınalma Siparişi Numarası"
}], cancellationToken));
}
Yeni INTERNAL_REFERENCE alanı ile eğer alan null değilse sistem veriyi, verilen alanlarla günceller. INTERNAL_REFERENCE null ise yeni bir kayıt oluşturulur.
[Route("api/[controller]/[action]")]
[ApiController]
public class MaterialsController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostMaterials(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [new Material() {
Code = "Malzeme Kodu"
}], cancellationToken));
}
Yeni INTERNAL_REFERENCE alanı ile eğer alan null değilse sistem veriyi, verilen alanlarla günceller. INTERNAL_REFERENCE null ise yeni bir kayıt oluşturulur.
[Route("api/[controller]/[action]")]
[ApiController]
public class SalesInvoiceController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IList<PostResult>))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostSalesInvoices(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [new SalesInvoice() {
Type = 3,
DocTrackNr = "Dokuman Izleme Numarasi",
DocNumber = "Belge No",
AuxilCode = "Ozel Kod",
AuthCode = "1",
Arp_Code = "1341911",
PostFlags = 247
}], cancellationToken));
}
}
Yeni INTERNAL_REFERENCE alanı ile eğer alan null değilse sistem veriyi, verilen alanlarla günceller. INTERNAL_REFERENCE null ise yeni bir kayıt oluşturulur.
[Route("api/[controller]/[action]")]
[ApiController]
public class MaterialSlipsController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IList<PostResult>))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostMaterialSlips(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [new() {
Group = 3,
Type = 12,
Date = "29.09.2025",
CurrselTotals = 1,
Transactions = [new() {
ItemCode = "Malzeme Kodu",
Quantity = 5, // Miktar
UnitCode = "Birim Kodu",
UnitConv1 = 1,
UnitConv2 = 1
}]
}], cancellationToken));
}
Gönderme işlemi sırasında, herhangi bir hata meydana gelirse, özel bir PostException atılır. Bu istisna, öğe numarası ve hata mesajı da dahil olmak üzere başarısız gönderiler hakkında ayrıntılı bilgi içerir.
try
{
IList<PostResult> results = await logoClient.PostAccountsRPs(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, new List<Account>
{
new()
{
InternalReference = null,
Title = "Invalid Account",
TaxPayerCode = "INVALID"
}
});
}
catch (PostException ex)
{
Console.WriteLine("An error occurred during the posting process:");
Console.WriteLine(ex.Message);
}
PostResult başarısızlık gösterirse (IsSuccess == false), bir PostException tetiklenir.Number).Örnek Hata Mesajı:
Hata Mesajı: 1 numaralı AccountsRP Hata: DBError(8) - Kayıt veritabanına aktarılamadı. 23000 : Cannot insert duplicate key row in object 'dbo.LG_999_CLCARD' with unique index 'I999_CLCARD_I13'. The duplicate key value is (1, 0, 1).\n"
Sipariş fişlerini faturalamak için kullanılan method'dur. Eğer işlem başarıyla gerçekleşmezse, dönüş nesnesinde error özelliği doldurulur.
[Route("api/[controller]/[action]")]
[ApiController]
public class UnityApplicationController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(OrderBillingResponse))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> OrderBilling(CancellationToken cancellationToken) => Ok(await logoClient.OrderBilling(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [new() {
OrderRef = 3229, // Faturalaştıracağınız siparişin Logical Reference'ı
Date = "02.10.2025", // Tarih gün.ay.yıl formatında olmalıdır
FicheType = 3, // Fatura Türü
DocumentCode = "Belge No",
SpecialCode = "Özel Kod",
AuthCode = "Yetki Kodu",
Description1 = "Açıklama 1",
Description2 = "Açıklama 2",
Description3 = "Açıklama 3",
Description4 = "Açıklama 4",
CheckUserRight = true, // Kullanıcı Yetkisi Kontrol Edilsin Mi?
SqlTransaction = true, // Sql Transaction
EInvoice = false, // Sipariş E-faturaya dönüştürülecek Mi?
VatExceptReason = "Vergi Muaf Nedeni"
}, new() {
OrderRef = 3230,
Date = "02.10.2025",
FicheType = 3,
DocumentCode = "SP00000000000003"
}, new() {
OrderRef = 2142,
Date = "02.10.2025",
FicheType = 3,
DocumentCode = "SP00000000000001"
},], cancellationToken));
Yeni INTERNAL_REFERENCE alanı ile eğer alan null değilse sistem veriyi, verilen alanlarla günceller. INTERNAL_REFERENCE null ise yeni bir kayıt oluşturulur.
[Route("api/[controller]/[action]")]
[ApiController]
public class SalesDispatchesController(LogoClient logoClient, XmlService xmlService) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
private readonly XmlService xmlService = xmlService;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IList<PostResult>))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostSalesDispatches(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [new() {
Type = 9,
Number = "~",
Date = "23.10.2025",
Time = 202052408,
ArpCode = "5000534",
Notes1 = "",
SourceWh = 0,
CreatedBy = 0,
RcRate = 0,
CurrselTotals = 1,
Salesmancode = "",
ShippingAgent = "",
Deductionpart1 = 0,
Deductionpart2 = 0,
Edespatch = 1,
ShipDate = "23.10.2025",
ShipTime = 202052408,
DocDate = "23.10.2025",
DocTime = 202052408,
Transactions =
{
new()
{
Type = 0,
Price = 0,
MasterCode = "DKPN12188",
Sourceindex = 0,
Quantity = 5,
RcXrate = 0,
UnitCode = "ADET",
UnitConv1 = 5,
UnitConv2 = 5,
VatRate = 20,
EdtCurr = 53,
OrderReference = "3001",
Sldetails =
{
new()
{
SourceMtReference = 380,
SourceSltReference = 1,
SourceQuantity = 1,
IOCODE = 4,
SourceWh = 0,
SlType = 1,
SlCode = "123456",
MuQuantity = 1,
UnitCode = "ADET",
Quantity = 1,
UnitConv1 = 1,
UnitConv2 = 1
}
}
}
}
}], cancellationToken));
Yeni INTERNAL_REFERENCE alanı ile eğer alan null değilse sistem veriyi, verilen alanlarla günceller. INTERNAL_REFERENCE null ise yeni bir kayıt oluşturulur.
[Route("api/[controller]/[action]")]
[ApiController]
public class ArpVouchersController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IList<PostResult>))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostArpVoucher(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [new() {
Number = "Numara",
Date = "26.01.2026",
Type = 70, // Tip
Notes1 = "Açıklama",
CurrselTotals = 1,
DataReference = 1,
Arp_Code = "Cari Hesap Kodu",
ProjectCode = "Proje Kodu",
AffectRisk = 0,
SalesmanCode = "Satış Elemanı Kodu"
}], cancellationToken));
}
Yeni INTERNAL_REFERENCE alanı ile eğer alan null değilse sistem veriyi, verilen alanlarla günceller. INTERNAL_REFERENCE null ise yeni bir kayıt oluşturulur.
[Route("api/[controller]/[action]")]
[ApiController]
public class BomsController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IList<PostResult>))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostBom(new LogoAuth
{
Username = "kullanıcıAdı",
Password = "şifre",
FirmNo = 0, // firmaNumarası
PeriodNr = null // dönemNumarası
}, [new() {
Code = "Test3",
Type = 1,
RevCode = "REVIZYON - KODU",
RevRecordStatus = 1,
RevDate = "28.01.2026",
RevDataReference = 1,
Lines = [new() {
LineType = 4,
Uinfo1 = 1,
Uinfo2 = 1,
Amount = 1,
Scalable = 1,
InvenNo = -1,
Engineering = 1,
Production = 1,
Cost = 1,
CostRate = 1,
Formula = "1",
EffectOpTime = 1,
ItemCode = "EKMEK",
ItemName = "Ekmek",
UnitSetCode = "05",
UnitCode = "ADET",
BomType = 1,
OpCode = "ROTASIZ",
OpName = "ROTASIZ"
}, new() {
LineType = 0,
Uinfo1 = 1,
Uinfo2 = 1,
Amount = 1,
Scalable = 1,
InvenNo = -1,
Engineering = 1,
Production = 1,
Cost = 1,
Formula = "P1",
ItemCode = "SU",
ItemName = "Su",
UnitSetCode = "05",
UnitCode = "ADET",
BomType = 1,
OpCode = "ROTASIZ",
OpName = "ROTASIZ",
DefCostType = 5
}],
MpCode = "EKMEK",
MpName = "Ekmek",
RoutCode = "URETIM ROTASI KODU",
RoutName = "Uretim Rotasi Aciklamasi"
}], cancellationToken));
}
Aşağıdaki nesneler için güncelleme (Update) işlemi sırasında:
Eğer güncellenecek kaydın satırları (Lines) mevcutsa, güncelleme sırasında bu kayıt tamamen silinir ve gönderilen kayıt ile baştan oluşturulur.
⚠ Önemli Uyarı
Bu nedenle güncelleme yaparken, eğer veri satır içeriyorsa:
Bu yaklaşım, Logo tarafındaki satır senkronizasyonunu garanti altına almak için tercih edilmiştir.
| Özellik | Açıklama |
|---|---|
| Cari Hesap | TaxPayerCode doğrulaması ile bir hesap oluşturma ve güncelleme. |
| Cari Sevkiyat Adresi | Müşteri sevkiyat adresi ekleme ve güncelleme işlemi. |
| Satış Siparişi | Satış siparişi oluşturma ve güncelleme işlemi. |
| Satınalma Siparişi | Satın alma siparişi ekleme ve güncelleme işlemi. |
| Malzeme | Malzeme ekleme ve güncelleme işlemi. |
| Satış Faturası | Satış Faturası ekleme ve güncelleme işlemi. |
| Malzeme Fişleri | Malzeme Fişleri ekleme ve güncelleme işlemi. |
| Hata İşleme | Ayrıntılı hata raporlaması için özel PostException. |
| Fatura İptali | Fatura referansı ile Fatura İptali. |
| OrderBilling ile Sipariş Faturalarını Faturalamak | Sipariş fişlerini faturalar. |
| Satış İrsaliyeleri | Satış İrsaliyeleri ekleme ve güncelleme işlemi. |
| Cari Hesap Fişi | Cari Hesap Fişi ekleme ve güncelleme işlemi. |
| Ürün Reçetesi | Ürün Reçetesi ekleme ve güncelleme işlemi. |
Bu proje MIT Lisansı altında lisanslanmıştır. Daha fazla bilgi için LICENSE dosyasına bakabilirsiniz.
Bu projeyle ilgili herhangi bir sorunuz veya geri bildiriminiz varsa, lütfen bana ulaşın:
Hakkıcan Bülüç
Sözer Logo Rest is a .NET library developed for integration with Logo Software products. This package allows you to easily integrate data such as Current Account, Current Shipping Address, Sales Order, and Purchase Order into the Logo system.
With the latest update, the library includes improved error handling with a custom PostException, which is thrown if any errors occur during the posting process.
You can add the Sözer Logo Rest to your projects via NuGet:
dotnet add package Sozer.Logo.Rest
or add it through Visual Studio NuGet Package Manager:
Sozer Logo Rest in the Browse tab and add it to your project.The package is straightforward to use. It includes a LogoClient for general operations.
You need to provide the following information in the appsettings.json file for ELogoClient login procedures:
{
"ELogoService": {
"username": "Kullanıcı_adi",
"password": "parola"
},
"LogoRestAPI": {
"Url": "Logo/Rest/API/Url",
"Client": "Logo Rest API Authorization Token"
}
}
You need to include Configuration in the package to be able to read the information in appsettings.json.
var builder = WebApplication.CreateBuilder(args);
IWebHostEnvironment env = builder.Environment;
builder.Configuration.SetBasePath(env.ContentRootPath).AddJsonFile("appsettings.json", optional: false).AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
builder.Services.AddSozerLogoRestPackage("<license key here>", builder.Configuration);
// Error handling and license verification requirements
var app = builder.Build();
app.ConfigureExceptionHandlingMiddleware();
You can register for your license key at Sözer Bilgisayar
When adding an account, if the TaxPayerCode field is provided:
TaxPayerCode is 10 characters long, the account is treated as a corporate entity.PostLabel and SenderLabel.[Route("api/[controller]/[action]")]
[ApiController]
public class AccountsRpController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostAccountsRPs(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [ new AccountsRP()
{
Code = "Current Account Code",
TaxPayerCode = "1234567890", // Validates and determines account type
} ], cancellationToken));
}
With the new INTERNAL_REFERENCE field, if the field is not null, the system updates the data with the given fields. If INTERNAL_REFERENCE is null, a new record is created.
[Route("api/[controller]/[action]")]
[ApiController]
public class ArpShipLicsController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostArpShipLics(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [new ArpShipLic() {
ArpCode = "Current Account Code",
Code = "Shipping Address Code"
}], cancellationToken));
}
With the new INTERNAL_REFERENCE field, if the field is not null, the system updates the data with the given fields. If INTERNAL_REFERENCE is null, a new record is created.
[Route("api/[controller]/[action]")]
[ApiController]
public class OrdersController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostOrders(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [
new Order() {
Number = "Sales Order Number"
}
], cancellationToken));
}
With the new INTERNAL_REFERENCE field, if the field is not null, the system updates the data with the given fields. If INTERNAL_REFERENCE is null, a new record is created.
[Route("api/[controller]/[action]")]
[ApiController]
public class PurchOrdersController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostPurchOrders(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [new PurchOrder() {
Number = "Purchase Order Number"
}], cancellationToken));
}
With the new INTERNAL_REFERENCE field, if the field is not null, the system updates the data with the given fields. If INTERNAL_REFERENCE is null, a new record is created.
[Route("api/[controller]/[action]")]
[ApiController]
public class MaterialsController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostMaterials(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [new Material() {
Code = "Material Code"
}], cancellationToken));
}
With the new INTERNAL_REFERENCE field, if the field is not null, the system updates the data with the given fields. If INTERNAL_REFERENCE is null, a new record is created.
[Route("api/[controller]/[action]")]
[ApiController]
public class SalesInvoiceController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IList<PostResult>))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostSalesInvoices(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [new SalesInvoice() {
Type = 3,
}], cancellationToken));
}
}
With the new INTERNAL_REFERENCE field, if the field is not null, the system updates the data with the given fields. If INTERNAL_REFERENCE is null, a new record is created.
[Route("api/[controller]/[action]")]
[ApiController]
public class MaterialSlipsController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IList<PostResult>))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostMaterialSlips(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [new() {
Group = 3,
Type = 12,
Date = "29.09.2025",
CurrselTotals = 1,
Transactions = new() {
Transaction = [new() {
ItemCode = "Item Code",
Quantity = 5,
UnitCode = "Unit Code",
UnitConv1 = 1,
UnitConv2 = 1
}]
}
}], cancellationToken));
}
During the posting process, if any errors occur, a custom PostException is thrown. This exception contains detailed information about the failed posts, including the item number and the error message.
try
{
IList<PostResult> results = await logoClient.PostAccountsRPs(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, new List<Account>
{
new()
{
InternalReference = null,
Title = "Invalid Account",
TaxPayerCode = "INVALID"
}
});
}
catch (PostException ex)
{
Console.WriteLine("An error occurred during the posting process:");
Console.WriteLine(ex.Message);
}
PostResult indicates failure (IsSuccess == false), a PostException is triggered.Number).Example Error Message:
Hata Mesajı: 1 numaralı AccountsRP Hata: DBError(8) - Kayıt veritabanına aktarılamadı. 23000 : Cannot insert duplicate key row in object 'dbo.LG_999_CLCARD' with unique index 'I999_CLCARD_I13'. The duplicate key value is (1, 0, 1).\n"
This method is used to invoice order slips. If the operation does not succeed, the error property is filled in the return object.
[Route("api/[controller]/[action]")]
[ApiController]
public class UnityApplicationController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(OrderBillingResponse))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> OrderBilling(CancellationToken cancellationToken) => Ok(await logoClient.OrderBilling(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [new() {
OrderRef = 3229, // The Logical Reference of the order you will invoice
Date = "02.10.2025", // The date must be in the day.month.year format.
FicheType = 3, // Invoice Type
DocumentCode = "Document No.",
SpecialCode = "Special Code",
AuthCode = "Authorization Code",
Description1 = "Description 1",
Description2 = "Description 2",
Description3 = "Description 3",
Description4 = "Description 4",
CheckUserRight = true, // Should User Permissions Be Checked?
SqlTransaction = true, // Sql Transaction
EInvoice = false, // Will the order be converted to an e-invoice?
VatExceptReason = "Vat Except Reason"
}, new() {
OrderRef = 3230,
Date = "02.10.2025",
FicheType = 3,
DocumentCode = "SP00000000000003"
}, new() {
OrderRef = 2142,
Date = "02.10.2025",
FicheType = 3,
DocumentCode = "SP00000000000001"
},], cancellationToken));
With the new INTERNAL_REFERENCE field, if the field is not null, the system updates the data with the given fields. If INTERNAL_REFERENCE is null, a new record is created.
[Route("api/[controller]/[action]")]
[ApiController]
public class SalesDispatchesController(LogoClient logoClient, XmlService xmlService) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
private readonly XmlService xmlService = xmlService;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IList<PostResult>))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostSalesDispatches(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [new() {
Type = 9,
Number = "~",
Date = "23.10.2025",
Time = 202052408,
ArpCode = "5000534",
Notes1 = "",
SourceWh = 0,
CreatedBy = 0,
RcRate = 0,
CurrselTotals = 1,
Salesmancode = "",
ShippingAgent = "",
Deductionpart1 = 0,
Deductionpart2 = 0,
Edespatch = 1,
ShipDate = "23.10.2025",
ShipTime = 202052408,
DocDate = "23.10.2025",
DocTime = 202052408,
Transactions =
{
new()
{
Type = 0,
Price = 0,
MasterCode = "DKPN12188",
Sourceindex = 0,
Quantity = 5,
RcXrate = 0,
UnitCode = "ADET",
UnitConv1 = 5,
UnitConv2 = 5,
VatRate = 20,
EdtCurr = 53,
OrderReference = "3001",
Sldetails =
{
new()
{
SourceMtReference = 380,
SourceSltReference = 1,
SourceQuantity = 1,
IOCODE = 4,
SourceWh = 0,
SlType = 1,
SlCode = "123456",
MuQuantity = 1,
UnitCode = "ADET",
Quantity = 1,
UnitConv1 = 1,
UnitConv2 = 1
}
}
}
}
}], cancellationToken));
}
With the new INTERNAL_REFERENCE field, if the field is not null, the system updates the data with the given fields. If INTERNAL_REFERENCE is null, a new record is created.
[Route("api/[controller]/[action]")]
[ApiController]
public class ArpVouchersController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IList<PostResult>))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostArpVoucher(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [new() {
Number = "Number",
Date = "26.01.2026",
Type = 70, // Type
Notes1 = "Description",
CurrselTotals = 1,
DataReference = 1,
Arp_Code = "Current Account Code",
ProjectCode = "Project Code",
AffectRisk = 0,
SalesmanCode = "Sales Representative Code"
}], cancellationToken));
}
With the new INTERNAL_REFERENCE field, if the field is not null, the system updates the data with the given fields. If INTERNAL_REFERENCE is null, a new record is created.
[Route("api/[controller]/[action]")]
[ApiController]
public class BomsController(LogoClient logoClient) : ControllerBase
{
private readonly LogoClient logoClient = logoClient;
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(IList<PostResult>))]
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(ExceptionModel))]
public async Task<IActionResult> Post(CancellationToken cancellationToken) => Ok(await logoClient.PostBom(new LogoAuth
{
Username = "username",
Password = "password",
FirmNo = 0, // firmNumber
PeriodNr = null // periodNumber
}, [new() {
Code = "Test3",
Type = 1,
RevCode = "REVISION - CODE",
RevRecordStatus = 1,
RevDate = "28.01.2026",
RevDataReference = 1,
Lines = [new() {
LineType = 4,
Uinfo1 = 1,
Uinfo2 = 1,
Amount = 1,
Scalable = 1,
InvenNo = -1,
Engineering = 1,
Production = 1,
Cost = 1,
CostRate = 1,
Formula = "1",
EffectOpTime = 1,
ItemCode = "Main material code",
ItemName = "Primary material name",
UnitSetCode = "05",
UnitCode = "Unit Code",
BomType = 1,
OpCode = "Operation Code",
OpName = "Operation Description"
}, new() {
LineType = 0,
Uinfo1 = 1,
Uinfo2 = 1,
Amount = 1,
Scalable = 1,
InvenNo = -1,
Engineering = 1,
Production = 1,
Cost = 1,
Formula = "P1",
ItemCode = "Input material code",
ItemName = "Input material name",
UnitSetCode = "05",
UnitCode = "Unit Code",
BomType = 1,
OpCode = "Operation Code",
OpName = "Operation Description",
DefCostType = 5
}],
MpCode = "Main product code",
MpName = "Main product name",
RoutCode = "PRODUCTION ROUTE CODE",
RoutName = "PRODUCTION ROUTE Description"
}], cancellationToken));
}
During the update process for the following objects:
If the record to be updated has lines, during the update this record is completely deleted and recreated from scratch with the submitted record.
⚠ Important Warning
Therefore, when updating, if the data contains lines:
This approach has been chosen to ensure line synchronization on the Logo side.
| Feature | Description |
|---|---|
| Current Account | Create and update an account with TaxPayerCode validation. |
| Shipping Address | Add and update customer shipping addresses. |
| Sales Order | Create and update sales orders. |
| Purchase Order | Add and update purchase orders. |
| Material | Add and update materials. |
| Sales Invoice | Add and update sales invoices. |
| Material Slips | Add and update material slips. |
| Error Handling | Custom PostException for detailed error reporting. |
| OrderBilling: Billing Order Invoices | Invoices for order slips. |
| Sales Invoices | Adding and updating sales invoices. |
| Arp Vouchers | Adding and Updating arp vouchers. |
| Bom | Adding and Updating boms. |
This project is licensed under the MIT License. For more information, please see the LICENSE file.
If you have any questions or feedback about this project, please reach out to me:
Hakkıcan Bülüç