The PracBill API is a JSON over HTTPS interface for pushing call records, customers, services and payments into your billing department, and for pulling invoices, prices and reports back out. It is for developers integrating a carrier switch, a CRM, a sales portal or a reporting tool with PracBill.
Every call is made against your department's portal with your API token in the path:
https://billing.pracbill.com.au/api/:tokenid/<endpoint>
Start with Getting started with the API to create a token and run the first request.
| Page | Covers |
|---|---|
| Getting started | Tokens, key generation, base URL, JavaScript and PHP examples, demo database reset |
| Customers | Search, list, create and update customers; balance; take a payment; contacts |
| Services | Services, service types, service bundles, monthly charges |
| Invoices | Invoice retrieval and creation |
| Credit management | Read and set the credit management flag on a customer |
| CDR | Add call records, check status, get a price, exports |
| Call rates and call types | Rate cards and call type classification |
| Price books, pricing and products | Price books, price lookups and products |
| External sales and orders | Push sales and order data from an external system |
| Bulk email | Send bulk email campaigns |
| IPND CSV bulk upload | Bulk load IPND records from CSV |
| Reporting | Run any report in the Reports module and get the rows as JSON |
| Webhooks | Outbound event notifications |
If an endpoint is missing from these pages, check the OpenAPI spec at https://billing.pracbill.com.au/api-docs/.
The timeline holds notes and events against a record in any module (for example a customer). Read it with GET, add or edit an entry with POST.
GET /:tokenid/timeline/:module/:idReturns the timeline entries for a record.
| Parameter | Type | Required | Description |
|---|---|---|---|
tokenid |
string | Yes | Your API access token. |
module |
string | Yes | Module name, e.g. customers. |
id |
integer | Yes | Record ID within the module. You must pass a value (or at least a space) so the URL validates. |
Request
https://portal.xenis.com.au/api/892f86d5-da86-4e98-9343-1976a375/customers/5558888
POST /:tokenid/timeline/:module/:idPosts a JSON object. Include id to edit an existing entry.
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | No | Entry ID, used when editing an existing record. |
title |
string | Yes | Note title. |
category |
string | Yes | note or event. |
description |
string | Yes | Content of the note. |
Request
var myData = {
id: 123456, // used for editing records
title: 'Note Title',
category: 'note', // can either be note or event see below
description: 'This is the content of the note'
}
$.ajax({
url: '/api/892f86d5-da86-4e98-9343-1976a375/timeline/customers/5558888',
data: JSON.stringify(myData),
type: 'POST',
contentType: 'application/json',
success: function( response ) {
console.log(response);
}
});
POST /:tokenid/timeline/:module/:idSame endpoint with category: "event" and an event_date.
| Parameter | Type | Required | Description |
|---|---|---|---|
title |
string | Yes | Event title. |
category |
string | Yes | event. |
event_date |
string | Yes | YYYY-MM-DD HH:MM:SS. |
description |
string | Yes | Event content. |
Request
var myData = {
title: "Test Event",
category: "event",
event_date: "2016-12-24 09:00", // date is in following format YYYY-MM-DD HH:MM:SS
description: "This is my First Test"
}
$.ajax({
url: '/api/892f86d5-da86-4e98-9343-1976a375/timeline/customers/5558888',
data: JSON.stringify(myData),
type: 'POST',
contentType: 'application/json',
success: function( response ) {
console.log(response);
}
});
Related: Getting started with the API, Integrations.