Ongoing Warehouse logo

Ongoing Warehouse Developer

GetInvoicesByQuery

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 charges. In turn, each charge was created either manually by a user, or it was computed automatically using statistics.

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: GetInvoicesByQuery , Query, GetInvoicesByQueryResult, AutomationInvoice, GoodsOwner, InvoiceCharge, InvoiceArticle, OrderContext, InOrderContext, ProductionOrderContext

Request XML

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

<?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>
    <GetInvoicesByQuery xmlns="http://ongoingsystems.se/Automation">
      <UserName>string</UserName>
      <Password>string</Password>
      <Query>
        <GetInvoiceRows>boolean</GetInvoiceRows>
        <OnlyLiveGoodsOwners>boolean</OnlyLiveGoodsOwners>
        <InvoiceIds>
          <int>int</int>
          <int>int</int>
        </InvoiceIds>
        <GoodsOwnerIds>
          <int>int</int>
          <int>int</int>
        </GoodsOwnerIds>
        <IsExported>boolean</IsExported>
        <InvoiceExportedDateFrom>dateTime</InvoiceExportedDateFrom>
        <InvoiceExportedDateTo>dateTime</InvoiceExportedDateTo>
        <InvoiceDateFrom>dateTime</InvoiceDateFrom>
        <InvoiceDateTo>dateTime</InvoiceDateTo>
        <MaxInvoicesToGet>int</MaxInvoicesToGet>
        <InvoiceIdFrom>int</InvoiceIdFrom>
      </Query>
    </GetInvoicesByQuery>
  </soap:Body>
</soap:Envelope>
+

Request specification

GetInvoicesByQuery
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.
OnlyLiveGoodsOwners bool True if you want the function to only return information about invoices from live goods owners.
InvoiceIds int[] Only return these InvoiceIds.
GoodsOwnerIds int[] Only return invoices for these goods owners.
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).
InvoiceDateFrom datetime Filter for the lower bound of the invoice creation date.
InvoiceDateTo datetime Filter for the upper bound of the invoice creation date.
MaxInvoicesToGet int The maximum number of invoices to return.
InvoiceIdFrom int Only return invoices whose ids are greater than or equal to this value.

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>
    <GetInvoicesByQueryResponse xmlns="http://ongoingsystems.se/Automation">
      <GetInvoicesByQueryResult>
        <Success>boolean</Success>
        <Message>string</Message>
        <Invoices>
          <AutomationInvoice>
            <GoodsOwner xsi:nil="true" />
            <InvoiceCharges 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>
            <InvoiceYourOrderNumber>string</InvoiceYourOrderNumber>
            <InvoiceYourReference>string</InvoiceYourReference>
          </AutomationInvoice>
          <AutomationInvoice>
            <GoodsOwner xsi:nil="true" />
            <InvoiceCharges 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>
            <InvoiceYourOrderNumber>string</InvoiceYourOrderNumber>
            <InvoiceYourReference>string</InvoiceYourReference>
          </AutomationInvoice>
        </Invoices>
      </GetInvoicesByQueryResult>
    </GetInvoicesByQueryResponse>
  </soap:Body>
</soap:Envelope>
+

Response specification

GetInvoicesByQueryResult
Invoices Invoice[] List of invoices matching the filter.
AutomationInvoice
GoodsOwner object Contains information about which goods owner the invoice belongs to, see GoodsOwner.
InvoiceCharges object A list of InvoiceCharges.
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.
InvoiceYourOrderNumber str(200) The external order number reference.
InvoiceYourReference str(300) The external invoice reference.
GoodsOwner
GoodsOwnerId int The internal Ongoing id of the goods owner.
GoodsOwnerCode string The name of the goods owner.
FinancialCode string Goods owner's financial code.
GoodsLocationCode string Goods owner's location code.
GoodsOwnerReference string Goods owner reference.
GoodsOwnerInvoiceCurrencyCode string The invoice which is used for the goods owner's invoices.
InvoiceCharges
ChargeId int Ongoing's internal unique id for this charge.
Price dec The price for this invoice row.
NumberOfItems dec The number of items which have been charged on this row.
ActionDate datetime The time when the charge was added.
Comment str Comment.
ProiftCenterCode str The code of the charge.
InvoiceArticle object Object of type InvoiceArticle.
OrderContext object If this charge is connected to an order, this will be an object of type OrderContext. Otherwise it will be null.
InOrderContext object If this charge is connected to an inorder, this will be an object of type InOrderContext. Otherwise it will be null.
ProductionOrderContext object If this charge is connected to a production order, this will be an object of type ProductionOrderContext. Otherwise it will be null.
InvoiceArticle
Code str The code of the charge.
Title str The title of the charge.
Account str The account which the charge belongs to.
Id int Ongoing's internal id for this invoice article.
OrderContext
OrderId int Ongoing's internal id for the order.
OrderNumber str Order number.
DeliveryDate datetime The order's delivery date.
Consignee object Contains information about the consignee, such as name and country.
ReferenceNumber str Order reference.
Remark str Order remark.
Waybill str Order waybill.
TransporterServiceCode str Order's transporter service code.
ReturnTransporterServiceCode str Order's transporter service code for the return shipment.
InOrderContext
InOrderId int Ongoing's internal id for the inorder.
InOrderNumber str InOrder number.
ProductionOrderContext
ProductionOrderId int Ongoing's internal id for the production order.