-
Notifications
You must be signed in to change notification settings - Fork 2
GetInvoice
PatrickLane edited this page Oct 30, 2014
·
1 revision
The GetInvoice
function retrieves an invoice given its unique identifier.
public WSResult2OfInvoice GetInvoice(string token, int invoiceID)
Public Function GetInvoice(ByVal token As String, ByVal invoiceID As Integer) As WSResult2OfInvoice
Parameter | Type | Description |
---|---|---|
token | String | The session token retrieved during authentication. |
invoiceID | Int32 | Unique reference to look the invoice up with. |
The following example loads a pre-existing invoice from the system (invoice with ID 125):
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
}
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