GetOrdersByExternalReference - accountsIQ/API-Wiki GitHub Wiki

The GetOrdersByExternalReference function retrieves a list of sales orders that have a given external reference.

Declaration

C#

public WSResult2OfArrayOfOrder GetOrdersByExternalReference(string token, string externalReference)

Visual Basic

Public Function GetOrdersByExternalReference(ByVal token As String, ByVal externalReference As String) As WSResult2OfArrayOfOrder

Parameter List

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

Example

C#

Integration ws = new Integration();

String auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
  WSResult2OfArrayOfOrder Orders = ws.GetOrdersByExternalReference(auth, "4/07");
  if (Orders.Status == OperationStatus.Success && Orders.Result != null)
  {
    foreach (Order Order in Orders.Result)
    {
     // Do something with each Order.
    }
  }
  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 Orders As WSResult2OfArrayOfOrder = Me.ws.GetOrdersByExternalReference(Me.auth, "4/07")
  If ((Orders.Status = OperationStatus.Success) AndAlso (Not Orders.Result Is Nothing)) Then
    Dim Order As Order
    For Each Order In Orders.Result
      ' Do something with each Order
    Next
  End If
  Else
    ' Examine the ErrorCode field for more information on the error.
  End If
End If

See Also

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