api:invoice:current:get
Table of Contents
API : Current Invoice Get
Introduction
This request will return the the specified current invoice line.
Request
| URL | https://api.telecomx.dk/invoice/current/ID | |
|---|---|---|
| Method | GET | |
| Access level | RESELLER if customer belongs to the reseller. ADMIN. |
|
| Param | ID | Id of the current invoice line (24 hex-char string) |
| Query | externalLicenses | If true, returns the external license invoice lines instead. |
Query example
https://api.telecomx.dk/invoice/current/1234567890ABCDEF12345678 https://api.telecomx.dk/invoice/current/1234567890ABCDEF12345678&externalLicenses=true
Response
| 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. |
| 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) |
| region | String | Roaming region, if relevant. Allowed values are: homeland, euNordic, restOfEurope, world1, world2, world3, international if not a roaming invoice line, and the name of the roaming region if it is a roaming invoice line, e.g MVNO data. |
| regionName | String | Display name of roaming region, if relevant. Allowed values are: homeland, euNordic, restOfEurope, world1, world2, world3, international if not a roaming invoice line, and the name of the roaming region if it is a roaming invoice line, e.g MVNO data. |
| 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. |
| billingCustomer | ObjectID | Other customer this line can be invoiced to. Can only be used when creating AD_HOC lines |
| until | String | The displayed to date. If the “to” date is the first of a month, it will instead be the last day of the previous month |
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', }
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/current/get.txt · Last modified: 2024/09/12 13:18 by Joakim Andersen