Ongoing Warehouse logo

Ongoing Warehouse Developer

GetInvoices

Ongoing has an invoicing module which the warehouse can use to create invoices for its customers. This function can be used to retrieve those invoices. The intended use-case is for an accounting package to be able to integrate with Ongoing, so that the invoices can be easily transferred automatically from Ongoing to the accounting package.

An invoice consists of several invoice rows. In turn, each invoice row was created either manually by a user, or it was computed automatically using statistics. You can tell the difference using the IStatistics (sic) field.

As an example, consider a warehouse that wants to bill its 3PL customer in two ways:

  1. They want to charge $5 for every order that they picked.
  2. When picking very bulky orders, they need to get a special forklift out, and they want to bill the customer an additional $50 extra for this every time.
The first charge is a typical example of something that would be set up as a statistics charge in Ongoing. The second one is a typical example of a manual charge.

Tags: GetInvoices , query, GetInvoicesResult, Invoice, InvoiceRow, InvoiceArticle

Request XML

POST /xxx/Service.asmx HTTP/1.1
Host: api.ongoingsystems.se
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://ongoingsystems.se/WSI/GetInvoices"

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetInvoices xmlns="http://ongoingsystems.se/WSI">
      <UserName>string</UserName>
      <Password>string</Password>
      <query>
        <GetInvoiceRows>boolean</GetInvoiceRows>
        <InvoiceDateFrom>dateTime</InvoiceDateFrom>
        <InvoiceDateTo>dateTime</InvoiceDateTo>
        <GetInvoiceId>
          <int>int</int>
          <int>int</int>
        </GetInvoiceId>
        <IsExported>boolean</IsExported>
        <InvoiceExportedDateFrom>dateTime</InvoiceExportedDateFrom>
        <InvoiceExportedDateTo>dateTime</InvoiceExportedDateTo>
      </query>
    </GetInvoices>
  </soap:Body>
</soap:Envelope>
+

Request specification

GetInvoices
UserName str(50) Req. Your username
Password str(50) Req. Your password
query object Req. An element of type query.
query
GetInvoiceRows bool True if you want the function to return information about the invoice rows as well.
InvoiceDateFrom datetime Filter for the lower bound of the invoice creation date.
InvoiceDateTo datetime Filter for the upper bound of the invoice creation date.
GetInvoiceId int[] Only return information about these invoice ids.
IsExported bool True if you want to filter for invoices which have been marked as exported, or false if you only want invoices which haven't been marked as exported.
InvoiceExportedDateFrom datetime Filter for the invoice export date (from).
InvoiceExportedDateTo datetime Filter for the invoice export date (to).

Response XML

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetInvoicesResponse xmlns="http://ongoingsystems.se/WSI">
      <GetInvoicesResult>
        <Invoices>
          <Invoice>
            <GoodsOwner xsi:nil="true" />
            <InvoiceRows xsi:nil="true" />
            <InvoiceNumber>string</InvoiceNumber>
            <InvoiceId>int</InvoiceId>
            <Title>string</Title>
            <InvoiceDate>dateTime</InvoiceDate>
            <InvoicePeriodStart>dateTime</InvoicePeriodStart>
            <InvoicePeriodEnd>dateTime</InvoicePeriodEnd>
            <InvoiceAmount>decimal</InvoiceAmount>
            <IsExported>boolean</IsExported>
            <ShipmentId>int</ShipmentId>
            <InvoiceYourOrderNumber>string</InvoiceYourOrderNumber>
            <InvoiceYourReference>string</InvoiceYourReference>
            <PayerOrganisationId>int</PayerOrganisationId>
          </Invoice>
          <Invoice>
            <GoodsOwner xsi:nil="true" />
            <InvoiceRows xsi:nil="true" />
            <InvoiceNumber>string</InvoiceNumber>
            <InvoiceId>int</InvoiceId>
            <Title>string</Title>
            <InvoiceDate>dateTime</InvoiceDate>
            <InvoicePeriodStart>dateTime</InvoicePeriodStart>
            <InvoicePeriodEnd>dateTime</InvoicePeriodEnd>
            <InvoiceAmount>decimal</InvoiceAmount>
            <IsExported>boolean</IsExported>
            <ShipmentId>int</ShipmentId>
            <InvoiceYourOrderNumber>string</InvoiceYourOrderNumber>
            <InvoiceYourReference>string</InvoiceYourReference>
            <PayerOrganisationId>int</PayerOrganisationId>
          </Invoice>
        </Invoices>
      </GetInvoicesResult>
    </GetInvoicesResponse>
  </soap:Body>
</soap:Envelope>
+

Response specification

GetInvoicesResult
Invoices Invoice[] List of invoices matching the filter.
Invoice
GoodsOwner object Contains information about which goodsowner the invoice belongs to.
InvoiceRows object A list of InvoiceRows.
InvoiceNumber str(50) Invoice number.
InvoiceId int Ongoing's unique internal id for the invoice.
Title str(500) The title of the invoice.
InvoiceDate datetime The date when the invoice was created.
InvoicePeriodStart datetime The start date of the invoice period.
InvoicePeriodEnd datetime The end date of the invoice period.
InvoiceAmount dec The total amount of money on the invoice.
IsExported bool Whether or not the invoice has been exported to an external system.
ShipmentId int Obsolete. Not used.
InvoiceYourOrderNumber str(200) The external order number reference.
InvoiceYourReference str(300) The external invoice reference.
PayerOrganisationId int The id of the organization which the invoice belongs to.
InvoiceRow
InvoiceRowId int Ongoing's internal unique id for this invoice row.
Price dec The price for this invoice row.
UnitPrice dec The unit price. You should generally have Price = UnitPrice * NumberOfItems.
Currency str The currency.
IsTentative bool Whether or not this charge is mandatory to have on an invoice. Note that "tentative" is a misspelling and should be "mandatory".
IStatistics bool Whether or not this charge was computed using statistics.
IsFormula bool Whether or not this charge was priced using a formula.
NumberOfItems dec The number of items which have been charged on this row.
ContainerBatch str Container number or batch number.
ActionDate datetime The time when the charge was added.
RowReference str Row reference.
RowComment str Row comment.
ProiftCenterTitle str Obsolete. Not used.
ProiftCenterCode str The code of the charge.
OrderNumber str The order number (if the charge was due to an order).
OrderConsigneeName str The consignee name on the order (if the charge was due to an order).
OrderId int The order id (if the charge was due to an order).
OrderConsigneeId int The consignee id (if the charge was due to an order).
OrderDeliveryDate datetime The delivery date of the order (if the charge was due to an order).
OrderReferenceNumber str The reference number of the order (if the charge was due to an order).
OrderConsigneeCountryName str The consignee's country name (if the charge was due to an order).
OrderConsigneeCountryCode str The consignee's country code (if the charge was due to an order).
TotalOrderCharges dec Obsolete. Not used.
OrderConsigneePostCode str The consignee's post code (if the charge was due to an order).
OrderRemark str The order remark (if the charge was due to an order).
OrderWaybill str The order waybill (if the charge was due to an order).
OrderTransporterName str The order transporter (if the charge was due to an order).
ExternalInvoiceRowId str Obsolete. Not used.
InvoiceArticle object An object of type InvoiceArticle.
IsCalculatedIncome bool Obsolete. Not used.
InvoiceArticle
Code str The code of the charge.
Title str The title of the charge.
Account str The account which the charge belongs to.