GetInvoicesByQuery (automation)
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:
- They want to charge $5 for every order that they picked.
- 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.
Tags: GetInvoicesByQuery, AutomationGetInvoicesQuery, GetInvoicesByQueryResponse, AutomationGetInvoicesResult, AutomationInvoice, GetInvoicesGoodsOwnerInfo, GetInvoicesCharge, GetInvoicesArticle, GetInvoicesOrderContext, GetInvoicesInOrderContext, GetInvoicesProductionOrderContext, GetInvoicesPalletItemContext, GetInvoicesArticleItemContext, GetInvoicesArticleContext, GetInvoicesOrderConsignee
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>
<OnlyWithoutInvoiceNumber>boolean</OnlyWithoutInvoiceNumber>
</Query>
</GetInvoicesByQuery>
</soap:Body>
</soap:Envelope>
Request specification
GetInvoicesByQuery |
UserName |
string(50) |
Req. |
Your username |
Password |
string(50) |
Req. |
Your password |
Query |
AutomationGetInvoicesQuery |
Req. |
The query object |
AutomationGetInvoicesQuery |
GetInvoiceRows |
boolean |
|
True if you want the function to return information about the invoice rows as well. |
OnlyLiveGoodsOwners |
boolean |
|
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 |
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. |
OnlyWithoutInvoiceNumber |
boolean |
|
Only return invoices without invoice number |
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/Automation">
<GetInvoicesByQueryResult>
<Success>boolean</Success>
<Message>string</Message>
<Invoices>
<AutomationInvoice>
<GoodsOwner>
<GoodsOwnerId>int</GoodsOwnerId>
<GoodsOwnerCode>string</GoodsOwnerCode>
<FinancialCode>string</FinancialCode>
<GoodsLocationCode>string</GoodsLocationCode>
<GoodsOwnerReference>string</GoodsOwnerReference>
<GoodsOwnerInvoiceCurrencyCode>string</GoodsOwnerInvoiceCurrencyCode>
<GoodsOwnerOrganisationNumber>string</GoodsOwnerOrganisationNumber>
</GoodsOwner>
<InvoiceCharges>
<GetInvoicesCharge>
<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>
<UnitName>string</UnitName>
</GetInvoicesCharge>
<GetInvoicesCharge>
<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>
<UnitName>string</UnitName>
</GetInvoicesCharge>
</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>
<InvoiceExportedDate>dateTime</InvoiceExportedDate>
</AutomationInvoice>
<AutomationInvoice>
<GoodsOwner>
<GoodsOwnerId>int</GoodsOwnerId>
<GoodsOwnerCode>string</GoodsOwnerCode>
<FinancialCode>string</FinancialCode>
<GoodsLocationCode>string</GoodsLocationCode>
<GoodsOwnerReference>string</GoodsOwnerReference>
<GoodsOwnerInvoiceCurrencyCode>string</GoodsOwnerInvoiceCurrencyCode>
<GoodsOwnerOrganisationNumber>string</GoodsOwnerOrganisationNumber>
</GoodsOwner>
<InvoiceCharges>
<GetInvoicesCharge>
<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>
<UnitName>string</UnitName>
</GetInvoicesCharge>
<GetInvoicesCharge>
<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>
<UnitName>string</UnitName>
</GetInvoicesCharge>
</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>
<InvoiceExportedDate>dateTime</InvoiceExportedDate>
</AutomationInvoice>
</Invoices>
</GetInvoicesByQueryResult>
</GetInvoicesByQueryResponse>
</soap:Body>
</soap:Envelope>
Response specification
GetInvoicesByQueryResponse |
GetInvoicesByQueryResult |
AutomationGetInvoicesResult |
|
AutomationGetInvoicesResult |
Success |
boolean |
|
Message |
string |
|
Invoices |
AutomationInvoice[] |
|
AutomationInvoice |
GoodsOwner |
GetInvoicesGoodsOwnerInfo |
Contains information about which goods owner the invoice belongs to, see GetInvoicesGoodsOwnerInfo. |
InvoiceCharges |
GetInvoicesCharge[] |
A list of GetInvoicesCharge. |
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. |
InvoiceExportedDate |
dateTime |
The date and time when the invoice has been exported to an external system. |
GetInvoicesGoodsOwnerInfo |
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 currency which is used for the goods owner's invoices. |
GoodsOwnerOrganisationNumber |
string |
Goods owner's organisation number. |
GetInvoicesCharge |
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 |
|
InvoiceArticle |
GetInvoicesArticle |
An element of type GetInvoicesArticle. |
OrderContext |
GetInvoicesOrderContext |
If this charge is connected to an order, this will be an object of type GetInvoicesOrderContext. Otherwise it will be null. |
InOrderContext |
GetInvoicesInOrderContext |
If this charge is connected to an inorder, this will be an object of type GetInvoicesInOrderContext. Otherwise it will be null. |
ProductionOrderContext |
GetInvoicesProductionOrderContext |
If this charge is connected to a production order, this will be an object of type GetInvoicesProductionOrderContext. Otherwise it will be null. |
PalletItemContext |
GetInvoicesPalletItemContext |
An element of type GetInvoicesPalletItemContext. |
ArticleItemContext |
GetInvoicesArticleItemContext |
If this charge is connected to an article item order, this will be an object of type GetInvoicesArticleItemContext. Otherwise it will be null. |
ArticleContext |
GetInvoicesArticleContext |
If this charge is connected to an article (SKU), this will be an object of type GetInvoicesArticleContext. Otherwise it will be null. |
Container |
string |
The charge's container reference. |
UnitName |
string |
The name of the unit of the value in NumberOfItems |
GetInvoicesArticle |
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. |
GetInvoicesOrderContext |
OrderId |
int |
Ongoing WMS' internal id for the order. |
OrderNumber |
string |
Order number. |
DeliveryDate |
dateTime |
The order's delivery date. |
Consignee |
GetInvoicesOrderConsignee |
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. |
GetInvoicesInOrderContext |
InOrderId |
int |
Ongoing WMS' internal id for the inorder. |
InOrderNumber |
string |
InOrder number. |
GetInvoicesProductionOrderContext |
ProductionOrderId |
int |
Ongoing WMS' internal id for the production order. |
GetInvoicesPalletItemContext |
PalletItemId |
int |
|
LabelId |
string |
|
GetInvoicesArticleItemContext |
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. |
GetInvoicesArticleContext |
ArticleDefId |
int |
Ongoing WMS' internal id for the article (the SKU). |
GetInvoicesOrderConsignee |
Id |
int |
|
Name |
string |
|
CountryCode |
string |
|
PostCode |
string |
|