Reports
Overview
- List of available reports
- Get available columns for given report
- Generate report
- Report parameters
- Send Reports on email
List of available reports
Name | Resource path |
---|---|
Invoices | invoices |
Recipients | recipients |
Participants | participants |
Offers | offers |
Order confirmations | orderConfirmations |
Account overview | accountOverview |
Revenue overview | revenue/overview |
Revenue detail | revenue/detail |
Revenue period | revenue/period |
Revenue customer | revenue/customer |
Payments | payments |
Payment overview | payments/overview |
Payment details | payments/details/{number} |
Payment per product | payments/products |
Payment per product exceptions | payments/products/exceptions |
Open items | openItems |
Balance list | recipients/balance |
Aged balance list | recipients/balance/aged |
Salesledger | recipients/{number}/salesledger |
Currency | currency |
Report columns
1 | GET /reports/{resource path}/availableColumns
|
example: GET /reports/recipients/availableColumns
Response
HTTP/1.1 200 OK
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | [{ "key": "customerNumber", "name": "Kundenr", "preselected": false }, { "key": "organisationNumber", "name": "Organisasjonsnr", "preselected": false }, { "key": "name", "name": "Navn", "preselected": false }, { "key": "address1", "name": "Adresse1", "preselected": false }, { "key": "address2", "name": "Adresse2", "preselected": false }, { "key": "zip", "name": "PostNr", "preselected": false }, { "key": "city", "name": "Poststed", "preselected": false }, { "key": "country", "name": "Land", "preselected": false }, { "key": "phone", "name": "Telefon", "preselected": false }, { "key": "mobile", "name": "Mobil", "preselected": false }, { "key": "fax", "name": "Faks", "preselected": false }, { "key": "email", "name": "E-post", "preselected": false }, { "key": "web", "name": "Hjemmeside", "preselected": false }, { "key": "labels", "name": "Grupper", "preselected": false }, { "key": "discount", "name": "Rabatt", "preselected": false }, { "key": "balance", "name": "Utestående", "preselected": false }, { "key": "preferredShipment", "name": "Forsendelsesmåte", "preselected": false }, { "key": "customFields", "name": "Egendefinerte felter", "preselected": false }, { "key": "kid", "name": "KID for AvtaleGiro", "preselected": false }, { "key": "activeAgiroAgreement", "name": "Inngått AvtaleGiro", "preselected": false }] |
Note: In recipient list report and participant list report, when CUSTOM_FIELDS
is selected it will be replaced with actual custom fields in final report. Available in XLS format only.
Note for Payment per product report:
- when selecting XLS both reports (payment per product and payment per product exceptions) are put into single XLS in two separate sheets
- when selecting JSON please generate either payment per product or payment per product exceptions report
- all columns are preselected by default so availableColumns resource is not available for those reports.
Generate report
1 | GET /reports/{resource path}?{params}
|
Example request
1 | GET /reports/invoices?format=JSON&columns=invoiceNumber,invoiceDate,dueDate,tax,total&from=2016-01-01&to=2016-12-31&email=recipient@sendregning.no
|
1 2 3 4 5 6 7 8 9 10 11 12 | { "columns" : [ "invoiceNumber", "invoiceDate", "dueDate", "tax", "total" ], "from": "2015-01-01", "to": "2015-10-01", "format" : "JSON" } |
Valid values for format are “JSON”, “XLS” and “CSV”. Additionally Invoices report allows PDF format which can accept date range OR invoice number range parameters.
It’s also possible to export invoices as EHF files. When “EHF” format is selected invoices will be exported in a single zip file also containing summary file saying which invoices were exported and which not.
It’s also possible to add optional email
parameter which will result in given report being sent is selected format to email address specified.
Response
HTTP/1.1 200 OK
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | { "headers": { "invoiceNumber": "Fakturanr", "invoiceDate": "Fakturadato", "dueDate": "Forfallsdato", "tax": "MVA", "total": "Total (ink Mva)" }, "items": [ { "invoiceNumber": "44", "invoiceDate": "2014-02-25", "dueDate": "2014-03-11", "orderDate": "2014-02-25", "tax": 11.11, "total": 22.22 }, { "invoiceNumber": "45", "invoiceDate": "2014-03-05", "dueDate": "2014-03-19", "tax": 11.11, "total": 22.22 } ], "summary": { "tax": 22.22, "total": 44.44 } } |
Report parameters
format
and columns
parameters are mandatory.
columns
parameter is a comma separated list of column names
Query parameters and formats available for reports:
Report | Formats | Parameter | Parameter type | Required |
---|---|---|---|---|
Invoices | XLS, CSV, JSON, PDF, EHF | |||
recipientNumber | query | no | ||
invoiceNumber | query | no | ||
from | query | no | ||
to | query | no | ||
invoiceNumberFrom | query | no | ||
invoiceNumberTo | query | no | ||
productCode | query | no | ||
paid | query | no | ||
Recipients | XLS, CSV | |||
labelNumber | query | no | ||
Salesledger | XLS, CSV, JSON | |||
number | path | yes | ||
from | query | no | ||
to | query | no | ||
Participants | XLS, CSV | |||
eventNumber | query | no | ||
Offers | XLS, CSV, JSON | |||
recipientNumber | query | no | ||
from | query | no | ||
to | query | no | ||
Order Confirmations | XLS, CSV, JSON | |||
recipientNumber | query | no | ||
from | query | no | ||
to | query | no | ||
Account Overview | XLS, CSV, JSON, PDF (for list of invoices) | |||
from | query | no | ||
to | query | no | ||
Revenue Overview | XLS, CSV, JSON | |||
labelNumber | query | no | ||
from | query | no | ||
to | query | no | ||
Revenue Detail | XLS, CSV, JSON | |||
labelNumber | query | no | ||
from | query | no | ||
to | query | no | ||
Revenue Period | XLS, CSV, JSON | |||
labelNumber | query | no | ||
from | query | no | ||
to | query | no | ||
Revenue Customer | XLS, CSV, JSON | |||
labelNumber | query | no | ||
from | query | no | ||
to | query | no | ||
Payments | XLS, CSV, JSON | |||
from | query | no | ||
to | query | no | ||
Payment Overview | JSON | |||
from | query | no | ||
to | query | no | ||
Payment Details | JSON | |||
number | path | yes | ||
Payments per product | JSON for single report, XLS for both | |||
from | query | yes | ||
to | query | yes | ||
Payments per product exceptions | JSON | |||
from | query | yes | ||
to | query | yes | ||
Balance list | XLS, CSV, JSON | |||
to | query | yes | ||
Aged balance list | XLS, CSV, JSON | |||
to | query | yes | ||
intervals If INTERVALS column is selected for the report, this param needs to be specified as a comma separated list of numbers |
query | no | ||
Currency | XLS, CSV, JSON | |||
recipientNumber | query | no | ||
from | query | no | ||
to | query | no | ||
Open Items | XLS, CSV, JSON | |||
to | query | yes |
For reports where labelNumber
is an available param, value -1
will indicate only those recipients that are not assigned to any group. No param/null value will return all recipients.
Send reports on email
1 | POST /reports/email
|
Example JSON:
1 2 3 4 5 6 7 8 9 10 11 | { "email" : "recipient@sendregning.no", "copyEmail" : "copy@sendregning.no", "reports" : [ "invoices", "recipients" ], "from": "2016-01-01", "to": "2016-02-01" } |
Minimal JSON:
1 2 3 | { "email" : "recipient@sendregning.no" } |
JSON properties:
Name | Description | Type | Required |
---|---|---|---|
Recipient email | string | yes | |
copyEmail | Copy email | string | no |
reports | List of report names | array | no |
from | Report start date | Date | if reports given |
end | Report end date | Date | if reports given |
Available reports:
Value | Description |
---|---|
invoices | Invoice journal |
recipients | Recipient list |
accountOverview | Account overview |
revenue/overview | Revenue overview |
recipients/balance | Recipient balance list |
openItems | Open items |
payments | Payments |
currency | Currency |
from
and to
date parameters are parsed and used only when specifying list of reports.
If reports
object is not given or its value is null the default report set will be sent with default date range.