GetInvoicesByExternalReference - accountsIQ/API-Wiki GitHub Wiki

The GetInvoicesByExternalReference function retrieves a list of sales order that have a given external reference.

Declaration

C#

public WSResult2OfArrayOfInvoice GetInvoicesByExternalReference(string token, string externalReference)

Visual Basic

Public Function GetInvoicesByExternalReference(ByVal token As String, ByVal externalReference As String) As WSResult2OfArrayOfInvoice

Parameter List

Parameter Type Description
token String The session token retrieved during authentication.
externalReference String External reference to look the invoice up with.

Example

C#

Integration ws = new Integration();

String auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
    WSResult2OfArrayOfInvoice invoices = ws.GetInvoicesByExternalReference(auth, "4/07");
    if (invoices.Status == OperationStatus.Success && invoices.Result != null)
    {
        foreach (Invoice invoice in invoices.Result)
        {
            // Do something with each invoice.
        }
    }
    else
    {
        // Examine the ErrorCode field for more information on the error.
    }
}

Visual Basic

Dim ws As New Integration

Dim auth As String = ws.Login(entityID, partnerKey, userKey)
If (Not Me.auth Is Nothing) Then
    Dim invoices As WSResult2OfArrayOfInvoice = Me.ws.GetInvoicesByExternalReference(Me.auth, "4/07")
    If ((invoices.Status = OperationStatus.Success) AndAlso (Not invoices.Result Is Nothing)) Then
        Dim invoice As Invoice
        For Each invoice In invoices.Result
          ' Do something with each invoice
        Next
    End If
    Else
      ' Examine the ErrorCode field for more information on the error.
    End If
End If

See Also

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