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:
- 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 , Query, GetInvoicesByQueryResult, InvoiceV2, GoodsOwner, InvoiceCharge, InvoiceArticle, OrderContext, InOrderContext, ProductionOrderContext, ArticleItemContext, ArticleContext
Request XML
POST /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 |
str(400) |
Req. |
The name/code of the client |
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. |
InvoiceIds |
int[] |
|
Only return these InvoiceIds. |
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/WSI">
<GetInvoicesByQueryResult>
<Success>boolean</Success>
<Message>string</Message>
<Invoices>
<InvoiceV2>
<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>
</InvoiceV2>
<InvoiceV2>
<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>
</InvoiceV2>
</Invoices>
</GetInvoicesByQueryResult>
</GetInvoicesByQueryResponse>
</soap:Body>
</soap:Envelope>
Response specification
GetInvoicesByQueryResult |
Invoices |
Invoice[] |
List of invoices matching the filter. |
InvoiceV2 |
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 WMS' 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 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 |
object |
Contains info about the goods owner group (if any). |
InvoiceCharges |
ChargeId |
int |
Ongoing WMS' 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. |
ArticleItemContext |
object |
If this charge is connected to an article item order, this will be an object of type ArticleItemContext. Otherwise it will be null. |
ArticleContext |
object |
If this charge is connected to an article (SKU), this will be an object of type ArticleContext. 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 WMS' internal id for this invoice article. |
OrderContext |
OrderId |
int |
Ongoing WMS' 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 WMS' internal id for the inorder. |
InOrderNumber |
str |
InOrder number. |
ProductionOrderContext |
ProductionOrderId |
int |
Ongoing WMS' internal id for the production order. |
ArticleItemContext |
ArticleItemId |
int |
Ongoing WMS' internal id for the article item. |
ArticleDefId |
int |
Ongoing WMS' internal id for the article (that is, the SKU). |
ScannedSerial |
str(128) |
Serial number of the article item. |
ArticleContext |
ArticleDefId |
int |
Ongoing WMS' internal id for the article (the SKU). |