GetInvoiceFromOrder - accountsIQ/API-Wiki GitHub Wiki

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.

Declaration

C#

public WSResult2OfInvoice GetInvoiceFromOrder(string token, int orderID)

Visual Basic

Public Function GetInvoiceFromOrder(ByVal token As String, ByVal orderID As Integer) As WSResult2OfInvoice

Parameter List

Parameter Type Description
token String The session token retrieved during authentication.
orderID Int16 Unique identifier of the order to promote to an invoice.

Example

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:

C#

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.
    }
}

See Also

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