API : Reseller

API for Reseller Management


Get Reseller list

Authentication is Required to call this API.

POST /api/reseller/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
invoice_by N Invoice By. Allowed values: ISP, Reseller
payment_by N Payment Collection By. Allowed values: ISP, Reseller, ISP+Reseller
type N Reseller Type. Allowed values: Reseller, Franchisee
name N Reseller's Name. Accepted Partial names
code N Reseller's Code. Accepted Partial text
state N Reseller State
created_from N Created from date in yyyy-mm-dd format
created_upto N Created upto date in yyyy-mm-dd format
rows_limit N Limit the number of records in result set. Default: 10. Max value: 100
rows_offset N Fetch records from this offset position. Default: 0
sort_field N Sorts the result. Allowed values are: id, ispid, type, name, code, state, wallet. 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/reseller/list -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4"


Create Reseller

POST /api/reseller/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
ispid N ISP ID. Optional, only If above Login userid belongs to an ISP. Otherwise Required
invoice_by Y Invoice By. Allowed values: ISP, Reseller
payment_by Y Payment Collection By. Allowed values: ISP, Reseller, ISP+Reseller
type Y Reseller Type. Allowed values: Reseller, Franchisee
name Y Reseller Name
code Y Reseller Code
address N Reseller Address
mobile Y Reseller Mobile Number
email Y Reseller Email ID
state N Reseller State. Leave empty for All states
commission_percent Required, if type=Franchisee Commission Percentage to Franchisee. 0 to 100
credit_limit Required, if type=Franchisee Credit limit to Franchisee

Typical API Call

curl -X POST $BASE_URL/api/reseller/create -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d name="Reseller4" -d code="R2" -d mobile="12344444" -d email="contact@reseller4.com" -d country="India" -d invoice_by="ISP" -d payment_by="ISP" -d type="Franchisee" -d commission_percent=50 -d credit_limit=0

The expected API Response will be

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

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


Update Reseller

POST /api/reseller/update

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
ispid N ISP ID. Optional, If above Login userid belongs to an ISP
resellerid Y Reseller ID of the Reseller to update
name N Reseller Name
code N Reseller Code
address N Reseller Address
mobile N Reseller Mobile Number
email N Reseller Email ID
state N Reseller State
invoice_by N Invoice By. Allowed values: ISP, Reseller
payment_by N Payment Collection By. Allowed values: ISP, Reseller, ISP+Reseller
type N Reseller Type. Allowed values: Reseller, Franchisee
commission_percent N Commission Percentage to Franchisee. 0 to 100
credit_limit N Credit limit to Franchisee

Typical API Call

curl -X POST $BASE_URL/api/reseller/update -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d resellerid=4 -d payment_by="Reseller"

The expected API Response will be

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

Reseller Wallet Transactions

POST /api/reseller/wallet_txn

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value. Not username
api_key Y api_key for the above Userid
id N Record ID
ispid N Filter records by ISP Id
resellerid N Filter records by Reseller Id
txn_code N Filter records by Txn code. Allowed values: Invoice,Payment,Topup,Settlement,Adj
serviceid N Filter records by Service Id
created_from N Created from date in yyyy-mm-dd format
created_upto N Created upto date in yyyy-mm-dd format
rows_limit N Limit the number of records in result set. Default: 10. Max value: 100
rows_offset N Fetch records from this offset position. Default: 0
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/reseller/credits_usage -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d resellerid=1


Topup Franchisee Wallet

POST /api/reseller/wallet_update

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
ispid N ISP ID. Optional, If above Login userid belongs to an ISP
resellerid Y Reseller ID of the Reseller/Franchisee to update
action Y Allowed values: TopUp,Settlement,Adj
amt Y Amt to TopUp/Settlement/Adj. Numerical value.

Typical API Call

curl -X POST $BASE_URL/api/reseller/wallet_update -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d resellerid=3 -d action="TopUp" -d amt=10

The expected API Response will be

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

Delete Reseller

POST /api/reseller/delete

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
ispid N ISP ID. Optional, If above Login userid belongs to an ISP
resellerid Y Reseller ID of the Reseller record to delete

Typical API Call

curl -X POST $BASE_URL/api/reseller/delete -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d resellerid=3

The expected API Response will be

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