GetInvoice - accountsIQ/API-Wiki GitHub Wiki

The GetInvoice function retrieves an invoice given its unique identifier.

Declaration

C#

public WSResult2OfInvoice GetInvoice(string token, int invoiceID)

Visual Basic

Public Function GetInvoice(ByVal token As String, ByVal invoiceID As Integer) As WSResult2OfInvoice

Parameter List

Parameter Type Description
token String The session token retrieved during authentication.
invoiceID Int32 Unique reference to look the invoice up with.

Example

The following example loads a pre-existing invoice from the system (invoice with ID 125):

C#

Integration ws = new Integration();

String auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
    // Get the invoice ID from a listing method
    int invoiceID = 125;
    WSResult2OfInvoice invoice = ws.GetInvoice(auth, invoiceID);
    Assert.IsTrue(invoice.Result != null && invoice.Status == OperationStatus.Success);
    // Use the invoice and maybe save it back to the system
}

Visual Basic

Dim ws As New Integration

Dim auth As String = ws.Login(entityID, partnerKey, userKey)
If (Not auth Is Nothing) Then
  ' Get the invoice from a listing method
  Dim invoiceID As Integer = 125
  Dim invoice As WSResult2OfInvoice = ws.GetInvoice(Me.auth, invoiceID)
  Assert.IsTrue(((Not invoice.Result Is Nothing) AndAlso (invoice.Status = OperationStatus.Success)))
  ' Use the invoice.
End If

See Also

⚠️ **GitHub.com Fallback** ⚠️