User Tools

Site Tools


api:invoice:get

API : Invoice Get

Introduction

This request will return the specified invoice.

Request

URL https://api.telecomx.dk/invoice/INVOICE_ID
Method GET
Access level RESELLER if customer belongs to the reseller.
ADMIN.
Param INVOICE_ID Id of the invoice (24 hex-char string)
Query externalLicenses Boolean - if true, returns the external license invoice lines instead. Defaults to false.
groupInvoiceLines [optional] Groups the invoice lines that have the same product and period, making for easier-to-read invoices. Defaults to false.
showIncludedProducts [optional] Boolean - show invoice lines of products that are included, and thus, free. Defaults to false.
format [optional] Can be “csv” or “json”. If not given, defaults to json. If none of the headers below are given, then they are all included in the CSV.
lang [optional] Language - allowed values are “en” og “da”. Defaults to da (danish).
onlyUsage [optional] If true, no subscription lines will be returned.

Query example

https://api.telecomx.dk/invoice/1234567890ABCDEF12345678
https://api.telecomx.dk/invoice/1234567890ABCDEF12345678?externalLicenses=true

Response

JSON object
_id Id Unique invoice id.
customer Id Id of customer invoice is for.
sent Boolean True if invoice has been sent to the customer.
invoiceNumber String Invoice number. If it is -1, then it is waiting to be set by the accounting system.
period Boolean True if this is a monthly period invoice.
invoiceDate Date The invoice date.
dueDate Date The payment date.
paid Boolean True if payment has been received - set by accounting system.
headline String Optional headline for the invoice. For description, tracking id, reference number etc.
lines Array Array of invoice lines - see below:
lines[item].product ObjectID Id of product used.
lines[item].productCode String Product code, e.g. 'IN4010'.
lines[item].name String Product name, e.g. 'Internet VDSL 40/10Mbit'.
lines[item].description String Optional descriptive text, e.g. 'for perioden 1/1 - 31/1-2014'.
lines[item].units Number Number of units (to be multiplied by the unit price).
lines[item].type String Type of units: MIN, MB, UNITS, HOURS, KM, MONTHS.
lines[item].unitCost Number Cost pr. unit (ADMIN only).
lines[item].unitWholesale Number Reseller price pr. unit (RESELLER/ADMIN only).
lines[item].unitPrice Number Sales prices pr. unit
lines[item].vatExempt Boolean True if this is exempt from VAT
lines[item].from Date From date for this line.
lines[item].to Date To date for this line.
subTotalCost Number Total cost before tax (ADMIN only).
subTotalWholesale Number Total wholesale cost before tax (RESELLER/ADMIN only).
subTotal Number Total price before tax.
vat Double Value added tax.
vatCost Double Value added tax on cost (ADMIN only).
vatWholesale Double Value added tax on wholesale (RESELLER/ADMIN only).
total Double Sales price including VAT.

Note that properties holding no value may be omitted from the object.

Example

{
  "_id": "54a978806d30733986cfa817",
  "customer": "54463ed73fc6ea53780080cf",
  "sent": false,
  "invoiceNumber": -1,
  "period": true,
  "invoiceDate": "2014-12-31T23:00:00.000Z",
  "dueDate": "2015-01-07T23:00:00.000Z",
  "paid": false,
  "headline": "Periode faktura",
  "lines":
  [
    {
      "product": "548ecd936b34cd1826f3ff2b",
      "productCode": "NUM01",
      "name": "Nummerleje",
      "description": "1 numre - Periode: 01-11-2014 - 31-03-2015",
      "units": 5,
      "type": "MONTHS",
      "unitWholesale": 20,
      "unitPrice": 25,
      "vatExempt": false,
    },
    {
      "product": "54917e9940c67b6c3dd05a8c",
      "productCode": "FORBRUG1",
      "name": "Samtaler",
      "description": "SIP konto: Hovedkonto - kald: 544 - tid: 25:34:05 - periode: 01-12-2014 - 31-12-2014",
      "units": 1,
      "type": "UNITS",
      "unitWholesale": 398.18,
      "unitPrice": 792.22,
      "vatExempt": false,
    },
    {
      "product": "54917e9940c67b6c3dd05a8c",
      "productCode": "FORBRUG1",
      "name": "Samtaler",
      "description": "SIP konto: Fax - kald: 15 - tid: 00:11:47 - periode: 01-12-2014 - 31-12-2014",
      "units": 1,
      "type": "UNITS",
      "unitWholesale": 1.63,
      "unitPrice": 3.54,
      "vatExempt": false,
    }
  ],
  "subTotalWholesale": 499.81,
  "subTotal": 920.76,
  "vatWholesale": 124.95,
  "vat": 230.19,
  "total": 1150.95
}

Errors

Error code Message Description
400 bad_request Id not found in request URI
404 not_found Not found
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/invoice/get.txt · Last modified: 2025/02/13 15:00 by Joakim Andersen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki