User Tools

Site Tools


api:invoice:reseller:get

API : Reseller Invoice Get

Introduction

This request will return the the specified reseller invoice.

Request

URL https://api.telecomx.dk/invoice/reseller/INVOICE_ID
Method GET
Access level RESELLER if customer belongs to the reseller.
RESELLER_ADMIN
ADMIN.
Param INVOICE_ID Id of the invoice (24 hex-char string)
Query groupInvoiceLines [optional] Groups the invoice lines that have the same product and period, making for easier-to-read invoices. Defaults to false.

Query example

https://api.telecomx.dk/invoice/reseller/1234567890ABCDEF12345678

Response

JSON object
_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.
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].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.
lines[item].masterProductCode String Product code of the product this inherits from. If the product is a master product, then it will just be the product's own product code
lines[item].customerLines Array Array of the customers, whose lines make up this reseller invoice line.
lines[item].customerLines[].customer ObjectID Customer ID
lines[item].customerLines[].customerName String Customer name
lines[item].customerLines[].subTotalCost Number Sum of customer's cost without VAT (RESELLER_ADMIN or ADMIN only)
lines[item].customerLines[].subTotalWholesale Number Sum of customer's wholesale without VAT
lines[item].customerLines[].subTotalPrice Number Sum of customer's price without VAT
lines[item].customerLines[].lines Array Array of the customer's actual lines. Contains the same properties as the invoice lines here: API : Invoice Get: NOTE: only _id, productCode, cost (if allowed), wholesale (if allowed), and price are shown on the product
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.

Example

{
  "_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",
  "lines":
  [
    {
      "product": "548ecd936b34cd1826f3ff2b",
      "productCode": "NUM01",
      "name": "Nummerleje",
      "description": "1 numre - Periode: 01-11-2014 - 31-03-2015",
      "units": 5,
      "type": "MONTHS",
      "unitWholesale": 20,
      "vatExempt": false,
      "masterProductCode": "1234"
    },
    {
      "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,
      "vatExempt": false,
      "masterProductCode": "1234"
    },
    {
      "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,
      "vatExempt": false,
      "masterProductCode": "1234"
    }
  ],
  "subTotalWholesale": 499.81,
  "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/reseller/get.txt · Last modified: 2024/07/01 08:56 by Joakim Andersen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki