GetInvoicesByQuery

Ongoing WMS 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 WMS, so that the invoices can be easily transferred automatically from Ongoing WMS 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 WMS. The second one is a typical example of a manual charge.

Not all API users have access to this function. The API user needs the permission Allow this user to see invoicing information in the API.

Tags: GetInvoicesByQuery, GetInvoicesQueryV2, GetInvoicesByQueryResponse, GetInvoicesResultV2, InvoiceV2, GetInvoicesGoodsOwnerInfoV2, GetInvoicesChargeV2, GetInvoicesGoodsOwnerGroupInfoV2, GetInvoicesArticleV2, GetInvoicesOrderContextV2, GetInvoicesInOrderContextV2, GetInvoicesProductionOrderContextV2, GetInvoicesPalletItemContextV2, GetInvoicesArticleItemContextV2, GetInvoicesArticleContextV2, GetInvoicesOrderConsigneeV2

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/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/WSI">
      <GoodsOwnerCode>string</GoodsOwnerCode>
      <UserName>string</UserName>
      <Password>string</Password>
      <query>
        <GetInvoiceRows>boolean</GetInvoiceRows>
        <InvoiceIds>
          <int>int</int>
          <int>int</int>
        </InvoiceIds>
        <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
GoodsOwnerCode string(400) Req. The name/code of your client
UserName string(50) Req. Your username
Password string(50) Req. Your password
query GetInvoicesQueryV2 Req. The query object
GetInvoicesQueryV2
GetInvoiceRows boolean True if you want the function to return information about the invoice rows as well.
InvoiceIds int[] Only return these InvoiceIds.
IsExported boolean 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

<?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/WSI">
      <GetInvoicesByQueryResult>
        <Success>boolean</Success>
        <Message>string</Message>
        <Invoices>
          <InvoiceV2>
            <GoodsOwner>
              <GoodsOwnerId>int</GoodsOwnerId>
              <GoodsOwnerCode>string</GoodsOwnerCode>
              <FinancialCode>string</FinancialCode>
              <GoodsLocationCode>string</GoodsLocationCode>
              <GoodsOwnerReference>string</GoodsOwnerReference>
              <GoodsOwnerInvoiceCurrencyCode>string</GoodsOwnerInvoiceCurrencyCode>
              <GoodsOwnerGroup>
                <Id>int</Id>
                <Code>string</Code>
                <Name>string</Name>
              </GoodsOwnerGroup>
            </GoodsOwner>
            <InvoiceCharges>
              <GetInvoicesChargeV2>
                <ChargeId>int</ChargeId>
                <Price>decimal</Price>
                <NumberOfItems>decimal</NumberOfItems>
                <ActionDate>dateTime</ActionDate>
                <Comment>string</Comment>
                <ProfitCenterCode>string</ProfitCenterCode>
                <InvoiceArticle>
                  <Code>string</Code>
                  <Title>string</Title>
                  <Account>string</Account>
                  <Id>int</Id>
                </InvoiceArticle>
                <OrderContext>
                  <OrderId>int</OrderId>
                  <OrderNumber>string</OrderNumber>
                  <DeliveryDate>dateTime</DeliveryDate>
                  <Consignee>
                    <Id>int</Id>
                    <Name>string</Name>
                    <CountryCode>string</CountryCode>
                    <PostCode>string</PostCode>
                  </Consignee>
                  <ReferenceNumber>string</ReferenceNumber>
                  <Remark>string</Remark>
                  <Waybill>string</Waybill>
                  <TransporterServiceCode>string</TransporterServiceCode>
                  <ReturnTransporterServiceCode>string</ReturnTransporterServiceCode>
                </OrderContext>
                <InOrderContext>
                  <InOrderId>int</InOrderId>
                  <InOrderNumber>string</InOrderNumber>
                </InOrderContext>
                <ProductionOrderContext>
                  <ProductionOrderId>int</ProductionOrderId>
                </ProductionOrderContext>
                <PalletItemContext>
                  <PalletItemId>int</PalletItemId>
                  <LabelId>string</LabelId>
                </PalletItemContext>
                <ArticleItemContext>
                  <ArticleItemId>int</ArticleItemId>
                  <ArticleDefId>int</ArticleDefId>
                  <ScannedSerial>string</ScannedSerial>
                </ArticleItemContext>
                <ArticleContext>
                  <ArticleDefId>int</ArticleDefId>
                </ArticleContext>
                <Container>string</Container>
              </GetInvoicesChargeV2>
              <GetInvoicesChargeV2>
                <ChargeId>int</ChargeId>
                <Price>decimal</Price>
                <NumberOfItems>decimal</NumberOfItems>
                <ActionDate>dateTime</ActionDate>
                <Comment>string</Comment>
                <ProfitCenterCode>string</ProfitCenterCode>
                <InvoiceArticle>
                  <Code>string</Code>
                  <Title>string</Title>
                  <Account>string</Account>
                  <Id>int</Id>
                </InvoiceArticle>
                <OrderContext>
                  <OrderId>int</OrderId>
                  <OrderNumber>string</OrderNumber>
                  <DeliveryDate>dateTime</DeliveryDate>
                  <Consignee>
                    <Id>int</Id>
                    <Name>string</Name>
                    <CountryCode>string</CountryCode>
                    <PostCode>string</PostCode>
                  </Consignee>
                  <ReferenceNumber>string</ReferenceNumber>
                  <Remark>string</Remark>
                  <Waybill>string</Waybill>
                  <TransporterServiceCode>string</TransporterServiceCode>
                  <ReturnTransporterServiceCode>string</ReturnTransporterServiceCode>
                </OrderContext>
                <InOrderContext>
                  <InOrderId>int</InOrderId>
                  <InOrderNumber>string</InOrderNumber>
                </InOrderContext>
                <ProductionOrderContext>
                  <ProductionOrderId>int</ProductionOrderId>
                </ProductionOrderContext>
                <PalletItemContext>
                  <PalletItemId>int</PalletItemId>
                  <LabelId>string</LabelId>
                </PalletItemContext>
                <ArticleItemContext>
                  <ArticleItemId>int</ArticleItemId>
                  <ArticleDefId>int</ArticleDefId>
                  <ScannedSerial>string</ScannedSerial>
                </ArticleItemContext>
                <ArticleContext>
                  <ArticleDefId>int</ArticleDefId>
                </ArticleContext>
                <Container>string</Container>
              </GetInvoicesChargeV2>
            </InvoiceCharges>
            <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>
          </InvoiceV2>
          <InvoiceV2>
            <GoodsOwner>
              <GoodsOwnerId>int</GoodsOwnerId>
              <GoodsOwnerCode>string</GoodsOwnerCode>
              <FinancialCode>string</FinancialCode>
              <GoodsLocationCode>string</GoodsLocationCode>
              <GoodsOwnerReference>string</GoodsOwnerReference>
              <GoodsOwnerInvoiceCurrencyCode>string</GoodsOwnerInvoiceCurrencyCode>
              <GoodsOwnerGroup>
                <Id>int</Id>
                <Code>string</Code>
                <Name>string</Name>
              </GoodsOwnerGroup>
            </GoodsOwner>
            <InvoiceCharges>
              <GetInvoicesChargeV2>
                <ChargeId>int</ChargeId>
                <Price>decimal</Price>
                <NumberOfItems>decimal</NumberOfItems>
                <ActionDate>dateTime</ActionDate>
                <Comment>string</Comment>
                <ProfitCenterCode>string</ProfitCenterCode>
                <InvoiceArticle>
                  <Code>string</Code>
                  <Title>string</Title>
                  <Account>string</Account>
                  <Id>int</Id>
                </InvoiceArticle>
                <OrderContext>
                  <OrderId>int</OrderId>
                  <OrderNumber>string</OrderNumber>
                  <DeliveryDate>dateTime</DeliveryDate>
                  <Consignee>
                    <Id>int</Id>
                    <Name>string</Name>
                    <CountryCode>string</CountryCode>
                    <PostCode>string</PostCode>
                  </Consignee>
                  <ReferenceNumber>string</ReferenceNumber>
                  <Remark>string</Remark>
                  <Waybill>string</Waybill>
                  <TransporterServiceCode>string</TransporterServiceCode>
                  <ReturnTransporterServiceCode>string</ReturnTransporterServiceCode>
                </OrderContext>
                <InOrderContext>
                  <InOrderId>int</InOrderId>
                  <InOrderNumber>string</InOrderNumber>
                </InOrderContext>
                <ProductionOrderContext>
                  <ProductionOrderId>int</ProductionOrderId>
                </ProductionOrderContext>
                <PalletItemContext>
                  <PalletItemId>int</PalletItemId>
                  <LabelId>string</LabelId>
                </PalletItemContext>
                <ArticleItemContext>
                  <ArticleItemId>int</ArticleItemId>
                  <ArticleDefId>int</ArticleDefId>
                  <ScannedSerial>string</ScannedSerial>
                </ArticleItemContext>
                <ArticleContext>
                  <ArticleDefId>int</ArticleDefId>
                </ArticleContext>
                <Container>string</Container>
              </GetInvoicesChargeV2>
              <GetInvoicesChargeV2>
                <ChargeId>int</ChargeId>
                <Price>decimal</Price>
                <NumberOfItems>decimal</NumberOfItems>
                <ActionDate>dateTime</ActionDate>
                <Comment>string</Comment>
                <ProfitCenterCode>string</ProfitCenterCode>
                <InvoiceArticle>
                  <Code>string</Code>
                  <Title>string</Title>
                  <Account>string</Account>
                  <Id>int</Id>
                </InvoiceArticle>
                <OrderContext>
                  <OrderId>int</OrderId>
                  <OrderNumber>string</OrderNumber>
                  <DeliveryDate>dateTime</DeliveryDate>
                  <Consignee>
                    <Id>int</Id>
                    <Name>string</Name>
                    <CountryCode>string</CountryCode>
                    <PostCode>string</PostCode>
                  </Consignee>
                  <ReferenceNumber>string</ReferenceNumber>
                  <Remark>string</Remark>
                  <Waybill>string</Waybill>
                  <TransporterServiceCode>string</TransporterServiceCode>
                  <ReturnTransporterServiceCode>string</ReturnTransporterServiceCode>
                </OrderContext>
                <InOrderContext>
                  <InOrderId>int</InOrderId>
                  <InOrderNumber>string</InOrderNumber>
                </InOrderContext>
                <ProductionOrderContext>
                  <ProductionOrderId>int</ProductionOrderId>
                </ProductionOrderContext>
                <PalletItemContext>
                  <PalletItemId>int</PalletItemId>
                  <LabelId>string</LabelId>
                </PalletItemContext>
                <ArticleItemContext>
                  <ArticleItemId>int</ArticleItemId>
                  <ArticleDefId>int</ArticleDefId>
                  <ScannedSerial>string</ScannedSerial>
                </ArticleItemContext>
                <ArticleContext>
                  <ArticleDefId>int</ArticleDefId>
                </ArticleContext>
                <Container>string</Container>
              </GetInvoicesChargeV2>
            </InvoiceCharges>
            <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>
          </InvoiceV2>
        </Invoices>
      </GetInvoicesByQueryResult>
    </GetInvoicesByQueryResponse>
  </soap:Body>
</soap:Envelope>

Response specification

GetInvoicesByQueryResponse
GetInvoicesByQueryResult GetInvoicesResultV2
GetInvoicesResultV2
Success boolean Indicates whether or not the call was succesful.
Message string Error message.
Invoices InvoiceV2[] List of invoices.
InvoiceV2
GoodsOwner GetInvoicesGoodsOwnerInfoV2 Contains information about which goods owner the invoice belongs to, see GoodsOwner.
InvoiceCharges GetInvoicesChargeV2[] A list of GetInvoicesChargeV2.
InvoiceNumber string(50) Invoice number.
InvoiceId int Ongoing WMS' public internal id for the invoice.
Title string(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 decimal The total amount of money on the invoice.
IsExported boolean Whether or not the invoice has been exported to an external system.
InvoiceYourOrderNumber string(200) The external order number reference.
InvoiceYourReference string(300) The external invoice reference.
GetInvoicesGoodsOwnerInfoV2
GoodsOwnerId int The internal Ongoing WMS 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.
GoodsOwnerGroup GetInvoicesGoodsOwnerGroupInfoV2 Contains info about the goods owner group (if any).
GetInvoicesChargeV2
ChargeId int Ongoing WMS' internal public id for this charge.
Price decimal The price for this invoice row.
NumberOfItems decimal The number of items which have been charged on this row.
ActionDate dateTime The time when the charge was added.
Comment string Comment.
ProfitCenterCode string Profit center code.
InvoiceArticle GetInvoicesArticleV2 An element of type GetInvoicesArticleV2.
OrderContext GetInvoicesOrderContextV2 If this charge is connected to an order, this will be an object of type GetInvoicesOrderContextV2. Otherwise it will be null.
InOrderContext GetInvoicesInOrderContextV2 If this charge is connected to an inorder, this will be an object of type GetInvoicesInOrderContextV2. Otherwise it will be null.
ProductionOrderContext GetInvoicesProductionOrderContextV2 If this charge is connected to a production order, this will be an object of type GetInvoicesProductionOrderContextV2. Otherwise it will be null.
PalletItemContext GetInvoicesPalletItemContextV2 If this charge is connected to a pallet item, this will be an object of type GetInvoicesPalletItemContextV2. Otherwise it will be null.
ArticleItemContext GetInvoicesArticleItemContextV2 If this charge is connected to an article item order, this will be an object of type GetInvoicesArticleItemContextV2. Otherwise it will be null.
ArticleContext GetInvoicesArticleContextV2 If this charge is connected to an article (SKU), this will be an object of type GetInvoicesArticleContextV2. Otherwise it will be null.
Container string The charge's container reference.
GetInvoicesGoodsOwnerGroupInfoV2
Id int The unique ID of the goods owner group.
Code string Goods owner group code.
Name string Goods owner group name.
GetInvoicesArticleV2
Code string The code of the charge.
Title string The title of the charge.
Account string The account which the charge belongs to.
Id int Ongoing WMS' internal id for this invoice article.
GetInvoicesOrderContextV2
OrderId int Ongoing WMS' internal id for the order.
OrderNumber string Order number.
DeliveryDate dateTime The order's delivery date.
Consignee GetInvoicesOrderConsigneeV2 Contains information about the consignee, such as name and country.
ReferenceNumber string Order reference.
Remark string Order remark.
Waybill string Order waybill.
TransporterServiceCode string Order's transporter service code.
ReturnTransporterServiceCode string Order's transporter service code for the return shipment.
GetInvoicesInOrderContextV2
InOrderId int Ongoing WMS' internal id for the inorder.
InOrderNumber string InOrder number.
GetInvoicesProductionOrderContextV2
ProductionOrderId int Ongoing WMS' internal id for the production order.
GetInvoicesPalletItemContextV2
PalletItemId int Ongoing WMS' internal ID for the pallet item.
LabelId string The pallet item label ID.
GetInvoicesArticleItemContextV2
ArticleItemId int Ongoing WMS' internal id for the article item.
ArticleDefId int Ongoing WMS' internal id for the article (that is, the SKU).
ScannedSerial string(128) Serial number of the article item.
GetInvoicesArticleContextV2
ArticleDefId int Ongoing WMS' internal id for the article (the SKU).
GetInvoicesOrderConsigneeV2
Id int The ID of the consignee.
Name string The name of the consignee.
CountryCode string The country code of the consignee.
PostCode string The post code of the consignee.