ERPXTpl 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ERPXTpl --version 1.0.0
NuGet\Install-Package ERPXTpl -Version 1.0.0
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="ERPXTpl" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ERPXTpl --version 1.0.0
#r "nuget: ERPXTpl, 1.0.0"
#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.
// Install ERPXTpl as a Cake Addin
#addin nuget:?package=ERPXTpl&version=1.0.0

// Install ERPXTpl as a Cake Tool
#tool nuget:?package=ERPXTpl&version=1.0.0

# ERPXT.pl - .NET Helper library

A library that is to facilitate the use of the ERP XT API without unnecessary implementation.

Requirements

You need to have ClientId and SecretKey to authorize API server. More information about how to get this data you can found on this page ERPXT-Authorization

Usage

You need to create a main object that takes two parameters - ClientId and SecretKey.

ERPXT erpxt = new ERPXT(clientId, secretKey);

The token is saved in the memory cache. Prior to each request to the API, its validity is checked. If the token is expired, the server is asked for a new token which is saved to the cache.

Each request is wrapped in a Result object. Result consists of Data, StatusCode, and Message

Data = returned object from response
StatusCode = HttpCode from response or "ERROR" if something went wrong before send request.
Message = Message from server if something went wrong

Examples

Methods are really simple and readable. I will write some examples below but if you need more information, you can ask me by creating issue 😃

Get product by ID

long productId = 12345678;
var getProduct = await erpxt.GetProduct(productId)

Add product

Product product = new Product()
product.Name = "Test Product";
product.Description = "Best description ever!";
product.UnitOfMeasure = "piece";
product.Rate = RateEnum.TWENTY_THREE_PERCENT;
var addProduct = await erpxt.AddProduct(product);

Get customer by ID

long customerId = 12349876;
var getCustomer = await erpxt.GetCustomerById(customerId);

Get customer by Email

string email = "test@mail.com";
var getCustomer = await erpxt.GetCustomerByEmail(email);

Add customer

Customer customer = new Customer();
customer.Name = "Comarch S.A";
customer.CountryCode = "PL";
customer.CustomerStatus = CustomerStatusEnum.DOMESTIC;
customer.Mail = "erpxt@comarch.pl";
customer.Address.BuildingNumber = "17";
customer.Address.Street = "Dworcowa";
customer.Address.PostalCode = "222-232";
customer.Address.City = "Warsaw";
var addCustomer = await erpxt.AddCustomer(customer);

Modify customer

Customer customer = new Customer();
customer.Id = 334121;
customer.Name = "Allegro S.A";
customer.Phone = "123-456-789";
var modifyCustomer = await erpxt.ModifyCustomer(customer);

Delete customer

long customerId = 777666;
var deleteCustomer = await erpxt.DeleteCustomer(customerId);

Get list of payment methods

var getPaymentMethods = await erpxt.GetPaymentMethods();

Get bank accounts

var getBankAccounts = await erpxt.GetBankAccount();

Get specific bank account

long bankId = 551551;
var getBankAccount = await erpxt.GetBankAccount(bankId);

Get sales invoice by number

string number = "FA/1/2022";
var getInvoice = await erpxt.GetSalesInvoice(number);

Add sales invoice

SalesInvoice invoice = new SalesInvoice();
invoice.PaymentStatus = PaymentStatusEnum.PAID;
invoice.PurchasingPartyId = 13604916;
invoice.PaymentTypeId = 10199422;
invoice.Items.AddRange(new List<Item>
{
new Item() { ProductId = 11430127, Quantity = 99, ProductCurrencyPrice = 15.52M },
new Item() { ProductId = 10578173, Quantity = 1, ProductCurrencyPrice = 25.00M, ProductDescription = "Hello2" }
});
var addInvoice = await erpxt.AddSalesInvoice(invoice);

Save print to file

long invoiceId = 555111;
long printTemplateId = 5;
string path = "C:/prints/";
var printData= await erpxt.GetInvoiceCustomPrint(invoiceId, printTemplateId);
erpxt.SavePrintToFile(printData, path);

Get converted ProForma Invoices

var proformas = await erpxt.GetProformasFiltered(true) // if false, you will get non converted

Get last Sales Invoices depends on issue date

var invoices = await erpxt.GetLastInvoices(10); // You will get last 10 invoices;

and more more more ... 😃

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.1.0 452 2/13/2022
1.0.1 473 2/1/2022
1.0.0 468 2/1/2022