api:invoice:current:list
Table of Contents
API : Current Invoice List
Introduction
This request will return the list of current invoice lines.
A current invoice line is either a line that will be included on the next monthly invoice (or can be included in an ad-hoc invoice) or it is a recurring custom product/service that is included in the monthly invoice.
Request
| URL | https://api.telecomx.dk/invoice/current | |
|---|---|---|
| Method | GET | |
| Access level | RESELLER - if own or customer's, ADMIN. | |
| Query | customer | Id of the customer to return the current invoice lines for (RESELLER/ADMIN only). |
| externalLicenses | Boolean - if true, returns the external license invoice lines instead. | |
Query examples
https://api.telecomx.dk/invoice/current https://api.telecomx.dk/invoice/current?customer=1234567890ABCDEF12345678 https://api.telecomx.dk/invoice/current?customer=1234567890ABCDEF12345678&externalLicenses=true
Response
Array of current invoice objects.
| Current invoice object (JSON) | ||
|---|---|---|
| _id | Id | Unique id of the invoice line. |
| customer | Id | Id of customer. |
| product._id | Id | Id of the product used. |
| product.type | String | Type of product - see more here. |
| product.productCode | String | Id to use when adding a product and for syncing with accounting system when doing invoicing. |
| product.name | String | Name of the product. |
| product.unitType | String | Type of units: MIN, MB, UNITS, HOURS, KM, MONTHS. |
| product.recurrence | String | Type of recurrence: NONE, MONTHLY, QUARTERLY, YEARLY. |
| product.recurrenceFullMonth | Boolean | If true, and the product is added mid month, customer will be invoiced for the full month otherwise the customer will be invoiced for a fraction of the month according to the start date. |
| product.cost | Number | Cost of the product for one month (if recurring) or one unit (ADMIN only). |
| product.wholesale | Number | Resellers cost for one month (if recurring) or one unit (RESELLER/ADMIN only). |
| product.price | Number | Customer price for one month (if recurring) or one unit. |
| name | String | Overrides product name if set. |
| description | String | Overrides product default description if set. |
| units | Number | Number of units to invoice, can be negative for crediting (price is multiplied by this). |
| unitCost | Number | Overrides products cost price if set (ADMIN only). |
| unitWholesale | Number | Overrides products wholesale price if set (RESELLER/ADMIN only). |
| unitPrice | Number | Overrides products price if set. |
| start | Date | The date the invoice line was added (only used by recurring products of type 'OTHER'). |
| invoicedUntil | Date | The date this invoice line has been invoiced until (only used by recurring products of type 'OTHER'). |
| terminate | Date | The date the product should be invoiced until in the monthly invoicing and then deleted. (only used by recurring products of type 'OTHER'. |
| locked | Boolean | If true this current invoice line cannot be deleted because it contains usage that cannot be returned/credited (unless you have ADMIN rights). |
| vatExempt | Boolean | True if this is exempt from VAT. |
| from | Date | From date for this line. |
| to | Date | To date for this line. |
| earliestStart | Date | If the product is reoccurring, this is the minimum date that start can be set to. It is set to the first of the current month, when the currentInvoice is created through the API. |
| roaming | Boolean | True if this invoice line is made from a charge that was a roaming charge (a roaming call or roaming data usage) |
| roamingRegion | String | Roaming region, if relevant. Allowed values are: homeland, euNordic, restOfEurope, world1, world2, world3, international. |
| amount | Number | Used for invoice lines, where the units do not reflect the actual amount of something invoiced, e.g calls are invoiced with units = 1, and the unit price/wholesale/cost changed to reflect the price. This field will then contain the actual amount of calls |
| amountSeconds | Number | Used for call invoice lines, to reflect the summed amount of seconds calling. |
| recurrence | String | Overrides the type of recurrence: NONE, MONTHLY, QUARTERLY, YEARLY. This is only valid for recurring invoice lines of product type 'AD_HOC'. |
Note that properties holding no value may be omitted from the object.
Response example
[ { _id: '1234567890ABCDEF12345678', customer: '123457890ABCDEF12345678', product: { _id: '123457890ABCDEF1234578', type: 'OTHER', productCode: 'SERV247', name: 'Service 24/7', unitType: 'MONTHS', recurrence: 'QUARTERLY', recurrenceFullMonth: false, cost: 100, wholesale: 125, price: 150 }, name: null, description: null, units: 6, unitCost: null, unitWholesale: 115, unitPrice: 130, start: '2015-01-12T00:00:00+0100', invoicedUntil: '2015-07-01T00:00:00+0100', terminate: null, locked: false, vatExempt: false, earliestStart: '2014-01-01T00:00:00+0100', recurrence: null }, { ... } ]
Errors
| Error code | Message | Description |
|---|---|---|
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |
api/invoice/current/list.txt · Last modified: 2023/03/21 10:51 by Joakim Andersen