User Tools

Site Tools


api:invoice:reseller:list

API : Reseller Invoice List

Introduction

This request will return a list of invoices for a customer.

Request

URL https://api.telecomx.dk/invoice/reseller
Method GET
Access level RESELLER - invoices for customers
RESELLER_ADMIN with FINANCE feature
ADMIN.
Query reseller [optional] Id of reseller to return invoices for (RESELLER/ADMIN only).
invoiceDate [optional] Date to get invoices from
offset [optional] Index of the first product to return, default 0.
limit [optional] The number of products to return, default 50, min 1, max 500.
expand [optional] If true, full customer data (name, address, invoicing e-mail address) is included in the reply. Subtotals will also be calculated for all invoices.

Query examples

https://api.telecomx.dk/invoice/reseller
https://api.telecomx.dk/invoice/reseller?offset=50&limit=25
https://api.telecomx.dk/invoice/reseller?reseller=1234567890ABCDEF12345678
https://api.telecomx.dk/invoice/reseller?reseller=1234567890ABCDEF12345678&expand=true

Response

JSON object
offset Index of the first invoice returned.
limit Number of invoices to return. Note that the actual number of invoices returned may be lower.
total Number of invoices that can be returned when offset and limit is not considered. This is to be used for paging through the data.
invoices Array of invoices, see definition below.
Invoice object (JSON)
_id Id Unique invoice id.
reseller Id Id of reseller the 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.
subTotalCost Number Total cost before tax (ADMIN only).
subTotalWholesale Number Total wholesale cost before tax (RESELLER/ADMIN only).
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.

If expand = true

Invoice object (JSON)
_id Id Unique invoice id.
customer Object Customer object
customer._id Id Id of customer invoice is for.
customer.name String Customer name
customer.address Object Customer address object
customer.address.address String Street name/address
customer.address.alternativeName String Name for the specific address
customer.address.city String City name
customer.address.country String 2-letter ISO country code
customer.address.zip String City ZIP code
customer.finance Object Customer's finance properties
customer.finance.accountingSystemId String Accounting system ID. Can be used to link the customer to an external accounting system.
customer.finance.emailAddress String Accounting e-mail
customer.finance.invoiceMethod String Invoice method of the customer
customer.finance.vatNumber String Customer's vat number
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/RESELLER_ADMIN only).
lines[item].unitPrice Number Sales prices pr. unit
lines[item].vatExempt Boolean True if this is exempt from VAT
subTotalCost Number Total cost before tax (ADMIN only).
subTotalWholesale Number Total wholesale cost before tax (RESELLER/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/RESELLER_ADMIN only).
total Double Sales price including VAT.

Response examples

Normal condensed

{
  offset: 0,
  limit: 50,
  total: 87,
  invoices:
  [
    {
      "_id": "54a978806d30733986cfa817",
      "reseller": "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",
      "subTotalWholesale": 499.81,
      "vatWholesale": 124.95,
      "vat": 230.19,
      "total": 1150.95
    },
    {
      ...
    }
  ]
}

If expand = true

{
  offset: 0,
  limit: 500,
  total: 822,
  subTotalCost: 281.5,
  subTotalWholesale: 716.2,
  subTotal: 1082.2,
  invoices:
  [
    {
      "_id": "54a978806d34133986cfa817",
      "customer": {
        "_id": "1234567890ABCD1234567890",
        "name": "Ducktales & Co.",
        "address": {
           "address": "ABC-vej 15"
           "alternativeName": "Hovedkontoret"
           "city": "Kalundborg"
           "country": "DK"
           "zip": "4400"
      },
      "finance": {
        "accountingSystemId": "35722"
        "emailAddress": "invoice@andeby.dk"
        "invoiceMethod": "EMAIL"
        "vatNumber": "19552942"
      },
      "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
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/invoice/reseller/list.txt · Last modified: 2023/11/23 09:59 by Joakim Andersen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki