Services

Services

Services - List - To be Implemented

Retrieve a paginated list of service types and basic information

GET json object

URI

/:tokenid/services/get/page/:pageNumber

Example

Request

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/get/page/1',     type: 'GET',     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Response

Success Result

{ "results": [ { "esid": "123", "typeofservice": "Cool Service", "calls_service": "1", "list_price": "15.0000", "wholesale_price": "10.0000", "reseller_price": "12.5000", "reporting_category": "Cool Customers Services", "ratecode": null }, ], "page_number": "1", "total_pages": 1 }

Service - Search

Return further details about a service

POST json object

URI

/:tokenid/services/search

Example

Request

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/search',     type: 'POST', data: [ { "field": "service_num", "operator": "=", "value": "1300555777" } ],     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Allowed Searchable Fields

id

cid

username

service_num

start_date

ip_ipadd

monthlyfee

date_ended

call_rates_id

billing_name

date_created

date_modified

active_services ** This is a magic searchable field that will return active services in the search ** The value and operator don’t matter as long as the field is set

Allowed Operators

Operator

Description

Operator

Description

=

Value must =

like

This expands the search to allow for anything before or after the value passed in. e.g. { ‘field’: ‘billing_name’, ‘operator’: ‘like’, ‘value’: ‘fax’ } = search anything with fax in the billing_name field some example matches would be: fax, home fax, fax office, faxmachine

This is also the default operator if it is not passed in

<

Less Than

>

Greater Than

<=

Less Than or equal to

>=

Greater Than or equal to

!=

Does not equal

Response

Success Result

 

{ "success": true, "records": [ { "id": 5558888, "cid": 555333, "username": null, "service_num": 1300555777, "servicetype": "", "start_date": "2011-07-01", "ip_ipadd": "", "monthlyfee": 50, "date_ended": null, "call_rates_id": null, "billing_name": "My Number", "date_created": null, "date_modified": "2020-09-11 11:50:44" }, ] }

Error/Fail

{"success":false,"description":"Invalid or no search criteria"}

Service - GET

Return further details about a service

GET json object

URI

/:tokenid/services/get/:id

Example

Request

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/get/123',     type: 'GET',     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Response

Success Result

 

{ "success": true, "serviceType": { "id": "123", "cid": "45646", "service_num": "1300111222", "start_date": "2020-05-01", "servicetype": "1", "monthlyfee": "100.00", "date_ended": "2020-07-01", "billing_cycle": "", "contracterm": "24 Months", "billing_name": "Cool Service", "call_rates_id": 0, "bundle_id": 0, "cost": "", "quantity": 1, } }
Field Definition

Field

Type

Notes

Field

Type

Notes

id

integer

ID of service

cid

integer

Customer ID

service_num

string

The Phone Number or ID of the service

start_date

date

Date Service Started

servicetype

integer

ID of service type

monthlyfee

decimal

Ex Tax monthly recurring fee

date_ended

date

Date Service Ended

billing_cycle

string

If there is a custom billing cycle for this service - rarely used

contractterm

string

Term of contract for service

billing_name

string

Human readable/Customer Name for service

call_rates_id

integer (nullable)

Id of call rates if service specific

bundle_id

integer (nullable)

Id of service bundle if applicable

cost

decimal

the cost price of the service

quantity

decimal

The count of “hidden” services, users or channels that are associated with this service

parent_id

integer (nullable)

The ID or a parent or related service

Error/Fail

{"success":false,"description":"service not found"}

Service - Create

Create a new service record.

POST json object

URI

/:tokenid/services/add

Example

Request

Notes

  • If you do not pass in monthlyfee the price is calculated for that customer and populated ( it will either be the default (list price) of the service type or get the price from the customer’s price book )

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/add',     type: 'POST', data: { cid: 123, servicetype: 1, service_num: 1300111222, start_date: '2020-10-01', monthlyfee: "10.00" },     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Response

Success Result

 

{ "success": true, "id": 204334, }

Service - Update

Update Details about a service

POST json object

URI

/:tokenid/services/update/:id

Example

Request

field

Information

field

Information

monthlyfee

if monthlyfee is passed in as a boolean false then the system will calculate the current monthlyfee for this customer, utilising price books or default list price for the servicetype.

This is most useful if you are changing servicetype for whatever reason, or you want to update the customer to the current pricing from a grandfathered pricing

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/update/204334',     type: 'POST', data: { cid: 123, servicetype: 1, service_num: 1300111222, start_date: '2020-10-01', monthlyfee: "10.00" },     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Response

Success Result

 

{ "success": true, "id": 204334, }

Service - Add Misc Item

Create a misc Item/charge for a service

POST json object

URI

/:tokenid/services/update/:id

Example

Request

field

Required

Information

field

Required

Information

enid

yes

Service ID

pid

yes

Product ID

charge_date

yes

Date to set the charge at, if set in the future, it will not be generated on an invoice until after this date

taxrate

no

Override the taxrate ( may be used for export billing )

description

no

Override the product description, with a custom description that will be place on the invoice when it’s created

inc_tax_amount

no

Override the product tax inclusive price

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/item/add',     type: 'POST', data: { enid: 321, pid: 123, charge_date: '2018-05-06, taxrate: 10, description: 'Custom Charge Description i.e. Special Service Activation for 321', inc_tax_amount: "10.00" },     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Response

Success Result

 

{ "success": true, "id": 23389, }

 

Service Related Services - GET

Return further details about a service

GET json object

URI

/:tokenid/services/getRelatedServices/:id

Example

Request

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/getRelatedServices/123',     type: 'GET',     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Response

Success Result

 

{ "success": true, "records": [ { "id": "231", "cid": "45646", "service_num": "1300111222", "start_date": "2020-05-01", "servicetype": "1", "monthlyfee": "100.00", "date_ended": "2020-07-01", "billing_cycle": "", "contracterm": "24 Months", "billing_name": "Cool Service", "call_rates_id": 0, "bundle_id": 0, "cost": "", "quantity": 1, "parent_id": 123, }, { "id": "213", "cid": "45646", "service_num": "1300222111", "start_date": "2020-01-01", "servicetype": "1", "monthlyfee": "100.00", "date_ended": "2020-09-01", "billing_cycle": "", "contracterm": "24 Months", "billing_name": "Other Cool Service", "call_rates_id": 0, "bundle_id": 0, "cost": "", "quantity": 1, "parent_id": 123, }, ] }

 

Service - Calculate Early Termination Fee - GET

Return the early termination details for a service

GET json object

URI

/:tokenid/services/:id/calculateETF /:tokenid/services/:id/calculateETF/:date

The date is an optional parameter, if not passed in, the current date is used.

Example

Request

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/123/caculateETF/2021-01-01',     type: 'GET',     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Response

Success Result

{ "in_contract": true, "billed_until": "2020-05-31", "etf_date": "2021-01-01", "contract_end_date": "2021-12-31", "amount_remaining": 60, "etf": 110, }
Response Fields

Field

Type

Notes

Field

Type

Notes

in_contract

boolean

Is the service in contract

billed_until

date

The date the service has been billed until

etf_date

date

Date the etf will start to take effect

contract_end_date

date

End date of service

amount_remaining

decimal

The amount remaining on the contract, if paid in full

etf

decimal

The calculated ETF based on the service type

Service - Do Early Termination Fee - GET

Return the early termination details for a service

GET json object

URI

/:tokenid/services/:id/doETF /:tokenid/services/:id/doETF/:date

The date is an optional parameter, if not passed in, the current date is used.

Example

Request

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/123/doETF/2021-01-01',     type: 'GET',     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Response

Success Result

{ "success": true, }

Service - Calculate Early Multiple Termination Fee - POST

Return the early termination details for multiple service

POST json object

URI

/:tokenid/services/:id/calculateMultipleETF /:tokenid/services/:id/calculateMultipleETF/:date

The date is an optional parameter, if not passed in, the current date is used.

Example

Request

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/caculateMultipleETF/2021-01-01',     type: 'POST', data: [ 123, 234 ],     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Response

Success Result

[ { "in_contract": true, "billed_until": "2021-01-31", "etf_date": "2021-02-01", "contract_end_date": "2021-10-31", "amount_remaining": 30, "etf": 30, "enid": 234 }, { "in_contract": true, "billed_until": "2020-05-31", "etf_date": "2021-01-01", "contract_end_date": "2021-12-31", "amount_remaining": 60, "etf": 110, "enid": 123 } ]

Service - Do Multiple Early Termination Fee - POST

Return the early termination details for a service

POST json object

URI

/:tokenid/services/:id/doMultipleETF /:tokenid/services/:id/doMultipleETF/:date

The date is an optional parameter, if not passed in, the current date is used.

Example

Request

Example Javascript/Jquery

$.ajax({     url: '/api/892f86d5-da86-4e98-9343-1976a375/services/doMultipleETF/2021-01-01',     type: 'POST', data: [123,234]     contentType: 'application/json',     success: function( response ) {         console.log(response);         }     });

Response

Success Result

[ { "success": true, "enid": 123 }, { "success": true, "enid": 234 } ]: 234 } ]