QueryInvoice
Overview
- Method:
GET - Endpoint:
/api/QueryInvoice - Description: Retrieves a list of invoices based on specified criteria. This endpoint provides detailed information about invoices and their associated metadata.
GET /api/QueryInvoiceQuery Parameters
The following parameters can be used to filter the results:
InvoiceNumber(string, optional): Filter by invoice number.yearMonth(string, optional): Filter by year and month (YYYY_MM).include(string, optional): Related data to include in the response.fields(string, optional): Specific fields to include in the response.meta(string, optional): Additional metadata for the query.take(integer, optional): Number of results to return (pagination).skip(integer, optional): Number of results to skip (pagination).orderBy/orderByDesc(string, optional): Sort results in ascending or descending order by a specific field.
Response Structure
The response will include metadata about invoices. It starts with an array of Invoice objects,
response
├── Invoiceobjects[] # Main array of invoice objects
│ ├── frontPageLines[] # Lines displayed on the front page
│ ├── invoiceSpecificationLines[] # Invoice specification details
│ ├── bundleSpecificationProductLines[] # Product lines within a bundle
│ ├── bundleSubscriptionLines[] # Subscription lines within a bundleHierarchical Breakdown
- Response
The top-level container. - Invoiceobjects[] (results)
An array containing invoice objects.- frontPageLines[] → Contains the lines displayed on the front page of the invoice.
- invoiceSpecificationLines[] → Contains detailed invoice specification lines.
- bundleSpecificationProductLines[] → Contains product lines related to a bundle.
- bundleSubscriptionLines[] → Contains subscription lines within the bundle.
Example response
{
"offset": 0,
"total": 0,
"results": [
{
"id": "###rZaqL###d8RL##",
"invoiceNumber": "###100###",
"invoiceDate": "2025-01-27",
"invoiceDescription": "Januari 2025",
"invoiceTitle": "Mobiele communicatie",
"customerNumber": "###-####",
"customerName": "### ###",
"yearMonth": "2025_01",
"providerGroup": "KPNMOBIEL",
"totalExVAT": 928.66,
"totalVAT": 0,
"totalInclVAT": 928.66,
"status": "SENT",
"frontPageLines": [
{
"description": "Sim Only Bellen en Internet",
"sortOrder": 1000,
"quantity": 143,
"amount": 2855,
"price": 20,
"volumeStr": "",
"rowType": 1,
"salesType": 1,
"startDate": "2025-01-01T00:00:00+01:00",
"endDate": "2025-01-31T00:00:00+01:00",
"group": ""
},
{
"description": "Extra Veilig Mobiel",
"sortOrder": 1010,
"quantity": 149,
"amount": 150,
"price": 1,
"volumeStr": "",
"rowType": 1,
"salesType": 5,
"startDate": "2025-01-01T00:00:00+01:00",
"endDate": "2025-01-31T00:00:00+01:00",
"group": ""
},
{
"sortOrder": 1010,
"quantity": 149,
"amount": 150,
"more ......"
}
],
"invoiceSpecificationLines": [
{
"subscriptionId": "lJ######fR1a###vb",
"phoneNumber": "06-#####285",
"simCardNumber": "893#####4077####87",
"invoiceLineType": "1",
"invoiceLineCode": "5602",
"description": "Sim Only Bellen en Internet",
"sortOrder": 1000,
"quantity": 1,
"startDate": "2025-02-01T00:00:00+01:00",
"endDate": "2025-02-28T00:00:00+01:00",
"amount": 20,
"discountCategory": "SPEC",
"discountPercentage": 0,
"userName": "Test API via 218-0000 aangevraagd",
"departmentName": ""
},
{
"subscriptionId": "lJ######fR1a###vb",
"phoneNumber": "06-#####285",
"simCardNumber": "893#####4077####87",
"invoiceLineType": "4",
"invoiceLineCode": "",
"description": "Aansluitkosten",
"sortOrder": 99996,
"quantity": 1,
"startDate": "2025-02-01T00:00:00+01:00",
"endDate": "2025-02-28T00:00:00+01:00",
"amount": 20.66,
"discountCategory": "",
"discountPercentage": 0,
"userName": "Test API via 218-0000 aangevraagd",
"departmentName": ""
},
{
"subscriptionId": "lJ######fR1a###vb",
"phoneNumber": "06-#####285",
"simCardNumber": "893#####4077####87",
"more ......"
}
],
"bundleSpecificationProductLines": [
{
"productLine": "ZAMOB_ONB_10/12GB",
"fixedCost": 110.84,
"quantityInBundleHomeVoice": 0,
"usageHomeVoice": 0,
"quantityInBundleHomeData": 40000,
"usageHomeData": 2706.16,
"quantityInBundleHomeSms": 0,
"usageHomeSms": 0,
"bundleSubscriptionLines": [
{
"subscriptionId": "sP######vR2P###dW",
"phoneNumber": "06-#####860",
"fixedCost": 22,
"quantityInBundleHomeVoice": 0,
"usageHomeVoice": 0,
"quantityInBundleHomeData": 10000,
"usageHomeData": 0,
"quantityInBundleHomeSms": 0,
"usageHomeSms": 0
},
{
"subscriptionId": "rq######h8lH###Dv",
"phoneNumber": "06-#####622",
"fixedCost": 21.5,
"quantityInBundleHomeVoice": 0,
"usageHomeVoice": 0,
"quantityInBundleHomeData": 5000,
"usageHomeData": 0,
"quantityInBundleHomeSms": 0,
"usageHomeSms": 0
},
{
"subscriptionId": "rq######h8lH###Xz",
"phoneNumber": "06-#####687",
"fixedCost": 21.5,
"more ......"
}
]
},
{
"productLine": "ZAMOB_ONB_10/12GB",
"fixedCost": 110.84,
"quantityInBundleHomeVoice": 0,
"more ......"
}
],
}
],
"meta": {}
}Field Descriptions
Below you will find the description of fields in each of the objects.
invoice Object
The invoice object is the 'top' object of each invoice, containing the general information and grand totals of the invoice. Check the Hierarchical Breakdown for more information about the complete structure of the response.
id: Unique identifier of the invoice.invoiceNumber: The assigned invoice number.invoiceDate: The date the invoice was issued.invoiceDescription: A description of the invoice.invoiceTitle: Title of the invoice.customerId: The unique identifier of the customer.customerNumber: The customer’s account number.customerName: Name of the customer.yearMonth: Year and month of the invoice inYYYYMMformat.providerGroup: The provider group linked to the invoice.totalExVAT: Total amount excluding VAT.totalVAT: Total VAT amount.totalInclVAT: Total amount including VAT.status: Status of the invoice.sentDate: The date the invoice was sent.
frontPageLines Object
The frontPageLines object exists of an array of objects and is a child of the invoice object. It contains the information as is on the first page of the invoice. Check the Hierarchical Breakdown for more information about the complete structure of the response.
description: Description of the line item.sortOrder: Order of the line item.quantity: Quantity of items.amount: Total amount for the line.price: Price per unit.volume: Volume of the billed service.volumeStr: Volume represented as a string.rowType: Type of row in the invoice.salesType: Sales category.startDate: Start date of the billed period.endDate: End date of the billed period.phoneNumber: Associated phone number.group: Group or category of the billed item.
Info
The frontPageLines array provides itemized details for each invoice.
invoiceSpecificationLines Object
The invoiceSpecificationLines object exists of an array of objects and is a child of the invoice object. It contains the summery and totals per subscription as on the invocice on the "Overzicht per aansluiting" section. Check the Hierarchical Breakdown for more information about the complete structure of the response.
subscriptionId: A unique identifier for the subscription.phoneNumber: The customer’s phone number.simCardNumber: The SIM card number associated with the subscription.invoiceLineType: A code specifying the type of invoice line.invoiceLineCode: A code used to further classify the invoice line.description: A textual description of the invoiced service or product.sortOrder: The display order for the invoice line.quantity: The count of items or services billed.startDate: The start date for the billing period.endDate: The end date for the billing period.amount: The monetary amount billed.discountCategory: A code indicating the category of any discount applied.discountPercentage: The percentage discount applied to the amount.userName: The name of the user or system that initiated the request.departmentName: The name of the department related to the invoice.
bundleSpecificationProductLines Object
The bundleSpecificationProductLines object exists of an array of objects and is a child of the invoice object. The object contains the grand totals of the information as shown on the invoice in the "Groepsbundespecificatie" section. Check the Hierarchical Breakdown for more information about the complete structure of the response.
productLine: An identifier or name of the product line.fixedCost: A fixed charge associated with the product line.quantityInBundleHomeVoice: The allocated quantity for home voice services within the bundle.usageHomeVoice: The actual usage recorded for home voice services.quantityInBundleHomeData: The allocated quantity for home data services.usageHomeData: The actual data usage recorded.quantityInBundleHomeSms: The allocated quantity for SMS services.usageHomeSms: The recorded usage of SMS services.
bundleSubscriptionLines Object
The bundleSubscriptionLines object exists of an array of objects and is a child of the bundleSpecificationProductLines object. It will contain the complete usage specifications of all subscriptions in the "Greopsbundelspecificatie" of the invoice. Check the Hierarchical Breakdown for more information about the complete structure of the response.
subscriptionId: A unique identifier for the subscription.phoneNumber: The contact number associated with the subscription.fixedCost: The base or recurring charge for the subscription.quantityInBundleHomeVoice: The allocated quota for home voice services included in the bundle.usageHomeVoice: The actual usage of home voice services.quantityInBundleHomeData: The assigned data quota for home data services within the bundle.usageHomeData: The actual data consumption for home data services.quantityInBundleHomeSms: The number of SMS messages allocated as part of the bundled home service.usageHomeSms: The actual number of SMS messages sent or used.
Info
Fields are only included in the data when they are applicable to the record.
Usage Notes
- Use
invoiceNumberto filter results for a specific invoice. - Pagination is handled via
SkipandTakeparameters. - Use
orderByororderByDescto sort results based on fields. - The
includeparameter can be used to request related data. - Specific fields can be retrieved using the
fieldsparameter but are only applicable to the toplevel (invoice) Objects.
Example Requests
Retrieve invoices for a specific year and month
GET /api/QueryInvoice?yearMonth=2024_01Retrieve the first 10 invoices sorted by invoice date
GET /api/QueryInvoice?take=10&orderByDesc=invoiceDateSummary
The /api/QueryInvoice endpoint allows efficient retrieval of invoice data with filtering, sorting, and pagination capabilities.
- Supports filtering by invoice number, date, and other metadata.
- Returns detailed invoice information, including itemized billing lines.
- Allows ordering and pagination for optimized data retrieval.
Use this API to efficiently manage and retrieve invoice records based on business needs.
