Call Management API
16 PracBill API endpoints for call management. Base URL https://billing.pracbill.com.au/api.
List call rate (tariff) groups (page 1).
GET /{api_key}/callRates/get/page
Responses
200— Request received successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
List call rate (tariff) groups for the given page.
GET /{api_key}/callRates/get/page/{page_number}
Responses
200— Request received successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Get a call rate group with its per-call-type rates. Run through JSON_NUMERIC_CHECK.
GET /{api_key}/callRates/get/{id}
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Create or update a call rate group and upsert its call type rates. The request body is read as raw JSON (`explode('=')` + `urldecode` + `json_decode`); because of a `$data_pats` typo in the handler the `data=` form is NOT effectively supported - send the raw JSON document (a body containing a literal '=' is truncated at the first '=').
POST /{api_key}/callRates/post
Request body
| Field | Type | Description |
|---|---|---|
ctgid | integer | Existing tariff group ID to update; when omitted/empty a new group is created. |
name | string | |
active | integer | |
billing_increment | integer | |
tags | string | |
international_markup_percent | number | |
callTypes | array of object | Tariff rows to upsert (matched on ctgid + ctid). Existing rows not listed are left untouched. |
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Create a new call pack subscription for a customer. The request body is read as raw JSON (`explode('=')` + `urldecode` + `json_decode`); because of a `$data_pats` typo in the handler the `data=` form is NOT effectively supported - send the raw JSON document (a body containing a literal '=' is truncated at the first '=').
POST /{api_key}/call_pack/add
Request body
| Field | Type | Description |
|---|---|---|
cid required | integer | Customer ID (required) |
subscription_discount_type_id required | integer | Call pack type ID (required, must exist) |
date_started | string | Defaults to today |
date_ended | string | Optional end date |
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Set the call pack end date (minimum 30 days from today). The request body is read as raw JSON (`explode('=')` + `urldecode` + `json_decode`); because of a `$data_pats` typo in the handler the `data=` form is NOT effectively supported - send the raw JSON document (a body containing a literal '=' is truncated at the first '=').
POST /{api_key}/call_pack/cancel/{id}
Request body
| Field | Type | Description |
|---|---|---|
date_ended | string | Requested end date; must be at least 30 days from today, otherwise the end date is set to today+30 and `note` is returned. Defaults to today+30. |
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Get all call packs for a customer.
GET /{api_key}/call_pack/customer/get/{cid}
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
End the call pack today and create a copy starting on the 1st of next month. No request body.
POST /{api_key}/call_pack/downgrade/{id}
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Get all call packs for the department.
GET /{api_key}/call_pack/get
Responses
200— Call packs retrieved successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Get a single call pack.
GET /{api_key}/call_pack/get/{id}
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
End the call pack today and create a copy starting on the 1st of the current month. No request body.
POST /{api_key}/call_pack/upgrade/{id}
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Create a call pack type. The request body is read as raw JSON (`explode('=')` + `urldecode` + `json_decode`); because of a `$data_pats` typo in the handler the `data=` form is NOT effectively supported - send the raw JSON document (a body containing a literal '=' is truncated at the first '=').
POST /{api_key}/call_pack_type/add
Request body
| Field | Type | Description |
|---|---|---|
name | string | |
description | string | |
customer_cost | number | Formatted to 2 dp |
customer_value | number | Formatted to 2 dp |
rate_id | integer | Call rate group ID |
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Get all call pack types for the department.
GET /{api_key}/call_pack_type/get
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Get a call pack type.
GET /{api_key}/call_pack_type/get/{id}
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Update a call pack type. The request body is read as raw JSON (`explode('=')` + `urldecode` + `json_decode`); because of a `$data_pats` typo in the handler the `data=` form is NOT effectively supported - send the raw JSON document (a body containing a literal '=' is truncated at the first '=').
POST /{api_key}/call_pack_type/update/{id}
Request body
| Field | Type | Description |
|---|---|---|
name | string | |
description | string | |
customer_cost | number | Formatted to 2 dp |
customer_value | number | Formatted to 2 dp |
rate_id | integer | Call rate group ID |
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
ROUTE COLLISION: class `cdr_tarriffgroupsGet` also declares `/serviceType/get` (copy/paste). Tonic dispatches the equal-priority match to the first-loaded class; `cdr_tarriffgroups/` sorts before `engineering/`, so this URI currently returns the call rate groups list (page 1, same shape as `/callRates/get/page`), shadowing the service type list in `engineering/serviceTypes.php`.
GET /{api_key}/serviceType/get
Responses
200— Request received successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.