Cdr API
17 PracBill API endpoints for cdr. Base URL https://billing.pracbill.com.au/api.
List call types (page 1).
GET /{api_key}/callType/get
Responses
200— Request received successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
List call types (page 1).
GET /{api_key}/callType/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 types for the given page.
GET /{api_key}/callType/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 type with its default-group rate. Run through JSON_NUMERIC_CHECK.
GET /{api_key}/callType/get/{id}
Responses
200— Success. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
The GET handler of `CDRAdd` requires the 12 positional path segments of `/cdr/add/{orig_id}/{startdate}/...`; calling it on the bare `/cdr/add` URI invokes the handler with missing arguments and fails with a server error. Use POST here or the segment form.
GET /{api_key}/cdr/add
Responses
200— Not reachable on the bare URI. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.500— Handler invoked without its required path arguments (PHP ArgumentCountError)
Add a single CDR (Call Detail Record) for billing. Important: the API key must have the cdr_source variable set (else `No Valid CDR Source`). Request body is the raw JSON document (json_decode of the request body).
POST /{api_key}/cdr/add
Request body
| Field | Type | Description |
|---|---|---|
orig_id required | string | Unique ID from your platform/provider (the alias `id` is also accepted). Required. |
startdate required | string | Call start time (must be on/after 2015-01-01). Required. |
enddate | string | Call end time |
accountcode | string | Billing account identifier |
callerid required | string | Caller ID / A Party (normalised to E.164). Required. |
did | string | Inbound phone number (for inbound calls) |
direction | string (inbound | outbound) | Call direction (not validated) |
destination required | string | Destination number / B Party (normalised to E.164). Required. |
destination_info | string | Description of destination |
application | string | Internal application (Voicemail, IVR, Queue, etc.) |
duration | integer | Total call duration in seconds |
billsec required | integer | Billable seconds. Required and must be non-zero (empty() check - 0 is rejected as `billsec is required`). |
cost | number | Cost of the call |
data_used | number | Data used (data CDRs) |
disposition | string | Call status (ANSWERED, NO_ANSWER, BUSY, etc.) |
privacy_flag | integer (0 | 1) | Hide A Party from screens/outputs (0 or 1) |
Responses
200— CDR processed. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Add a single CDR using URL path segments (`privacy_flag` is stored as 0, `disposition` forced to `ANSWERED`). Same response as POST /cdr/add. Use `/` placeholders-free values; every segment is required.
GET /{api_key}/cdr/add/{orig_id}/{startdate}/{callerid}/{destination}/{direction}/{accountcode}/{did}/{disposition}/{duration}/{billsec}/{cost}/{application}
Responses
200— CDR processed. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Same handler as POST /cdr/add: the JSON body is used and the extra path segments are ignored.
POST /{api_key}/cdr/add/{orig_id}/{startdate}/{callerid}/{destination}/{direction}/{accountcode}/{did}/{disposition}/{duration}/{billsec}/{cost}/{application}
Request body
| Field | Type | Description |
|---|---|---|
orig_id required | string | Unique ID from your platform/provider (the alias `id` is also accepted). Required. |
startdate required | string | Call start time (must be on/after 2015-01-01). Required. |
enddate | string | Call end time |
accountcode | string | Billing account identifier |
callerid required | string | Caller ID / A Party (normalised to E.164). Required. |
did | string | Inbound phone number (for inbound calls) |
direction | string (inbound | outbound) | Call direction (not validated) |
destination required | string | Destination number / B Party (normalised to E.164). Required. |
destination_info | string | Description of destination |
application | string | Internal application (Voicemail, IVR, Queue, etc.) |
duration | integer | Total call duration in seconds |
billsec required | integer | Billable seconds. Required and must be non-zero (empty() check - 0 is rejected as `billsec is required`). |
cost | number | Cost of the call |
data_used | number | Data used (data CDRs) |
disposition | string | Call status (ANSWERED, NO_ANSWER, BUSY, etc.) |
privacy_flag | integer (0 | 1) | Hide A Party from screens/outputs (0 or 1) |
Responses
200— CDR processed. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
List customers that have a CDR export configured (cdr_export_frequency and cdr_export_format both set), reporting the last export run, the computed next run, and the export path and format. By default only customers whose next run is still pending are returned, for export-run monitoring/alerting. Pass `include_inactive` to list every configured customer.
GET /{api_key}/cdr/exports
Responses
200— Request received successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
List customers that have a CDR export configured (cdr_export_frequency and cdr_export_format both set), reporting the last export run, the computed next run, and the export path and format. By default only customers whose next run is still pending are returned, for export-run monitoring/alerting. Pass `include_inactive` to list every configured customer.
GET /{api_key}/cdr/exports/{include_inactive}
Responses
200— Request received successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Retrieve rating information for multiple CDRs (by orig_id). Request body is raw JSON.
POST /{api_key}/cdr/getMultiplePrice
Request body
Either a bare JSON array of orig_ids or an object `{"data": [..]}`. Parsed with json_decode of the raw body.
Responses
200— Request received successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Retrieve rating information for a specific CDR (limited to the api key's cdr_source(s)). Values are raw DB strings.
GET /{api_key}/cdr/getPrice/{id}
Responses
200— Request received successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Add multiple CDRs in one call. The body is a raw JSON array of CDR objects.
POST /{api_key}/cdr/multiple/add
Request body
Array of:
| Field | Type | Description |
|---|---|---|
orig_id required | string | Unique ID from your platform/provider (the alias `id` is also accepted). Required. |
startdate required | string | Call start time (must be on/after 2015-01-01). Required. |
enddate | string | Call end time |
accountcode | string | Billing account identifier |
callerid required | string | Caller ID / A Party (normalised to E.164). Required. |
did | string | Inbound phone number (for inbound calls) |
direction | string (inbound | outbound) | Call direction (not validated) |
destination required | string | Destination number / B Party (normalised to E.164). Required. |
destination_info | string | Description of destination |
application | string | Internal application (Voicemail, IVR, Queue, etc.) |
duration | integer | Total call duration in seconds |
billsec required | integer | Billable seconds. Required and must be non-zero (empty() check - 0 is rejected as `billsec is required`). |
cost | number | Cost of the call |
data_used | number | Data used (data CDRs) |
disposition | string | Call status (ANSWERED, NO_ANSWER, BUSY, etc.) |
privacy_flag | integer (0 | 1) | Hide A Party from screens/outputs (0 or 1) |
Responses
200— CDRs processed (one result per CDR). Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Latest CDR activity per CDR source for the department over the last two months. Source activity is judged on `processed` time (CDRs processed in the last two months, latest `startdate`).
GET /{api_key}/cdr/ratingStatus
Responses
200— Request received successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Identical to POST /cdr/add (adds a single CDR) - the handler is a copy of CDRAdd::post.
POST /{api_key}/cdr/ratingStatus
Request body
| Field | Type | Description |
|---|---|---|
orig_id required | string | Unique ID from your platform/provider (the alias `id` is also accepted). Required. |
startdate required | string | Call start time (must be on/after 2015-01-01). Required. |
enddate | string | Call end time |
accountcode | string | Billing account identifier |
callerid required | string | Caller ID / A Party (normalised to E.164). Required. |
did | string | Inbound phone number (for inbound calls) |
direction | string (inbound | outbound) | Call direction (not validated) |
destination required | string | Destination number / B Party (normalised to E.164). Required. |
destination_info | string | Description of destination |
application | string | Internal application (Voicemail, IVR, Queue, etc.) |
duration | integer | Total call duration in seconds |
billsec required | integer | Billable seconds. Required and must be non-zero (empty() check - 0 is rejected as `billsec is required`). |
cost | number | Cost of the call |
data_used | number | Data used (data CDRs) |
disposition | string | Call status (ANSWERED, NO_ANSWER, BUSY, etc.) |
privacy_flag | integer (0 | 1) | Hide A Party from screens/outputs (0 or 1) |
Responses
200— CDR processed. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Latest CDR activity per CDR source for the department over the last two months. Source activity is judged on `startdate` (call time).
GET /{api_key}/cdr/status
Responses
200— Request received successfully. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.
Identical to POST /cdr/add (adds a single CDR) - the handler is a copy of CDRAdd::post.
POST /{api_key}/cdr/status
Request body
| Field | Type | Description |
|---|---|---|
orig_id required | string | Unique ID from your platform/provider (the alias `id` is also accepted). Required. |
startdate required | string | Call start time (must be on/after 2015-01-01). Required. |
enddate | string | Call end time |
accountcode | string | Billing account identifier |
callerid required | string | Caller ID / A Party (normalised to E.164). Required. |
did | string | Inbound phone number (for inbound calls) |
direction | string (inbound | outbound) | Call direction (not validated) |
destination required | string | Destination number / B Party (normalised to E.164). Required. |
destination_info | string | Description of destination |
application | string | Internal application (Voicemail, IVR, Queue, etc.) |
duration | integer | Total call duration in seconds |
billsec required | integer | Billable seconds. Required and must be non-zero (empty() check - 0 is rejected as `billsec is required`). |
cost | number | Cost of the call |
data_used | number | Data used (data CDRs) |
disposition | string | Call status (ANSWERED, NO_ANSWER, BUSY, etc.) |
privacy_flag | integer (0 | 1) | Hide A Party from screens/outputs (0 or 1) |
Responses
200— CDR processed. Failures (invalid key, validation, not found) are also returned with HTTP 200 and `success: false` + `description`.