Parasut 1.3.1

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

Parasut.NET

An easy-to-use parasut.com API (v4) with .NET

Installation

dotnet add package Parasut --version 1.3.1

Müşteri/Tedarikçi oluşturma

namespace Parasut {
    internal class Program {
        static void Main(string[] args) {
            var parasut = new Parasut();
            parasut.SetCompanyId("API company id");
            parasut.SetClientId("API client id");
            parasut.SetClientSecret("API client secret");
            parasut.SetUsername("API username");
            parasut.SetPassword("API password");
            var auth = parasut.Authorize();
            if (auth) {
                var contact = new Parasut.Request.Contact {
                    Data = new() {
                        Attributes = new() {
                            AccountType = "", // "customer" (Müşteri), "supplier" (Tedarikçi)
                            ContactType = "", // "company" (Şirket), "person" (Şahıs)
                            Name = "", // Müşteri Adı
                            ShortName = "", // Kısa isim
                            TaxNumber = "", // Vergi numarası
                            TaxOffice = "", // Vergi dairesi
                            Country = "", // Ülke
                            City = "", // İl
                            District = "", // İlçe
                            Address = "", // Adres
                            Phone = "", // Telefon
                            Fax = "", // Faks
                            Email = "", //  E-posta adresi
                            IBAN = "" // IBAN numarası
                        }
                    }
                };
                var response = parasut.CreateContact(contact);
                Console.WriteLine(Parasut.JsonString<Parasut.Response.Contact>(response));
            }
        }
    }
}

Müşteri/Tedarikçi arama

namespace Parasut {
    internal class Program {
        static void Main(string[] args) {
            var parasut = new Parasut();
            parasut.SetCompanyId("API company id");
            parasut.SetClientId("API client id");
            parasut.SetClientSecret("API client secret");
            parasut.SetUsername("API username");
            parasut.SetPassword("API password");
            var auth = parasut.Authorize();
            if (auth) {
                var contacts = parasut.SearchContact(new() {
                    TaxNumber = "Vergi numarası",
                });
                if (contacts != null) {
                    Console.WriteLine(Parasut.JsonString<Parasut.Response.Contacts>(contacts));
                }
            }
        }
    }
}

Peşin satış faturası oluşturma

namespace Parasut {
    internal class Program {
        static void Main(string[] args) {
            var parasut = new Parasut();
            parasut.SetCompanyId("API company id");
            parasut.SetClientId("API client id");
            parasut.SetClientSecret("API client secret");
            parasut.SetUsername("API username");
            parasut.SetPassword("API password");
            var auth = parasut.Authorize();
            if (auth) {
                var invoice = new Parasut.Request.SalesInvoice {
                    Data = new() {
                        Attributes = new() {
                            ItemType = "invoice",
                            Description = "", // Fatura açıklaması
                            IssueDate = new DateTime(2022, 02, 20).ToString("yyyy-MM-dd"), // Fatura tarihi (Yıl-Ay-Gün)
                            ShipmentIncluded = false, // İrsaliyeli fatura
                            CashSale = true, // Peşin satış
                            PaymentDate = new DateTime(2022, 02, 20).ToString("yyyy-MM-dd"), // Peşin ödeme tarihi (Yıl-Ay-Gün)
                            PaymentDescription = "", // Peşin ödeme açıklaması
                            PaymentAccountID = "", // Paraşüt Banka ID (zorunlu)
                            Currency = "TRL", // Para birimi : "TRL", "USD", "EUR", "GBP"
                        },
                        Relationships = new() {
                            Contact = new() {
                                Data = new() {
                                    Id = "" // Paraşüt Müşteri ID (zorunlu)
                                }
                            },
                            Details = new() {
                                Data = new Parasut.Request.SalesInvoiceData.SalesInvoiceDetailsData[] {
                                    new(){
                                        Attributes = new() {
                                            Quantity = "1", // Ürün miktarı
                                            UnitPrice = "1.00", // Ürün birim fiyatı (KDV hariç)
                                            VatRate = "18" // Ürün KDV oranı
                                        },
                                        Relationships = new() {
                                            Product = new() {
                                                Data = new() {
                                                    Id = "" // Paraşüt Ürün ID (zorunlu)
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                };
                var response = parasut.CreateSalesInvoice(invoice);
                Console.WriteLine(Parasut.JsonString<Parasut.Response.SalesInvoice>(response));
            }
        }
    }
}

Satış faturası resmileştirme

namespace Parasut {
    internal class Program {
        static void Main(string[] args) {
            var parasut = new Parasut();
            parasut.SetCompanyId("API company id");
            parasut.SetClientId("API client id");
            parasut.SetClientSecret("API client secret");
            parasut.SetUsername("API username");
            parasut.SetPassword("API password");
            var auth = parasut.Authorize();
            if (auth) {
                var invoice = parasut.ShowSalesInvoice("Paraşüt Fatura ID");
                if (invoice != null) {
                    var inboxes = parasut.ListEInvoiceInboxes(invoice.Data.Attributes.TaxNumber);
                    if (inboxes.Data.Any()) { // e-Fatura ise
                        foreach (var inbox in inboxes.Data) {
                            var einvoice = new Parasut.Request.EInvoice {
                                Data = new() {
                                    Attributes = new() {
                                        To = inbox.Attributes.EInvoiceAddress,
                                        Scenario = "basic", // "basic" (Temel e-Fatura), "commercial" (Ticari e-Fatura)
                                        Note = "", // Fatura notu
                                    },
                                    Relationships = new() { Invoice = new() { Data = new() { Id = invoice.Data.Id } } }
                                }
                            };
                            var response = parasut.CreateEInvoice(einvoice);
                            while (true) {
                                var job = parasut.TrackJob(response.Data.Id);
                                if (job.Data.Attributes.Status != "running") {
                                    Console.WriteLine(Parasut.JsonString<Parasut.Response.TrackableJob>(job));
                                    break;
                                }
                                System.Threading.Thread.Sleep(2000);
                            }
                        }
                    } else { // e-Arşiv ise
                        var earchive = new Parasut.Request.EArchive {
                            Data = new() {
                                Attributes = new() {
                                    Note = "", // Fatura notu
                                    // Internet satışı (varsa)
                                    InternetSale = new() {
                                        Url = "", // İnternet satışının yapıldığı url
                                        PaymentType = "", // Ödeme yöntemi : "KREDIKARTI/BANKAKARTI", "EFT/HAVALE", "KAPIDAODEME", "ODEMEARACISI"
                                        PaymentPlatform = "", // Ödeme platformu (iyzico,payu,banka adı vb.)
                                        PaymentDate = new DateTime(2022, 02, 20).ToString("yyyy-MM-dd"), // Ödeme tarihi (Yıl-Ay-Gün)
                                    }
                                },
                                Relationships = new() { SalesInvoice = new() { Data = new() { Id = invoice.Data.Id } } }
                            }
                        };
                        var response = parasut.CreateEArchive(earchive);
                        while (true) {
                            var job = parasut.TrackJob(response.Data.Id);
                            if (job.Data.Attributes.Status != "running") {
                                Console.WriteLine(Parasut.JsonString<Parasut.Response.TrackableJob>(job));
                                break;
                            }
                            System.Threading.Thread.Sleep(2000);
                        }
                    }
                }
            }
        }
    }
}

Satış faturasının tahsilatlarını silme

namespace Parasut {
    internal class Program {
        static void Main(string[] args) {
            var parasut = new Parasut();
            parasut.SetCompanyId("API company id");
            parasut.SetClientId("API client id");
            parasut.SetClientSecret("API client secret");
            parasut.SetUsername("API username");
            parasut.SetPassword("API password");
            var auth = parasut.Authorize();
            if (auth) {
                var invoice = parasut.ShowSalesInvoice("Paraşüt Fatura ID");
                if (invoice != null) {
                    var transactions = invoice.Included.Where(included => included.Type == "transactions");
                    foreach (var transaction in transactions) {
                        parasut.DeleteTransaction(transaction.Id);
                    }
                }
            }
        }
    }
}

E-arşiv/E-fatura pdf adresi görüntüleme

namespace Parasut {
    internal class Program {
        static void Main(string[] args) {
            var parasut = new Parasut();
            parasut.SetCompanyId("API company id");
            parasut.SetClientId("API client id");
            parasut.SetClientSecret("API client secret");
            parasut.SetUsername("API username");
            parasut.SetPassword("API password");
            var auth = parasut.Authorize();
            if (auth) {
                var invoice = parasut.ShowSalesInvoice("Paraşüt Fatura ID");
                if (invoice != null) {
                    switch (invoice.Data.Relationships.ActiveEDocument.Data.Type) {
                        case "e_invoices":
                            var einvoice = parasut.ShowEInvoicePDF(invoice.Data.Relationships.ActiveEDocument.Data.Id);
                            Console.WriteLine(einvoice.Data.Attributes.Url);
                            break;
                        case "e_archives":
                            var earchive = parasut.ShowEArchivePDF(invoice.Data.Relationships.ActiveEDocument.Data.Id);
                            Console.WriteLine(earchive.Data.Attributes.Url);
                            break;
                    }
                }
            }
        }
    }
}

E-arşiv fatura iptal etme

namespace Parasut {
    internal class Program {
        static void Main(string[] args) {
            var parasut = new Parasut();
            parasut.SetCompanyId("API company id");
            parasut.SetClientId("API client id");
            parasut.SetClientSecret("API client secret");
            parasut.SetUsername("API username");
            parasut.SetPassword("API password");
            var auth = parasut.Authorize();
            if (auth) {
                var invoice = parasut.ShowSalesInvoice("Paraşüt Fatura ID");
                if (invoice != null) {
                    if (invoice.Data.Relationships.ActiveEDocument.Data.Type == "e_archives") {
                        var response = parasut.CancelSalesInvoice(invoice.Data.Id);
                        Console.WriteLine(Parasut.JsonString<Parasut.Response.SalesInvoice>(response));
                    }
                }
            }
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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.  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.
  • net6.0

    • No dependencies.

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.3.1 4,211 10/20/2023
1.3.0 490 12/3/2022
1.2.3 486 11/16/2022
1.2.2 596 5/16/2022
1.2.1 611 5/13/2022
1.2.0 594 5/13/2022
1.1.2 613 4/25/2022
1.1.1 580 4/24/2022
1.1.0 607 4/23/2022
1.0.1 491 12/17/2021
1.0.0 460 12/17/2021