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
| Field | Type | Description |
|---|---|---|
typeofservice required | string | Name of the service type (required) |
active | integer (0 | 1) | Whether the service type is active (0/1). Passed to the database unvalidated; the column default is 1. |
ratecode | string | An internal rate code |
accounting_account | integer | Accounting account number |
usage_accounting_account | integer | Accounting account used for usage charges |
invoice_type | string | The invoice type that this is to be billed on |
reporting_category | string | Group for reporting purposes |
vendor_product_id | string | Vendor's product identifier |
data_service_grade | string | Service grade (e.g. business, enterprise) |
list_price | number | Default ex tax price |
cost_price | number | Default cost price |
wholesale_price | number | Default wholesale price |
reseller_price | number | Default reseller price |
etf_ex_tax_amount | number | Fixed ex-tax early termination fee |
data_block_additional_cost | number | Cost of an additional data block |
calls_service | integer (0 | 1) | Whether to include call charges (0 or 1) |
sms_postpaid | integer (0 | 1) | Is this a sms postpaid service (0 or 1) |
data_service | integer (0 | 1) | Is this a data service (0 or 1) |
data_unlimited | integer (0 | 1) | Unlimited data (0/1) |
helpdesk_display | integer (0 | 1) | Does this record display in the helpdesk module (0 or 1) |
allow_order | integer (0 | 1) | Allowed to be ordered through the orders module (0/1) |
data_banking_enabled | integer (0 | 1) | Data banking enabled (0/1) |
etf_no_auto_calc | integer (0 | 1) | Disable automatic early termination fee calculation (0/1) |
data_included_mb | integer | Included data in MB |
data_block_additional_mb | integer | Size of an additional data block in MB |
data_bank_max_mb | integer | Data bank cap in MB |
vid | integer | Vendor/Supplier ID |
ctgid | integer | Default call rate (tariff group) to use (0 for none) |
data_service_technology | object | Data technologies. A string is stored as-is; an array is joined with `^,^` (e.g. ["FTTP","HFC"]). |
call_types | array of object | Call types allowed for this service (joined with `^,^` when stored). Ignored unless an array. |
default_call_types | array of object | Default call types for billing (joined with `^,^`). Ignored unless an array. |
source_locations | array of string | Only rate calls from these CDR sources (joined with `^,^`). Ignored unless an array. |
wholesale_deptids | array of integer | Optionally 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
| Field | Type | Description |
|---|---|---|
helpdesk_display | boolean | whether this service type displays in the helpdesk module |
invoice_type | string | The invoice type that the service type is displaye don |
calls_service | boolean | If this is a call based service |
sms_postpaid | boolean | If this is a sms postpaid service |
data_service | boolean | If this is a data service |
data_unlimited | boolean | Unlimited Data included? |
data_included_mb | integer | Number of MB included in the service, for the filter, this is an exact match and has no ability for > or < or any wilcards |
vid | integer | Vendor or Supplier ID |
vendor_product_id | string | Vendor's Product ID |
ratecode | string | The rate code for types |
data_service_technology | string | What type of data technologies |
data_service_type | string | what 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_order | boolean | If the service is allowed to be ordered through the orders module |
active | boolean | Filter by active state. Defaults to true (active only) when neither this nor include_inactive is supplied |
include_inactive | boolean | Set to true to return both active and inactive service types (ignored when `active` is supplied) |
typeofservice | string | A 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
| Field | Type | Description |
|---|---|---|
helpdesk_display | boolean | whether this service type displays in the helpdesk module |
invoice_type | string | The invoice type that the service type is displaye don |
calls_service | boolean | If this is a call based service |
sms_postpaid | boolean | If this is a sms postpaid service |
data_service | boolean | If this is a data service |
data_unlimited | boolean | Unlimited Data included? |
data_included_mb | integer | Number of MB included in the service, for the filter, this is an exact match and has no ability for > or < or any wilcards |
vid | integer | Vendor or Supplier ID |
vendor_product_id | string | Vendor's Product ID |
ratecode | string | The rate code for types |
data_service_technology | string | What type of data technologies |
data_service_type | string | what 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_order | boolean | If the service is allowed to be ordered through the orders module |
active | boolean | Filter by active state. Defaults to true (active only) when neither this nor include_inactive is supplied |
include_inactive | boolean | Set to true to return both active and inactive service types (ignored when `active` is supplied) |
typeofservice | string | A 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
| Field | Type | Description |
|---|---|---|
helpdesk_display | boolean | whether this service type displays in the helpdesk module |
invoice_type | string | The invoice type that the service type is displaye don |
calls_service | boolean | If this is a call based service |
sms_postpaid | boolean | If this is a sms postpaid service |
data_service | boolean | If this is a data service |
data_unlimited | boolean | Unlimited Data included? |
data_included_mb | integer | Number of MB included in the service, for the filter, this is an exact match and has no ability for > or < or any wilcards |
vid | integer | Vendor or Supplier ID |
vendor_product_id | string | Vendor's Product ID |
ratecode | string | The rate code for types |
data_service_technology | string | What type of data technologies |
data_service_type | string | what 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_order | boolean | If the service is allowed to be ordered through the orders module |
active | boolean | Filter by active state. Defaults to true (active only) when neither this nor include_inactive is supplied |
include_inactive | boolean | Set to true to return both active and inactive service types (ignored when `active` is supplied) |
typeofservice | string | A 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
| Field | Type | Description |
|---|---|---|
typeofservice | string | Name of the service type |
active | integer (0 | 1) | Whether the service type is active (0/1). Passed to the database unvalidated; the column default is 1. |
ratecode | string | An internal rate code |
accounting_account | integer | Accounting account number |
usage_accounting_account | integer | Accounting account used for usage charges |
invoice_type | string | The invoice type that this is to be billed on |
reporting_category | string | Group for reporting purposes |
vendor_product_id | string | Vendor's product identifier |
data_service_grade | string | Service grade (e.g. business, enterprise) |
list_price | number | Default ex tax price |
cost_price | number | Default cost price |
wholesale_price | number | Default wholesale price |
reseller_price | number | Default reseller price |
etf_ex_tax_amount | number | Fixed ex-tax early termination fee |
data_block_additional_cost | number | Cost of an additional data block |
calls_service | integer (0 | 1) | Whether to include call charges (0 or 1) |
sms_postpaid | integer (0 | 1) | Is this a sms postpaid service (0 or 1) |
data_service | integer (0 | 1) | Is this a data service (0 or 1) |
data_unlimited | integer (0 | 1) | Unlimited data (0/1) |
helpdesk_display | integer (0 | 1) | Does this record display in the helpdesk module (0 or 1) |
allow_order | integer (0 | 1) | Allowed to be ordered through the orders module (0/1) |
data_banking_enabled | integer (0 | 1) | Data banking enabled (0/1) |
etf_no_auto_calc | integer (0 | 1) | Disable automatic early termination fee calculation (0/1) |
data_included_mb | integer | Included data in MB |
data_block_additional_mb | integer | Size of an additional data block in MB |
data_bank_max_mb | integer | Data bank cap in MB |
vid | integer | Vendor/Supplier ID |
ctgid | integer | Default call rate (tariff group) to use (0 for none) |
data_service_technology | object | Data technologies. A string is stored as-is; an array is joined with `^,^` (e.g. ["FTTP","HFC"]). |
call_types | array of object | Call types allowed for this service (joined with `^,^` when stored). Ignored unless an array. |
default_call_types | array of object | Default call types for billing (joined with `^,^`). Ignored unless an array. |
source_locations | array of string | Only rate calls from these CDR sources (joined with `^,^`). Ignored unless an array. |
wholesale_deptids | array of integer | Optionally 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)