User Tools

Site Tools


api:invoice:reseller:current:get

API : Reseller Current Invoice Get

Introduction

This request will return the the specified reseller current invoice line.

Request

URL https://api.telecomx.dk/invoice/reseller/current/RESELLER_ID
Method GET
Access level RESELLER if customer belongs to the reseller.
RESELLER_ADMIN
ADMIN.
Param ID Id of the reseller (24 hex-char string)
Query fromDate From date to show invoice lines for. Defaults to first of current month.
toDate To date to show invoice lines for. Defaults to first day of next month.

Query example

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

Response

Current invoice object (JSON)
_id Id Unique id of the invoice line.
reseller Id Id of reseller.
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 (RESELLER_ADMIN only).
product.wholesale Number Resellers cost for one month (if recurring) or one unit (RESELLER/RESELLER_ADMIN only).
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 (RESELLER_ADMIN only).
unitWholesale Number Overrides products wholesale 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'.
vatExempt Boolean True if this is exempt from VAT.
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
isIncluded Boolean Whether the line is included in a PBX user's product/package. These lines are only visible for resellers and above.
lockedUnits Boolean True if the invoice line's wholesale price and cost price are not necessarily the same for each unit, so units will always be 1. This is used for things like invoicing calls, where each call invoice line differs, and is not determined from the product's prices.
lines Array List of customer invoice lines
lines[]._id ObjectId ID of customer invoice line
lines[].customer ObjectId Customer ID
lines[].product Object Product object of the customer line. Can be null. Definition can be found here: API : Product Get
lines[].productCode String Product code of the object
lines[].locked Boolean Whether the line is locked or not. Locked lines are system generated, and “unlocked” ones are created by a reseller to bill AD_HOC products
lines[].name String Name of invoice line
lines[].accountName String Account name of the invoice line. The content depends on the type of invoice line, e.g for MVNO accounts it might be the phone number.
lines[].customerName String Customer name, of the customer who this invoice line belongs to.
lines[].from Date From date of this invoice line
lines[].to Date To date of this invoice line
lines[].until Date Date used in the description, to show the “to”-date, if needed. E.g an invoice line for a monthly billing might show “Period: 01-03-2023 - 31-03-2023”, even though the “to” date is actually April 1st. The until date would then actually be March 31st
lines[].units Number Number of units to invoice, can be negative for crediting (price is multiplied by this).
lines[].unitCost Number Overrides products cost price if set (RESELLER_ADMIN only).
lines[].unitWholesale Number Overrides products wholesale price if set.
lines[].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
lines[].amountSeconds Number Used for call invoice lines, to reflect the summed amount of seconds calling.
lines[].amountNameSingular String The noun that describes what this invoice line's amount, e.g. “call” to describe an invoice line of calls.
lines[].amountNamePlural String The noun that describes what this invoice line's amount, e.g. “calls” to describe an invoice line of calls.

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

Response example

{
  _id: '1234567890ABCDEF12345678',
  reseller: '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: 0,
  unitWholesale: 115,
  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',
  masterProductCode: '1234',
  lines: [
    { ... }
  ]
}

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
422 fromDate Date is not valid
422 toDate Date is not valid
500 internal_error <Unspecified>
api/invoice/reseller/current/get.txt · Last modified: 2023/06/13 09:23 by Joakim Andersen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki