3. Retrive Invoices

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

There are two types of retrieved invoices:

  1. The invoices sent by the entity (mostly income)
  2. The invoice sent to the entity (mostly expenses)

In this example, we will work with the invoices sent by the entity.

  1. Call the constructor of RequestInvoices: RequestInvoices Constructor 
    RequestInvoices rqd = new RequestInvoices("AADEUserID", "OcpApimSubscriptionKey", _
                                               "ExecuteEntityVatNumber", "Arbitrans User", _
                                               "Arbitrans Key", false);					
    This language is not supported or no code example is available.
    Dim rqd As RequestInvoices = New RequestInvoices("AADEUserID", "OcpApimSubscriptionKey", _
                                                      "ExecuteEntityVatNumber", "Arbitrans User", _
                                                      "Arbitrans Key", False)					
    This language is not supported or no code example is available.
  2. Request Invoices from myDATA, using the Request Method
    The parameters of the request method are as follows: 
    Request(<starting mark Number>, <max Pages to Retrieve>, <Type of Search>, <Search Criteria>
    rqd.Request(0, 5, 1, Nothing);					
    This language is not supported or no code example is available.
    rqd.Request(0, 5, 1, Nothing)					
    This language is not supported or no code example is available.

    The request given above simply tells myDATA that: 
    Get me all the invoices starting with Mark 0, with a maximum of 5 pages (1 page = 1000 invoices), from the invoices sent by the Entity.

  3. Store the retrieved invoices into a DataTable, using the getInvoices Method
    DataTable dt = rqd.getInvoices();					
    This language is not supported or no code example is available.
    Dim dt As DataTable = rqd.getInvoices()					
    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 RequestInvoices()
     {
         RequestInvoices rqd = new RequestInvoices("AADEUserID", "OcpApimSubscriptionKey", _
                                                   "ExecuteEntityVatNumber", "Arbitrans User", _
                                                   "Arbitrans Key", false);
 
 
         rqd.Request(0, 5, 1, default);
         DataTable dt = rqd.getInvoices();
     }
 }					
This language is not supported or no code example is available.
Imports ArbitransMyData
 Imports ArbitransMyData.MyDataApi
 
 Public Class myClass
  Public Sub RequestInvoices
   Dim rqd As RequestInvoices = New RequestInvoices("AADEUserID", "OcpApimSubscriptionKey", _
                                                    "ExecuteEntityVatNumber", "Arbitrans User", _
                                                    "Arbitrans Key", False)
 
   rqd.Request(0, 5, 1, Nothing)
   Dim dt As DataTable = rqd.getInvoices()
  End Sub
 End Class					
This language is not supported or no code example is available.

In this article

Definition