API : Service

Service Management API


Get Service list

POST /api/service/list

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value. Not username
api_key Y api_key for the above Userid
ispid N ISP ID
resellerid N Reseller ID
serviceid N Service ID
customerid N Customer ID
username N Username
planid N Plan ID
subplanid N Sub Plan ID
mac N MAC Address
bw_level N Bandwidth Level. Allowed values: 1, 2, 3
billed N Is Billed? Allowed values: Y, N
prepaid_postpaid N Allowed values: Prepaid, Postpaid
location_code N Location Code
sub_location_code N Sub Location Code
status N Status. Allowed values: Active, NP, NPD, Suspend, NewRequest
protocol N Protocol. Allowed values: PPPoE, IPoE
connectivity N Connectivity. Allowed values: Fiber, Wireless, Hotspot
ippool N IP Pool Name
ip_assignment N IP Assignment By. Allowed values: NAS, IPpool, StaticIP, Subnet
staticip N Static IP
tax_id N Tax ID. VAT/GST/Tax Number
discount_percent N Discount %. Accepted Comparison Operators, like: <50, ≤10, ≥80, =100, etc.
discount_amt N Discount Amt. Accepted Comparison Operators, like: <50, ≤10, ≥80, =100, etc.
deposit N Deposit. Accepted Comparison Operators, like: <50, ≤10, ≥80, =100, etc.
credit_limit N Credit Limit. Accepted Comparison Operators, like: <50, ≤10, ≥80, =100, etc.
used_gb N Used GB. Accepted Comparison Operators, like: <50, ≤10, ≥80, =100, etc.
os_amt N Outstanding Amt. Accepted Comparison Operators, like: <50, ≤10, ≥80, =100, etc.
service_created_from N Created from date in yyyy-mm-dd format
service_created_upto N Created upto date in yyyy-mm-dd format
valid_from N Validity from date in yyyy-mm-dd format
valid_upto N Validity upto date in yyyy-mm-dd format
rows_limit N Limit the number of records in result set. Default: 100, Max value: 100
rows_offset N Fetches records from this offset position. Default: 0
sort_field N Sorts the result. Sort field should be any one of: id, username, customerid, planid, subplanid, protocol, connectivity, prepaid_postpaid, status, used_gb, os_amt, location_code, sub_location_code, valid_from, valid_upto, deposit, staticip. Default: id
sort_order N Sort order. Allowed values are: asc, desc. Default: asc
show_count N Shows Records Count only, instead of detailed results. This will ignore rows_limit, rows_offset. Allowed values are: 0, 1. Default: 0

Typical API Call

curl -X POST $BASE_URL/api/service/list -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d resellerid=1 -d os_amt=">=1000"


Create Service

POST /api/service/create

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value. Not username
api_key Y api_key for the above Userid
customerid Y Customer ID
planid Y Plan ID
subplanid Y Sub Plan ID
username Y Username
password Y Password
bill_from N Billing start date in yyyy-mm-dd format. Default: Today's Date
billing_start_day N Billing start day of the month. Applicable only to Monthly Plans. Allowed values: 0 to 30 format. Default: Today's Date. Default: 0, 0 means day number of the renewal date.
discount_percent N Discount Percentage. Allowed values: 0 to 100. Default: 0
discount_amt N Discount Amt. Default: 0
tax_id N Customer's Tax ID. VAT/GST/Tax Number
location_code Y Location Code
sub_location_code Y Sub Location Code
protocol Y Protocol. Allowed values: PPPoE, IPoE
connectivity Y Connectivity. Allowed values: Wireless, Fibre, Hotspot
prepaid_postpaid Y Allowed values: Prepaid, Postpaid
ip_assignment N IP Assignment. Allowed values: NAS, IPpool, StaticIP. Default: NAS
ippool N IP Pool Name
staticip N Static IP. To set staticip, ippool is required.
mac N MAC Address
mac_bind N MAC Bind option. Allowed values: Auto, Manual, No. Default: Auto. To set Manual MAC bind, need to specify mac field
deposit N Deposit Amt. Default: 0
installation_amt N Installation charges. Default: 0
credit_limit N Credit Limit. Default: null
latitude N Lattitude
longitude N Longitude
installation_address Y Installation address. Allowed values: new, same. Default: same. same means, same as Customer's Address.
ia_zipcode N Installation Addr Zipcode. Required if installation_address set to new
ia_state N Installation Addr State. Required if installation_address set to new
ia_city N Installation Addr City. Required if installation_address set to new
ia_street N Installation Addr Street. Required if installation_address set to new
billing_address Y Billing address. Allowed values: new, same, ia. Default: same. ia means Installation Addr
ba_zipcode N Billing Addr Zipcode. Required if billing_address set to new
ba_state N Billing Addr State. Required if billing_address set to new
ba_city N Billing Addr City. Required if billing_address set to new
ba_street N Billing Addr Street. Required if billing_address set to new

Typical API Call

curl -X POST $BASE_URL/api/service/create -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d customerid=1450 -d planid=69 -d subplanid=157 -d username="user1234" -d password="password" -d protocol="PPPoE" -d connectivity="Fibre" -d prepaid_postpaid="Postpaid" -d location_code="LOC1" -d sub_location_code="SLC1" -d installation_address="same" -d billing_address="same"

The expected API Response will be

{
    "result": 1559,
    "error": null
}

Returns newly created Service id value, upon success. Upon failure result contains null value, and error contains error description.


Update Service

POST /api/service/update

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value. Not username
api_key Y api_key for the above Userid
password N Password
billing_start_day N Billing start day of the month. Applicable only to Monthly Plans. Allowed values: 0 to 30 format. Default: Today's Date. Default: 0, 0 means day number of the renewal date.
discount_percent N Discount Percentage. Allowed values: 0 to 100. Default: 0
discount_amt N Discount Amt. Default: 0
tax_id N Customer's Tax ID. VAT/GST/Tax Number
location_code N Location Code
sub_location_code N Sub Location Code
protocol N Protocol. Allowed values: PPPoE, IPoE
connectivity N Connectivity. Allowed values: Wireless, Fibre, Hotspot
prepaid_postpaid N Allowed values: Prepaid, Postpaid
ip_assignment N IP Assignment. Allowed values: NAS, IPpool, StaticIP. Default: NAS
ippool N IP Pool Name
staticip N Static IP. To set staticip, ippool is required.
mac N MAC Address
mac_bind N MAC Bind option. Allowed values: Auto, Manual, No. Default: Auto. To set Manual MAC bind, need to specify mac field
latitude N Lattitude
longitude N Longitude
installation_address N Installation address. Allowed values: new, same. Default: same. same means, same as Customer's Address.
ia_zipcode N Installation Addr Zipcode. Required if installation_address set to new
ia_state N Installation Addr State. Required if installation_address set to new
ia_city N Installation Addr City. Required if installation_address set to new
ia_street N Installation Addr Street. Required if installation_address set to new
billing_address N Billing address. Allowed values: new, same, ia. Default: same. ia means Installation Addr
ba_zipcode N Billing Addr Zipcode. Required if billing_address set to new
ba_state N Billing Addr State. Required if billing_address set to new
ba_city N Billing Addr City. Required if billing_address set to new
ba_street N Billing Addr Street. Required if billing_address set to new

Typical API Call

curl -X POST $BASE_URL/api/service/update -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d serviceid=1559 -d mac_bind="Manual" -d mac="65:ec:ac:76:60:0e"

The expected API Response will be

{
    "result": "Done",
    "error": null
}

Delete Service

POST /api/service/delete

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
serviceid Y Service ID to delete

Typical API Call

curl -X POST $BASE_URL/api/service/delete -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d serviceid=1559

The expected API Response will be

{
    "result": "Done",
    "error": null
}

MAC Unbind

POST /api/service/mac_unbind

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
serviceid Y Service ID to Unbind MAC

Typical API Call

curl -X POST $BASE_URL/api/service/mac_unbind -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d serviceid=1551

The expected API Response will be

{
    "result": "Done",
    "error": null
}

Plan Change

POST /api/service/planchange

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
serviceid Y Service ID to change plan
planid Y New Plan ID
subplanid Y New Sub Plan ID
schedule Y Billing schedule. But Plan changed Immediately. Allowed values: immediately, next_bill

Typical API Call

curl -X POST $BASE_URL/api/service/planchange -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d serviceid=1551 -d planid=25 -d subplanid=117 -d schedule="next_bill"

The expected API Response will be

{
    "result": "Done",
    "error": null
}

Topup

POST /api/service/topup

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
serviceid Y Service ID to Topup
topup_planid N Topup Plan ID. If topup_planid is specified, below gb, amt, type can be ignored
gb N Volume of data (in GB) to Topup. Required if topup_planid is not specified
amt N Price for the above GB. Required if topup_planid is not specified
type N Topup Type. Allowed values: Expiring, NonExpiring. Required if topup_planid is not specified. NonExpiring means the unused data balance (in GB) will be carried over to next validity renewal

Typical API Call

curl -X POST $BASE_URL/api/service/topup -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d serviceid=1551 -d gb=10 -d amt=500 -d type="Expiring"

The expected API Response will be

{
    "result": "Done",
    "error": null
}

Other actions

POST /api/service/action

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
serviceid Y Service ID to perform action
action N Action to be Executed. Allowed values: update_usage, renew, invoice, bill, suspend, np, npd, restore, reconnect

Typical API Call

curl -X POST $BASE_URL/api/service/action -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d serviceid=1551 -d action="suspend"

The expected API Response will be

{
    "result": "Done",
    "error": null
}

Usage Report

POST /api/service/usage_report

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
serviceid Y Service ID to get Usage Report
report_format Y Report format. Allowed values: detailed, day_wise_summary, month_wise_summary, year_wise_summary
source Y Data Source. Allowed values: recent, archive
date_from Y Report from date in yyyy-mm-dd
date_upto Y Report upto date in yyyy-mm-dd
nas N NAS IP address. Used only if report_format=detailed
mac N Client MAC address. Used only if report_format=detailed
ip N Client IP address. Used only if report_format=detailed

* Date range can be max 100 days for report_format=detailed & source=recent. And max date range can be 1100 days for other reports.

Typical API Call

curl -X POST $BASE_URL/api/service/usage_report -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d serviceid=1541 -d report_format="day_wise_summary" -d source="recent" -d date_from="2020-07-01" -d date_upto="2020-08-01"

The expected API Response will be

{
    "result": "Done",
    "error": null
}

© 2020 neuCRM. All rights reserved.