-
Notifications
You must be signed in to change notification settings - Fork 2
GetInvoiceFromOrder
PatrickLane edited this page Oct 30, 2014
·
1 revision
The GetInvoiceFromOrder
function creates an invoice from a partially/fully delivered order. The order is only promoted to an invoice once the invoice is saved back to the system and will not be changed before this happens.
public WSResult2OfInvoice GetInvoiceFromOrder(string token, int orderID)
Public Function GetInvoiceFromOrder(ByVal token As String, ByVal orderID As Integer) As WSResult2OfInvoice
Parameter | Type | Description |
---|---|---|
token | String | The session token retrieved during authentication. |
orderID | Int16 | Unique identifier of the order to promote to an invoice. |
An order is created and fully delivered on the system. In order to create an invoice from this order, the GetInvoiceFromOrder
function is called and returns a new Sales Invoice based on the provided order. At that stage, as far as the accountsIQ system is concerned, the order has not been promoted to an invoice. It will be only once the invoice is saved back to the system by the web service user.
In the following example, a pre-existing order is promoted to an order:
Integration ws = new Integration();
String auth = ws.Login(entityID, partnerKey, userKey);
if (auth != null)
{
int orderToPromoteID = 128;
WSResult2OfInvoice order = ws.GetInvoiceFromOrder(auth, orderToPromoteID);
if (order.Status == OperationStatus.Success)
{
// Modify, complete and save the invoice
}
else
{
// Examine the ErrorCode field for more information on the error.
}
}