SendInvoices.SendInvoice (invoice, Boolean, Boolean) Method

With this method, you can send an invoice to myDATA.
public string SendInvoice( 
   invoice invoice
   bool GreekErrors = False, 
   bool SendUnsignedInvoices = False 
)

Parameters

invoice
invoice

A collection of invoice data [mandatory]

GreekErrors
bool

Determines if the error will be returned in Greek or not.

SendUnsignedInvoices
bool

Determines whether the invoice is in issue. [Works only for Invoicing Providers]

Return Value

string

If the invoice is successfully sent, it returns UID and MARK; otherwise, it returns errors so that they can be handled properly.

Example
 
invoice invoice = sni.newInvoice;
 
#region issuer and counterpart - Fill in only the fields you need.
    invoice.issuer.vatNumber = "555777001";
    invoice.issuer.country = "GR";
     
    invoice.counterpart.vatNumber = "555777002";
    invoice.counterpart.country = "GR";
#endregion
 
#region elements - Fill in only the fields you need.
    invoice.elements.series = "IZ";
    invoice.elements.aa = 1;
    invoice.elements.issueDate = DateTime.Now;
    invoice.elements.invoiceType = "1.1";
#endregion
 
#region Lines - Fill in only the fields you need.
        for (int i = 1; i <= 2; i++)
        {
            invoiceLine ln = sni.newLine;
            ln.netValue = 200.0d;
            ln.VatCategory = 1;
            ln.VatAmount = 48.0d;
            ln.lineComments = "line comment";
            ln.classification.Type = "E3_561_001";
            ln.classification.Category = "category1_1";
         
            invoice.lines.Add(ln);
        }
#endregion
 
#region payments
        paymentMethod tmpPay = sni.newPaymentMethod;
        tmpPay.type = 1;
        tmpPay.amount = 496.0d;
        invoice.payments.Add(tmpPay);
#endregion
 
string result = sni.SendInvoice(invoice);                   

.NET Framework

Supported in: 3.5 or newer