Release

Search

NameDescriptionContains personal data

Environment for direct customers and subcustomers of reseller

Link copied to clipboard
env.i_envID
env.nameEnvironment nameY
env.companynameThe conventional form for your company’s nameY
env.addr1Company’s street addressY
env.addr2...Y
env.addr3...Y
env.addr4...Y
env.contact_cityCity where company is locatedY
env.contact_emailCompany contact person’s email addressY
env.contact_subdivisionProvince/state where the company is located
env.contact_zipPostal code for company’s locationY
env.countryCountry nameY
env.descriptionShort description
env.emailPrimary email contactY
env.faxnumPrimary fax numberY
env.laddr1Address where company name is legally registered
env.laddr2...
env.lcountryCountry where company is legally registeredY
env.lcityCity where company is legally registered
env.lnameLegally recognized form of company’s name
env.lzipPostal code for company’s registered location
env.iso_3166_2Country subdivision code
env.iso_3166_1_a2Country code
env.iso_4217The internal currency
env.phoneCompany’s primary telephone numberY
env.subdivisionCountry subdivision name
env.tax_idLocally designated tax number
env.tzTime zone company operates in
env.webCompany’s web address

Customer information

Link copied to clipboard
customer.i_customerCustomer’s unique numeric number
customer.i_customer_classNumeric ID for customer Class assigned to customer
customer.i_customer_type1 (Retail), 2 (Reseller), 3 (Distributor)
customer.i_langLocalization language, 2 characters ISO639-1 code (examples: en, es)
customer.iso_4217Customer’s currency
customer.addressFull address line
customer.address_line_2The 2nd line of the customer's address that contains the values from baddr2, baddr3, baddr4 and baddr5 fields. The values are separated by the '\n' delimiter.
customer.balanceCustomer’s balance at time of PDF generation
customer.billing_periodDefines customer’s invoicing frequency
customer.bp_charge_ccY or N defines if customer’s credit card is charged when invoice is generated
customer.companynameThe conventional form of company’s name
customer.cont1Primary contact
customer.cont2Alternative contact
customer.cityCity name
customer.countryCountry name
customer.creation_dateDate when customer was added to PortaBilling system
customer.credit_limitCustomer’s current credit limit
customer.custom_fieldsStores information about custom fields.
  • customer.custom_fields.my_custom_field
Value for a specific custom field name. For example, if a custom field name is “Country code,” this variable will be customer.custom_fields.${'Country Code'}
  • customer.custom_fields.custom_field1, customer.custom_fields.custom_field2, customer.custom_fields.custom_fieldN
This variable type is used for backward compatibility only.

Value for the Nth customer field. The order number of the custom fields corresponds to the position of a custom field enabled for the customer class in PortaBilling.

For example, the custom field “Country Code” goes first in the Custom fields list, so the corresponding variable will be customer.custom_field1. Note that the number after “custom_field” should be added without spaces.

customer.discount_rateAmount of discount applied to all of customer’s subscriptions by default
customer.emailPrimary email contact
customer.faxnumPrimary fax number
customer.firstnameFirst name
customer.midinitMiddle name
customer.lastnameLast name
customer.lnameEither company name or first name + last name
customer.loginCustomer self-care login
customer.nameCustomer ID, defines customer name as it appears in the PortaBilling system
customer.notepadText entered in Notepad field on the web
customer.opening_balanceCustomer’s starting balance
customer.out_date_formatcustomer.out_date_format
customer.out_date_time_formatPreferable date-time format
customer.out_time_formatPreferable time format
customer.phone1Primary telephone number
customer.phone2Alternative telephone number
customer.salutationSomething like ‘Mr.,’ ‘Ms.’
customer.stateProvince/state name
customer.zipPostal code
customer.tax_idLocally-designated tax number
customer.TZTime zone

Invoice information

Link copied to clipboard
get_invoice_listThis method returns the list of previous invoices with 'aging' intervals and corresponding outstanding amounts.
The method is available for invoices of all types and statuses except for voided invoices.

The aging intervals are 0-30 days, 31-60 days, 61-90 days, 91-120 days, and 120+ days.

Each interval represents the number of days that have passed since each invoice was issued (the issue date is defined by the invoice.issue_date) with the corresponding amounts for each period.

invoice.i_envEnvironment ID
invoice.i_customerReference to customer’s ID number
invoice.i_invoiceID number
invoice.invoice_numberVisible invoice number
invoice.i_invoice_statusInvoice status, refer to value from Invoice_Status_Attribs table
invoice.i_invoice_typeIndicates the type of invoice: 1 – regular, 2 – out of turn, 3 – midterm
invoice.additional_invoicesSum of out-of-turn invoices for a period
invoice.adjustmentsAdjustment amount customer must pay for the period after the invoice amount was adjusted
invoice.amount_dueThe current amount due of the invoice
invoice.amount_netInvoice period’s total amount
invoice.amount_paidAmount customer already paid
invoice.callsSum of charges for all other services
invoice.cust_nameName of the customer for whom the invoice was issued
invoice.do_not_payThis indicates that the invoice amount is too low to charge the customer, therefore the invoice amount is added to the next invoice.
invoice.due_dateDue date of the invoice in the format defined by the customer
invoice.due_date_origThe invoice due date defined in the ISO format (YYYY-MM-DD)
invoice.closedIndicates whether the invoice is closed (sent to the customer) or not.
invoice.issue_dateDate when an invoice was created, displayed in a format defined by the customer
invoice.issue_date_origDate when an invoice was created, displayed in ISO format (YYYY-MM-DD)
invoice.invoice_status_descInvoice status description
invoice.is_voidN for normal invoices; Y for voided ones
invoice.iso_4217Currency
invoice.last_invoiceThe amount due from the previous regular invoice
invoice.last_closing_dateIndicates the date the customer was closed after the invoice became overdue
invoice.last_notific_dateIndicates the date the invoice was first sent to the customer
invoice.last_recollect_dateIndicates the date the collection attempt was made (attempt to charge the customer's credit card on file for the amount due).
invoice.last_resend_dateIndicates the date the invoice was resent to the customer
invoice.last_suspension_dateIndicates the date the customer was suspended after an invoice became overdue
invoice.last_warning_dateIndicates the date the notification email was sent to the customer informing about the service suspension
invoice.manual_chargesSum of manual charges from invoice period
invoice.measured_servicesSum of charges for measured services
invoice.new_styleDefines whether the invoice includes the previous balance or not
invoice.override_control1 indicates that this is an invoice to charge for recurring fees separately
invoice.period_fromInvoice period’s start date
invoice.period_from_origInvoice period’s start date, displayed in ISO format (YYYY-MM-DD HH:MI:SS) and the UTC time zone
invoice.period_to_origInvoice period’s end date, displayed in ISO format (YYYY-MM-DD HH:MI:SS) and the UTC time zone
invoice.period_toInvoice period’s end date
invoice.paymentsSum of payments made during invoice period
invoice.previous_balanceThe amount due from the previous regular and out-of-turn invoices
invoice.prior_balanceIf invoicing for the customer was initially disabled, meaning no invoices were generated during previous billing periods, this shows the total amount owed that accumulated during those periods
invoice.prior_balance_paidThe total amount paid by the customer, covering the prior_balance (the total amount owed that accumulated during the periods when invoicing was disabled for the customer)
invoice.subscriptionsSum of subscription charges generated during invoice period
invoice.subtotalEqual to amount_net. Available only if taxation plug-in used
invoice.subtotal_without_taxesEqual to (amount_net – taxes). Available only if taxation plug-in used
invoice.taxesSum of taxes, non-zero only if taxation plugin used

Services

Link copied to clipboard
servicesArray indexed by i_service number

Service information, totals, xDRs for each service

Link copied to clipboard
i_serviceUnique ID number for service
nameService name
i_service_typeUnique ID number for service type
rating_baseAn attribute used for billing. Depends on the service type selected while creating the service. Possible values: session-time, quantity, unit, upload, download, upload+download.
period_totals
  • period_totals.records
Total number of records for a specific service.

The period_totals.records is the total number of records for a specific service that are contained in all invoices for the billing period, e.g., the regular and the out-of-turn invoices. To get the total number of records contained in this invoice only, use invoice_totals.records.

  • period_totals.quantity
Total volume of a consumed service.

The period_totals.quantity is the total volume of a consumed service contained in all invoices for the billing period, e.g., the regular and the out-of-turn invoices. To get the total volume of a consumed service contained in this invoice only, use invoice_totals.quantity.

  • period_totals.amount
Total charges for a specific service.

The period_totals.amount is the total charges for a specific service contained in all invoices for the billing period, e.g., the regular and the out-of-turn invoices. To get the total of the charged amount contained in this invoice only, use invoice_totals.amount.

  • period_totals.tax_amount
Total sum of taxes for a specific service.

The period_totals.tax_amount is the total tax amount for a specific service contained in all invoices for the billing period, e.g., the regular and the out-of-turn invoices.

  • period_totals.total_amount
Total sum of charges and taxes for a specific service.

The period_totals.total_amount is the total amount of charges and taxes for a specific service contained in all invoices for the billing period, e.g., the regular and the out-of-turn invoices.

invoice_totals
  • invoice_totals.records
Total number of records for a specific service contained in this specific invoice.
  • invoice_totals.quantity
Total volume of consumed service contained in this specific invoice.
  • invoice_totals.amount
Total charges for a specific service contained in this specific invoice.
next_rowIterator, which returns next xDRs’ row for this service, or undefined if there are no more records.
next_row_simpleIterator, which returns next xDRs’ row for this service, or undefined if there are no more records. The iterator returns simplified xDR information:
  • xDRs’ time is in UTC and ISO format.
  • There is no information about auxiliary xDR fields (for example, xdr_xcld, xdr_media_duration, xdr_merge_origin.)
rating_base_unitName of the smallest unit for measuring service usage. This is also the smallest unit you can use in rating configuration (e.g., one second)
rate_unitName of the unit for calculating service usage charges (e.g., one minute)
taxation_codesTaxation codes defined for this service
tax_adjustmentsTax amount applied when adjusting an invoice amount
get_row_taxation_infoMethod, which returns taxation details for xDR and uses xDR row as an argument. Note that for now, it works for Generic VAT/GST plug-in only.
  • is_subject_to_tax
Returns “Y” if the service is subject to Generic VAT/GST taxation and “N” otherwise.
  • tax_rate
The current Generic VAT/GST rate.

xDR row

Link copied to clipboard
account_idMaster account ID
account_batchAccount batch name
account_i_accountAccount’s unique ID
account_nameAccount owner’s name specified in the Contact field in PortaBilling (Account > Personal info > General info > Contact)
country_iso_3166_1_a2Country code
country_nameCountry corresponding to destination
country_subdivision_nameCountry subdivision corresponding to destination
destination_destinationDestination used
destination_descriptionDestination description
destination_group_nameDestination group name
destination_i_destDestination’s unique ID
rate_i_rateRate ID used
rate_effective_fromDate when rate becomes effective
rate_is_off_peak‘Y’ for off-peak period rate, ‘N’ otherwise
rate_interval_1Rates.interval_1 (Rates.op_interval_1 for off-peak)
rate_interval_nRates.interval_n (Rates.op_interval_n for off-peak)
rate_price_1Rates.price_1 (Rates.op_price_1 for off-peak)
rate_price_nRates.price_n (Rates.op_price_n for off-peak)
rate_off_peak_period0, 1, 2 for ‘normal,’ off-peak and second off-peak periods
site_nameThe name of customer site
tariff_i_tariffTariff ID used
tariff_nameTariff name used
xdr_account_idAccount ID in xDR, may be account alias
xdr_accumulated_correctionDifference between initial and re-rated xDRs’ amounts
xdr_bill_timeDate-time of session billing, displayed in customer’s format
xdr_bill_time_origDate-time of session billing, displayed in ISO format
xdr_bit_flagsBit flags provide additional information about how the service was used by the type of xDR. The xdr_bit_flags value is a number that represents some peculiarities of the xDR (e.g., 68 – outgoing recorded call, 1 – debit overdraft). See more details on bit flag usage in the PortaBilling API guide
xdr_call_idCall-id
xdr_charged_amountCharged amount
xdr_charged_quantityService quantity charged
xdr_cliCLI
xdr_cldCLD
xdr_connect_timeConnection date-time defined in customer format
xdr_connect_time_origConnection date-time defined in ISO format (YYYY-MM-DD HH:MM:SS)
xdr_disconnect_timeDate-time when session is disconnected, displayed in customer’s format
xdr_disconnect_time_origDate-time when session is disconnected, displayed in ISO format (YYYY-MM-DD HH:MM:SS)
xdr_h323_conf_idH323-conf-id
xdr_h323_incoming_conf_idIncoming H323-conf-id
xdr_historyAdditional information about xDR
xdr_idID of xDR
xdr_peak_levelPeak level applied
xdr_setup_timeTime (in mins.) between initial provisional response and connect_time.
xdr_split_orderSequential number if xDR is part of a group of xDRs resulting from the same session
xdr_subscriber_ipSubscriber IP
xdr_tableTable name: cdr_accounts or cdr_customers
xdr_used_quantityService quantity used
xdr_acliInformation about actual caller identity within PBX environment where call originated from. This identity may differ from the one delivered by the cloud PBX (e.g., the cloud PBX main account or caller’s phone if forwarded calls occurred) and displayed on the called party’s device
xdr_xcldInformation about the extension ID dialed
xdr_xcliInformation about the extension ID initiating the call
xdr_via_hgInformation about the hunt group dispatching the call
xdr_via_extInformation about the last extension ID the call was either forwarded or transferred from
xdr_media_durationInformation about an actual time during which the owner of the billed account spoke
xdr_prerated_chargeInformation about original charges imported to PortaBilling associated with xDR
xdr_e212_roaming_networkInformation about caller/callee roaming ID in E.212 format

Other variables

Link copied to clipboard
get_customer_info Method that can be used to show recurring charges for customer subscriptions sold via a reseller in the reseller’s invoice template. Find more details here.
image_pathPath to the template images used to make a full link to the included image
xrate_listEnables the retrieval of exchange rate for the currency and calculates the price there. This variable requires the key that equals the iso_4217 code of the required currency (e.g., xrate_list.EUR)

On this page

Release
What's new
Admin manuals
Handbooks
API
UI help
Back to main menu
Search