SendInvoices.SendInvoice (List<invoice>, Boolean) Method

With this method, you can send multiple invoices to myDATA at once.
Public Function SendInvoice( _ 
ByVal invoices As List(Of invoice), _ 
Optional ByVal GreekErrors As Boolean = False _ 
) As Dictionary(Of String, Object)
This language is not supported or no code example is available.
public Dictionary<string, object> SendInvoice( 
List<invoice> invoices
bool GreekErrors = False 
)
This language is not supported or no code example is available.

Parameters

invoices
List<invoice>

A list of invoice data [mandatory]

GreekErrors
bool

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

Return Value

Dictionary<string, object>

It returns a dictionary containing the index of the sent invoice and the mark, the UID, or any errors.

Remarks
 
Retrieve the Invoices sent to the entity or sent by the entity 
 
Verify the validity of the classification you intend to send. 
 
Get All Valid Classification Type by Invoice Type 
 
Get All Valid Classification Categories by Invoice Type 
 
The following example, will return a dictonary like this: 

(1, mark:400000000000001 uid:AAAAAAA11111111111BBBBBBBB11111111111A11 url:<QR verification URL>) 
(2, mark:400000000000002 uid:AAAAAAA22222222222BBBBBBBB22222222222A22 url:<QR verification URL>) 
(3, 104 - Requested Invoice was not found) 
(4, mark:400000000000003 uid:AAAAAAA33333333333BBBBBBBB33333333333A33 url:<QR verification URL>) 
(3, 202 - Invalid Greek VAT number) 
]
Example
 
 var invoices = new List<invoice>();
 invoices.Clear();
 for (int j = 0; j <= 1; j++) // In this case, myDATA receives the exact identical invoice twice.
 {
     invoice invoice = sni.newInvoice;
 #region issuer and counterpart
     invoice.issuer.vatNumber = "555777001";
     invoice.issuer.country = "GR";
 
     invoice.counterpart.vatNumber = "555777002";
     invoice.counterpart.country = "GR";
 #endregion
 
 #region elements
     invoice.elements.series = "IZ";
     invoice.elements.aa = 1;
     invoice.elements.issueDate = DateTime.Now;
     invoice.elements.invoiceType = "1.1";
 #endregion
 
 #region Lines
     for (int i = 1; i <= 2; i++)
     {
         invoiceLine ln = sni.newLine;
         ln.netValue = 200.0d;
         ln.VatCategory = 1;
         ln.VatAmount = 48.0d;
         ln.classification.Type = ""; // This field refers to the E3 code
         ln.classification.Category = "category1_95";
 
         invoice.lines.Add(ln);
 
         invoiceLine ln1 = sni.newLine;
         ln1.netValue = 200.0d;
         ln1.VatCategory = 2;
         ln1.VatAmount = 13.0d;
         ln1.classification.Type = ""; // This field refers to the E3 code
         ln1.classification.Category = "category1_95";
 
         invoice.lines.Add(ln1);
     }
 #endregion
 
 #region payments
     paymentMethod tmpPay = sni.newPaymentMethod;
     tmpPay.type = 1;
     tmpPay.amount = 948.0d;
     invoice.payments.Add(tmpPay);
 #endregion
     invoices.Add(invoice);
 }
 
 Dictionary<string, object> result = sni.SendInvoice(invoices, true);					
This language is not supported or no code example is available.
 Dim invoices As New List(Of invoice)
         invoices.Clear()
         For j = 0 To 1 'In this case, myDATA receives the exact identical invoice twice.
             Dim invoice As invoice = sni.newInvoice
 #Region "issuer and counterpart"
             invoice.issuer.vatNumber = "555777001"
             invoice.issuer.country = "GR"
 
             invoice.counterpart.vatNumber = "555777002"
             invoice.counterpart.country = "GR"
 #End Region
 
 #Region "elements"
             invoice.elements.series = "IZ"
             invoice.elements.aa = 1
             invoice.elements.issueDate = Date.Now
             invoice.elements.invoiceType = "1.1"
 #End Region
 
 #Region "Lines"
             For i = 1 To 2
                 Dim ln As invoiceLine = sni.newLine
                 ln.netValue = 200.0
                 ln.VatCategory = 1
                 ln.VatAmount = 48.0
                 ln.classification.Type = "" ' This field refers to the E3 code
                 ln.classification.Category = "category1_95"
 
                 invoice.lines.Add(ln)
 
                 Dim ln1 As invoiceLine = sni.newLine
                 ln1.netValue = 200.0
                 ln1.VatCategory = 2
                 ln1.VatAmount = 13.0
                 ln1.classification.Type = "" ' This field refers to the E3 code
                 ln1.classification.Category = "category1_95"
 
                 invoice.lines.Add(ln1)
             Next
 #End Region
 
 #Region "payments"
             Dim tmpPay As paymentMethod = sni.newPaymentMethod
             tmpPay.type = 1
             tmpPay.amount = 948.0
             invoice.payments.Add(tmpPay)
 #End Region
             invoices.Add(invoice)
         Next
 
         Dim result As Dictionary(Of String, Object) = sni.SendInvoice(invoices, True)					
This language is not supported or no code example is available.

.NET Framework

Supported in: 3.5 or newer

In this article

Definition