2. Sending a new Invoice

This guide will help you implement the myDATA dll and send your first invoice.

  1. Call the constructor of SendIvnoice: SendIvnoice Constructor
    var sni = new SendInvoices("AADEUserID", "OcpApimSubscriptionKey", "Arbitrans User", "Arbitrans Key", false);					
    This language is not supported or no code example is available.
    Dim sni As New SendInvoices("AADEUserID", "OcpApimSubscriptionKey", "Arbitrans User", "Arbitrans Key", False)					
    This language is not supported or no code example is available.
  2. Create an invoice, type of invoice: Invoice data type
    invoice invoice = sni.newInvoice;					
    This language is not supported or no code example is available.
    Dim invoice As invoice = sni.newInvoice					
    This language is not supported or no code example is available.
  3. Fill the invoice data, as in the final code below.
  4. Send the invoice.
    string result = sni.SendInvoice(invoice);					
    This language is not supported or no code example is available.
    Dim result As String = sni.SendInvoice(invoice)					
    This language is not supported or no code example is available.

The final code will resemble this after the above steps have been followed:

using ArbitransMyData;
 using ArbitransMyData.MyDataApi;
 
 
 public partial class myClass
 {
     public void sendInvoice()
     {
         var sni = new SendInvoices("AADEUserID", "OcpApimSubscriptionKey", "Arbitrans User", "Arbitrans Key", false);
         invoice invoice = sni.newInvoice;
         invoice.issuer.vatNumber = "555777001";
         invoice.issuer.country = "GR";
 
 
         // more code here
         // more code here
 
         invoice.elements.series = "IZ";
         invoice.elements.aa = 1;
 
         // more code here
         // more code here
 
 
         // code for adding invoice lines
         invoiceLine ln = sni.newLine;
         ln.netValue = 100.0d;
         ln.vatAmount = 24.0d;
         // more code here
         // more code here
         invoice.lines.Add(ln);
         // code for adding invoice lines
 
 
         // code for adding payment methods
         paymentMethod pay = sni.newPaymentMethod;
         pay.type = 1;
         pay.amount = 124.0d;
         invoice.payments.add(pay);
         // code for adding payment methods
 
 
         string result = sni.SendInvoice(invoice);
     }
 }					
This language is not supported or no code example is available.
Imports ArbitransMyData
 Imports ArbitransMyData.MyDataApi
  
 Public Class myClass
  Public Sub sendInvoice()
   Dim sni As New SendInvoices("AADEUserID", "OcpApimSubscriptionKey", "Arbitrans User", "Arbitrans Key", False)
   Dim invoice As invoice = sni.newInvoice
   invoice.issuer.vatNumber = "555777001"
   invoice.issuer.country = "GR"
   
   'more code here
   'more code here
 
   invoice.elements.series = "IZ"
   invoice.elements.aa = 1
 
   'more code here
   'more code here
   
   'code for adding invoice lines
   Dim ln As invoiceLine = sni.newLine
   ln.netValue = 100.0
   ln.vatAmount = 24.0
   'more code here
   'more code here
   invoice.lines.Add(ln)
   'code for adding invoice lines
   
   'code for adding payment methods
   Dim pay as paymentMethod = sni.newPaymentMethod
   pay.type = 1
   pay.amount = 124.0
   invoice.payments.add(pay)
   'code for adding payment methods
   
   Dim result As String = sni.SendInvoice(invoice)  
  End Sub
 End Class					
This language is not supported or no code example is available.

Remarks
 
See a full example.

In this article

Definition