Service Types API

9 PracBill API endpoints for service types. Base URL https://billing.pracbill.com.au/api.

Create a new service type in the token's department. Validation failures are returned with HTTP 200 and {success:false, description}.

POST /{api_key}/serviceType/add

Request body

FieldTypeDescription
typeofservice requiredstringName of the service type (required)
activeinteger (0 | 1)Whether the service type is active (0/1). Passed to the database unvalidated; the column default is 1.
ratecodestringAn internal rate code
accounting_accountintegerAccounting account number
usage_accounting_accountintegerAccounting account used for usage charges
invoice_typestringThe invoice type that this is to be billed on
reporting_categorystringGroup for reporting purposes
vendor_product_idstringVendor's product identifier
data_service_gradestringService grade (e.g. business, enterprise)
list_pricenumberDefault ex tax price
cost_pricenumberDefault cost price
wholesale_pricenumberDefault wholesale price
reseller_pricenumberDefault reseller price
etf_ex_tax_amountnumberFixed ex-tax early termination fee
data_block_additional_costnumberCost of an additional data block
calls_serviceinteger (0 | 1)Whether to include call charges (0 or 1)
sms_postpaidinteger (0 | 1)Is this a sms postpaid service (0 or 1)
data_serviceinteger (0 | 1)Is this a data service (0 or 1)
data_unlimitedinteger (0 | 1)Unlimited data (0/1)
helpdesk_displayinteger (0 | 1)Does this record display in the helpdesk module (0 or 1)
allow_orderinteger (0 | 1)Allowed to be ordered through the orders module (0/1)
data_banking_enabledinteger (0 | 1)Data banking enabled (0/1)
etf_no_auto_calcinteger (0 | 1)Disable automatic early termination fee calculation (0/1)
data_included_mbintegerIncluded data in MB
data_block_additional_mbintegerSize of an additional data block in MB
data_bank_max_mbintegerData bank cap in MB
vidintegerVendor/Supplier ID
ctgidintegerDefault call rate (tariff group) to use (0 for none)
data_service_technologyobjectData technologies. A string is stored as-is; an array is joined with `^,^` (e.g. ["FTTP","HFC"]).
call_typesarray of objectCall types allowed for this service (joined with `^,^` when stored). Ignored unless an array.
default_call_typesarray of objectDefault call types for billing (joined with `^,^`). Ignored unless an array.
source_locationsarray of stringOnly rate calls from these CDR sources (joined with `^,^`). Ignored unless an array.
wholesale_deptidsarray of integerOptionally roll the service type down to these reseller departments (same code path as the service type editor's Wholesale Departments box). Only the listed departments are ensured; others are untouched. The result is returned as `rolled_down`.

Responses

  • 200 — Created (or success:false with a description)

Soft-delete a service type. Refused while services of this type are active (not ended or ending in the future). All outcomes are HTTP 200; check `success`.

DELETE /{api_key}/serviceType/delete/{esid}

Responses

  • 200 — Deleted (or success:false with a description)

Page 1 of the filtered list. Retrieve filtered service types (20 per page) for the token's department. Filters are AND-ed; defaults to active service types only. Unknown keys are ignored. Body is optional. The body is parsed by extractDataFromRequest(): raw JSON, URL-encoded raw JSON, or the legacy `json={...}` / `data={...}` form (value URL-encoded JSON).

POST /{api_key}/serviceType/filter/get

Request body

FieldTypeDescription
helpdesk_displaybooleanwhether this service type displays in the helpdesk module
invoice_typestringThe invoice type that the service type is displaye don
calls_servicebooleanIf this is a call based service
sms_postpaidbooleanIf this is a sms postpaid service
data_servicebooleanIf this is a data service
data_unlimitedbooleanUnlimited Data included?
data_included_mbintegerNumber of MB included in the service, for the filter, this is an exact match and has no ability for > or < or any wilcards
vidintegerVendor or Supplier ID
vendor_product_idstringVendor's Product ID
ratecodestringThe rate code for types
data_service_technologystringWhat type of data technologies
data_service_typestringwhat data service types are available. NOTE: eng_typeservices has no `data_service_type` column; supplying it currently makes the query fail, so do not send it.
allow_orderbooleanIf the service is allowed to be ordered through the orders module
activebooleanFilter by active state. Defaults to true (active only) when neither this nor include_inactive is supplied
include_inactivebooleanSet to true to return both active and inactive service types (ignored when `active` is supplied)
typeofservicestringA wildcard search for type of service

Responses

  • 200 — Request received successfully

Page 1 of the filtered list. Retrieve filtered service types (20 per page) for the token's department. Filters are AND-ed; defaults to active service types only. Unknown keys are ignored. Body is optional. The body is parsed by extractDataFromRequest(): raw JSON, URL-encoded raw JSON, or the legacy `json={...}` / `data={...}` form (value URL-encoded JSON).

POST /{api_key}/serviceType/filter/get/page

Request body

FieldTypeDescription
helpdesk_displaybooleanwhether this service type displays in the helpdesk module
invoice_typestringThe invoice type that the service type is displaye don
calls_servicebooleanIf this is a call based service
sms_postpaidbooleanIf this is a sms postpaid service
data_servicebooleanIf this is a data service
data_unlimitedbooleanUnlimited Data included?
data_included_mbintegerNumber of MB included in the service, for the filter, this is an exact match and has no ability for > or < or any wilcards
vidintegerVendor or Supplier ID
vendor_product_idstringVendor's Product ID
ratecodestringThe rate code for types
data_service_technologystringWhat type of data technologies
data_service_typestringwhat data service types are available. NOTE: eng_typeservices has no `data_service_type` column; supplying it currently makes the query fail, so do not send it.
allow_orderbooleanIf the service is allowed to be ordered through the orders module
activebooleanFilter by active state. Defaults to true (active only) when neither this nor include_inactive is supplied
include_inactivebooleanSet to true to return both active and inactive service types (ignored when `active` is supplied)
typeofservicestringA wildcard search for type of service

Responses

  • 200 — Request received successfully

Retrieve filtered service types (20 per page) for the token's department. Filters are AND-ed; defaults to active service types only. Unknown keys are ignored. Body is optional. The body is parsed by extractDataFromRequest(): raw JSON, URL-encoded raw JSON, or the legacy `json={...}` / `data={...}` form (value URL-encoded JSON).

POST /{api_key}/serviceType/filter/get/page/{page_number}

Request body

FieldTypeDescription
helpdesk_displaybooleanwhether this service type displays in the helpdesk module
invoice_typestringThe invoice type that the service type is displaye don
calls_servicebooleanIf this is a call based service
sms_postpaidbooleanIf this is a sms postpaid service
data_servicebooleanIf this is a data service
data_unlimitedbooleanUnlimited Data included?
data_included_mbintegerNumber of MB included in the service, for the filter, this is an exact match and has no ability for > or < or any wilcards
vidintegerVendor or Supplier ID
vendor_product_idstringVendor's Product ID
ratecodestringThe rate code for types
data_service_technologystringWhat type of data technologies
data_service_typestringwhat data service types are available. NOTE: eng_typeservices has no `data_service_type` column; supplying it currently makes the query fail, so do not send it.
allow_orderbooleanIf the service is allowed to be ordered through the orders module
activebooleanFilter by active state. Defaults to true (active only) when neither this nor include_inactive is supplied
include_inactivebooleanSet to true to return both active and inactive service types (ignored when `active` is supplied)
typeofservicestringA wildcard search for type of service

Responses

  • 200 — Request received successfully

Same as /{api_key}/serviceType/get/page/{page_number} with page 1. Retrieve a paginated list (20 per page) of service types for the token's department, ordered by typeofservice. Only active service types are returned unless include_inactive is set. Response rows contain only the nine list fields. Errors are returned with HTTP 200 and {success:false, description}.

GET /{api_key}/serviceType/get/page

Responses

  • 200 — Request received successfully

Retrieve a paginated list (20 per page) of service types for the token's department, ordered by typeofservice. Only active service types are returned unless include_inactive is set. Response rows contain only the nine list fields. Errors are returned with HTTP 200 and {success:false, description}.

GET /{api_key}/serviceType/get/page/{page_number}

Responses

  • 200 — Request received successfully

Get detailed information about a specific service type. A missing service type is reported as HTTP 200 with {success:false, description:'serviceType not found'} (not 404). Not restricted to non-deleted records.

GET /{api_key}/serviceType/get/{esid}

Responses

  • 200 — Request received successfully (or success:false when not found)

Update an existing (non-deleted) service type. Failures (not found, no data) are returned with HTTP 200 and {success:false, description}.

POST /{api_key}/serviceType/update/{esid}

Request body

FieldTypeDescription
typeofservicestringName of the service type
activeinteger (0 | 1)Whether the service type is active (0/1). Passed to the database unvalidated; the column default is 1.
ratecodestringAn internal rate code
accounting_accountintegerAccounting account number
usage_accounting_accountintegerAccounting account used for usage charges
invoice_typestringThe invoice type that this is to be billed on
reporting_categorystringGroup for reporting purposes
vendor_product_idstringVendor's product identifier
data_service_gradestringService grade (e.g. business, enterprise)
list_pricenumberDefault ex tax price
cost_pricenumberDefault cost price
wholesale_pricenumberDefault wholesale price
reseller_pricenumberDefault reseller price
etf_ex_tax_amountnumberFixed ex-tax early termination fee
data_block_additional_costnumberCost of an additional data block
calls_serviceinteger (0 | 1)Whether to include call charges (0 or 1)
sms_postpaidinteger (0 | 1)Is this a sms postpaid service (0 or 1)
data_serviceinteger (0 | 1)Is this a data service (0 or 1)
data_unlimitedinteger (0 | 1)Unlimited data (0/1)
helpdesk_displayinteger (0 | 1)Does this record display in the helpdesk module (0 or 1)
allow_orderinteger (0 | 1)Allowed to be ordered through the orders module (0/1)
data_banking_enabledinteger (0 | 1)Data banking enabled (0/1)
etf_no_auto_calcinteger (0 | 1)Disable automatic early termination fee calculation (0/1)
data_included_mbintegerIncluded data in MB
data_block_additional_mbintegerSize of an additional data block in MB
data_bank_max_mbintegerData bank cap in MB
vidintegerVendor/Supplier ID
ctgidintegerDefault call rate (tariff group) to use (0 for none)
data_service_technologyobjectData technologies. A string is stored as-is; an array is joined with `^,^` (e.g. ["FTTP","HFC"]).
call_typesarray of objectCall types allowed for this service (joined with `^,^` when stored). Ignored unless an array.
default_call_typesarray of objectDefault call types for billing (joined with `^,^`). Ignored unless an array.
source_locationsarray of stringOnly rate calls from these CDR sources (joined with `^,^`). Ignored unless an array.
wholesale_deptidsarray of integerOptionally roll the service type down to these reseller departments (same code path as the service type editor's Wholesale Departments box). Only the listed departments are ensured; others are untouched. The result is returned as `rolled_down`.

Responses

  • 200 — Updated (or success:false with a description)

← All API groups