SmartISP API v1.0

We follow the RESTful principles, so the API is stateless and http methods and response codes are used whenever possible.

The url for the requests is:

http://PATH_TO_YOUR_SMARTISP/api/SmartIPS-v1/

Create API Key

For create API key please follow below images.


Get all plans

This endpoint is used to get all plans .

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.

Response

                        
# Here is a curl example
curl \
-X GET http://smartispv7.test/api/SmartIPS-v1/plans \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte'
                
 # Result example :
{
    "plans": [
        {
            "id": 1,
            "name": "Plan Hogar 50M",
            "download": 51200,
            "upload": 51200,
            "num_clients": 0,
            "cost": "18.70",
            "iva": "15.00",
            "burst_limit": 0,
            "burst_threshold": 0,
            "burst_time": 0,
            "priority": 5,
            "limitat": 100,
            "aggregation": 1,
            "title": null,
            "no_rules": 0,
            "address_list_name": null
        },
        {
            "id": 2,
            "name": "Plan Plus 60M",
            "download": 61440,
            "upload": 61440,
            "num_clients": 0,
            "cost": "21.74",
            "iva": "15.00",
            "burst_limit": 0,
            "burst_threshold": 0,
            "burst_time": 0,
            "priority": 5,
            "limitat": 100,
            "aggregation": 1,
            "title": null,
            "no_rules": 0,
            "address_list_name": null
        },
        {
            "id": 3,
            "name": "Plan GOLD 80M",
            "download": 81920,
            "upload": 81920,
            "num_clients": 0,
            "cost": "26.09",
            "iva": "15.00",
            "burst_limit": 0,
            "burst_threshold": 0,
            "burst_time": 0,
            "priority": 5,
            "limitat": 100,
            "aggregation": 1,
            "title": null,
            "no_rules": 0,
            "address_list_name": null
        },
        {
            "id": 4,
            "name": "Plan Premium 100M",
            "download": 102400,
            "upload": 102400,
            "num_clients": 0,
            "cost": "30.44",
            "iva": "15.00",
            "burst_limit": 0,
            "burst_threshold": 0,
            "burst_time": 0,
            "priority": 5,
            "limitat": 100,
            "aggregation": 1,
            "title": null,
            "no_rules": 0,
            "address_list_name": null
        },
        {
            "id": 5,
            "name": "Plan VIP 120M",
            "download": 122880,
            "upload": 122880,
            "num_clients": 0,
            "cost": "34.35",
            "iva": "15.00",
            "burst_limit": 0,
            "burst_threshold": 0,
            "burst_time": 0,
            "priority": 5,
            "limitat": 100,
            "aggregation": 1,
            "title": null,
            "no_rules": 0,
            "address_list_name": null
        }
    ]
}
                    

Get all routers list

This endpoint is used to get all routers list .

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.

Response

                        
# Here is a curl example
curl \
-X GET http://smartispv7.test/api/SmartIPS-v1/routers \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte'
                
# Result example :
{
    "routers": [
        {
            "id": 1,
            "name": "CC2116_LAGO",
            "model": "CCR2116-12G-4S+",
            "ip": "10.8.0.2",
            "location": "Lago Agrio",
            "coordinates": "0.09786839494370964,-76.88995242118837",
            "clients": 564,
            "status": "on",
            "connection": 0,
            "login": "SmarL0goA",
            "password": "ihHb+ejQjO3ILLhTlLePbPFR8Su1eyQJwLK9JBtVfQAXICUkfIV5b5c2SCYlQwiA==",
            "port": 8738,
            "lan": "",
            "created_at": "2024-04-01T23:23:31.000000Z",
            "updated_at": "2024-10-07T06:30:06.000000Z",
            "map_marker_icon": null
        },
        {
            "id": 2,
            "name": "JANDIACU",
            "model": "CCR1009-7G-1C-1S+",
            "ip": "10.8.0.3",
            "location": "Nodo Jandiacu",
            "coordinates": "",
            "clients": 128,
            "status": "on",
            "connection": 0,
            "login": "Jandia",
            "password": "NV20SneQS/BX7159KPYc47JMLC56yQKHKMlsZq8NW/irWbjgouk16bD9",
            "port": 8740,
            "lan": "",
            "created_at": "2024-04-01T23:43:14.000000Z",
            "updated_at": "2024-10-05T09:00:07.000000Z",
            "map_marker_icon": null
        },
        {
            "id": 3,
            "name": "DURENO",
            "model": "CCR1009-7G-1C-1S+",
            "ip": "10.8.0.4",
            "location": "DURENO",
            "coordinates": "0.0514018445631743,-76.67923458097841",
            "clients": 28,
            "status": "on",
            "connection": 0,
            "login": "APIDure",
            "password": "Fnb1MtqVv1I7Jw/SkdAJynnH3D0DLZ64HWRp9pj",
            "port": 8742,
            "lan": "",
            "created_at": "2024-04-01T23:47:32.000000Z",
            "updated_at": "2024-10-04T23:03:32.000000Z",
            "map_marker_icon": null
        }
    ]
}
                    

Create User

Create new user.

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.
name string Body Required User full name.
phone number Body Required User phone number.
email email Body Required User email address.
dni string Body Required User login.
billing_due_date number Body Required any day from 1 to 30.
pass string Body Required Password

Response

                        
# Here is a curl example
curl \
-X POST http://smartispv7.test/api/SmartIPS-v1/create-client \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte' \
-H 'Accept=application/json'
                
# Result example :
{
    "status": true,
    "client": {
        "name": "Nick",
        "phone": "1212121212",
        "email": "nick@gmail.com",
        "id_punto_emision": null,
        "dni": 3443454,
        "id": 0,
        "subscriber_no": "0815"
    },
    "message": "Client successfully added"
}
                    

Create service

Create new service for user.

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.
dni string URL Required User dni.
router number Body Required router id.
router number Body Required router id.
plan number Body Required plan id.
date_in email Body Required service start date for example: 18-10-2024.
ip ip Body Required ip address.
user_hot string Body Required mikrotik username.
pass_hot string Body Required mikrotik password
mac string Body Required MAC address
send_invoice Boolean Body not required need to send invoice or not
billing_type String Body not required for example : recurring

Response

                        
# Here is a curl example
curl \
-X POST http://smartispv7.test/api/SmartIPS-v1/create-service/3443454 \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte' \
-H 'Accept=application/json'
                
# Result example :
{
    "status": true,
    "message": "Service successfully created.",
    "service": {
        "id": 844,
        "client_id": 818,
        "ip": "172.16.24.1",
        "mac": "00:00:00:00:00:00",
        "date_in": "2024-10-18",
        "plan_id": 1,
        "router_id": 1,
        "status": "ac",
        "user_hot": "owBeaAR",
        "pass_hot": "8gwMp+55p0sbubs8j61Ith8U/xpdEQItuBgD1SGlvOwr/dl4OXOF9dqFdew2YcYemjKzaO2M+sjcc8kO1XP35A==",
        "typeauth": null,
        "onmikrotik": 1,
        "created_at": "2024-10-18",
        "updated_at": "2024-10-18",
        "billing_type": "recurring",
        "online": "ver",
        "tree_priority": 0,
        "manually_cortado": 0,
        "smartolt_sn": null,
        "geo_json": null,
        "geo_json_styles": null,
        "send_invoice": 0,
        "ipv6": "",
        "ipv6_delegated": "",
        "client": {
            "id": 818,
            "name": "Nick",
            "email": "nick@gmail.com",
            "phone": "1212121212",
            "address": null,
            "coordinates": null,
            "photo": "",
            "dni": "3443454",
            "dv": null,
            "custom_token_nuvai": null,
            "created_at": "2024-10-18 15:49:44",
            "updated_at": null,
            "balance": "0.00",
            "odb_id": null,
            "onu_id": null,
            "port": null,
            "onusn": null,
            "zona_id": null,
            "type_document_identification_id": 0,
            "type_organization_id": 0,
            "municipality_id": 0,
            "type_liability_id": 0,
            "type_regime_id": 0,
            "merchant_registration": null,
            "adjustable_amount": "0.00",
            "id_punto_emision": null,
            "wallet_balance": 0,
            "map_marker_icon": null,
            "odb_geo_json": null,
            "odb_geo_json_styles": null,
            "subscriber_no": "0815",
            "electronic_invoice": "No"
        }
    }
}
                    

Get User

Fetch user details by using DNI Number. This endpoint provides user information with user invoices. To use this API, you need an API key. Please contact to your service provider for get the API key.

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.
dni string URL Required User DNI number.

Response

                        
# Here is a curl example
curl \
-X GET http://smartispv7.test/api/SmartIPS-v1/get-user/{user dni} \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte'
                
# Result example :
{
    "user": {
        "id": 1,
        "name": "Shiguango Esthela",
        "email": "jaquelines@gmail.com",
        "phone": "453345467",
        "address": "Sector Jansdiacu",
        "coordinates": null,
        "photo": "",
        "dni": "3453456",
        "dv": null,
        "custom_token_nuvai": null,
        "created_at": "2024-04-02 19:00:15",
        "updated_at": null,
        "balance": "0.00",
        "odb_id": null,
        "onu_id": null,
        "port": null,
        "onusn": null,
        "zona_id": null,
        "type_document_identification_id": 3,
        "type_organization_id": 1,
        "municipality_id": 1,
        "type_liability_id": 117,
        "type_regime_id": 2,
        "merchant_registration": null,
        "adjustable_amount": "0.00",
        "id_punto_emision": null,
        "wallet_balance": 0,
        "map_marker_icon": null,
        "odb_geo_json": null,
        "odb_geo_json_styles": null,
        "subscriber_no": "0001",
        "electronic_invoice": "No",
    },
    "invoices": {
        "invoices_smartISP": [
            {
                "id": 0,
                "num_bill": "3112",
                "period": "2024-04-21",
                "release_date": "2024-03-21",
                "expiration_date": "2024-03-21",
                "iva": "0.00",
                "cost": "0.00",
                "total_pay": "330.00",
                "actual_total_pay": null,
                "status": 3,
                "client_id": 1,
                "service_id": null,
                "open": 0,
                "created_at": "2024-10-11",
                "updated_at": "2024-10-11",
                "note": "sqws",
                "memo": "sqws",
                "xero_id": null,
                "paid_on": null,
                "start_date": "2024-03-21",
                "use_transactions": "0",
                "billing_type": "none",
                "recurring_invoice": "no",
                "cortado_date": "2024-10-27",
                "csv_generated": 0,
                "payment_id": null
            },
            {
                "id": 1,
                "num_bill": "2",
                "period": "2024-04-30",
                "release_date": "2024-04-02",
                "expiration_date": "2024-04-30",
                "iva": "15.00",
                "cost": "18.70",
                "total_pay": "21.51",
                "actual_total_pay": null,
                "status": 1,
                "client_id": 1,
                "service_id": 1,
                "open": 0,
                "created_at": "2024-10-07",
                "updated_at": "2024-04-24",
                "note": null,
                "memo": null,
                "xero_id": null,
                "paid_on": "2024-04-23",
                "start_date": "2024-04-01",
                "use_transactions": "0",
                "billing_type": "recurring",
                "recurring_invoice": "no",
                "cortado_date": "2024-04-16",
                "csv_generated": 0,
                "payment_id": null
            },
            {
                "id": 761,
                "num_bill": "774",
                "period": "2024-05-31",
                "release_date": "2024-05-01",
                "expiration_date": "2024-05-31",
                "iva": "15.00",
                "cost": "18.70",
                "total_pay": "21.51",
                "actual_total_pay": null,
                "status": 1,
                "client_id": 1,
                "service_id": null,
                "open": 0,
                "created_at": "2024-10-07",
                "updated_at": "2024-05-16",
                "note": null,
                "memo": null,
                "xero_id": null,
                "paid_on": "2024-05-15",
                "start_date": "2024-05-01",
                "use_transactions": "0",
                "billing_type": null,
                "recurring_invoice": "no",
                "cortado_date": "2024-05-16",
                "csv_generated": 0,
                "payment_id": null
            },
            {
                "id": 1523,
                "num_bill": "1549",
                "period": "2024-06-30",
                "release_date": "2024-06-01",
                "expiration_date": "2024-06-30",
                "iva": "15.00",
                "cost": "18.70",
                "total_pay": "21.51",
                "actual_total_pay": null,
                "status": 1,
                "client_id": 1,
                "service_id": null,
                "open": 0,
                "created_at": "2024-10-07",
                "updated_at": "2024-07-03",
                "note": null,
                "memo": null,
                "xero_id": null,
                "paid_on": "2024-07-02",
                "start_date": "2024-06-01",
                "use_transactions": "0",
                "billing_type": null,
                "recurring_invoice": "no",
                "cortado_date": "2024-06-16",
                "csv_generated": 0,
                "payment_id": null
            },
            {
                "id": 2251,
                "num_bill": "2286",
                "period": "2024-07-31",
                "release_date": "2024-07-01",
                "expiration_date": "2024-07-31",
                "iva": "15.00",
                "cost": "18.70",
                "total_pay": "21.51",
                "actual_total_pay": null,
                "status": 1,
                "client_id": 1,
                "service_id": null,
                "open": 0,
                "created_at": "2024-10-07",
                "updated_at": "2024-07-31",
                "note": null,
                "memo": null,
                "xero_id": null,
                "paid_on": "2024-07-26",
                "start_date": "2024-07-01",
                "use_transactions": "0",
                "billing_type": null,
                "recurring_invoice": "no",
                "cortado_date": "2024-07-16",
                "csv_generated": 0,
                "payment_id": null
            },
            {
                "id": 2982,
                "num_bill": "3021",
                "period": "2024-08-31",
                "release_date": "2024-08-01",
                "expiration_date": "2024-08-31",
                "iva": "15.00",
                "cost": "18.70",
                "total_pay": "21.51",
                "actual_total_pay": null,
                "status": 1,
                "client_id": 1,
                "service_id": null,
                "open": 0,
                "created_at": "2024-10-07",
                "updated_at": "2024-08-17",
                "note": null,
                "memo": null,
                "xero_id": null,
                "paid_on": "2024-08-16",
                "start_date": "2024-08-01",
                "use_transactions": "0",
                "billing_type": null,
                "recurring_invoice": "no",
                "cortado_date": "2024-08-16",
                "csv_generated": 0,
                "payment_id": null
            },
            {
                "id": 3712,
                "num_bill": "3751",
                "period": "2024-09-30",
                "release_date": "2024-09-01",
                "expiration_date": "2024-09-30",
                "iva": "15.00",
                "cost": "18.70",
                "total_pay": "21.51",
                "actual_total_pay": null,
                "status": 1,
                "client_id": 1,
                "service_id": null,
                "open": 0,
                "created_at": "2024-10-07",
                "updated_at": "2024-09-18",
                "note": null,
                "memo": null,
                "xero_id": null,
                "paid_on": "2024-09-18",
                "start_date": "2024-09-01",
                "use_transactions": "0",
                "billing_type": null,
                "recurring_invoice": "no",
                "cortado_date": "2024-09-16",
                "csv_generated": 0,
                "payment_id": null
            },
            {
                "id": 4585,
                "num_bill": "4624",
                "period": "2024-10-31",
                "release_date": "2024-10-01",
                "expiration_date": "2024-10-31",
                "iva": "15.00",
                "cost": "18.70",
                "total_pay": "21.51",
                "actual_total_pay": null,
                "status": 3,
                "client_id": 1,
                "service_id": 1,
                "open": 0,
                "created_at": "2024-10-07",
                "updated_at": "2024-10-01",
                "note": null,
                "memo": null,
                "xero_id": null,
                "paid_on": null,
                "start_date": "2024-10-01",
                "use_transactions": "0",
                "billing_type": null,
                "recurring_invoice": "no",
                "cortado_date": "2024-10-16",
                "csv_generated": 0,
                "payment_id": null
            }
        ],
        "invoices_sunat": []
    }
}
                    

Get invoice and client

This endpoint provides invoice and client details using invoice number

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.
invoiceNumber number URL Required Invoice number.

Response

                        
# Here is a curl example
curl \
-X GET http://smartispv7.test/api/SmartIPS-v1/getInvoiceCliente/{invoice_number} \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte'
                
# Result example :
{
    "estatus": "Pagada",
    "BillCustomer": {
        "id": 1,
        "num_bill": "2",
        "period": "2024-04-30",
        "release_date": "2024-04-02",
        "expiration_date": "2024-04-30",
        "iva": "15.00",
        "cost": "18.70",
        "total_pay": "21.51",
        "actual_total_pay": null,
        "status": "Pagada",
        "client_id": "Shiguango Esthela",
        "service_id": 1,
        "open": 0,
        "created_at": "2024-10-07",
        "updated_at": "2024-04-24",
        "note": null,
        "memo": null,
        "xero_id": null,
        "paid_on": "2024-04-23",
        "start_date": "2024-04-01",
        "use_transactions": "0",
        "billing_type": "recurring",
        "recurring_invoice": "no",
        "cortado_date": "2024-04-16",
        "csv_generated": 0,
        "payment_id": null
    },
    "Client": {
        "id": 1,
        "name": "Shiguango Esthela",
        "email": "jaque@gmail.com",
        "phone": "94590848688",
        "address": "Sector Jandiacu",
        "coordinates": null,
        "photo": "",
        "dni": "2100492590",
        "dv": null,
        "custom_token_nuvai": null,
        "created_at": "2024-04-02 19:00:15",
        "updated_at": null,
        "balance": "-351.51",
        "odb_id": null,
        "onu_id": null,
        "port": null,
        "onusn": null,
        "zona_id": null,
        "merchant_registration": null,
        "adjustable_amount": "0.00",
        "id_punto_emision": null,
        "wallet_balance": 0,
        "map_marker_icon": null,
        "odb_geo_json": null,
        "odb_geo_json_styles": null,
        "subscriber_no": "0001",
        "electronic_invoice": "No"
    }
}
                    

Get Unpaid Invoice

This endpoint provides unpaid invoice with user, service and plan details for a user using user id

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.
userId number URL Required User ID.

Response

                        
# Here is a curl example
curl \
-X GET http://smartispv7.test/api/SmartIPS-v1/InvoiceClientStatus3/{userId} \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte'
                
                        
# Result example :
{
    "invoices": [
        {
            "id": 0,
            "num_bill": "3112",
            "period": "2024-04-21",
            "release_date": "2024-03-21",
            "expiration_date": "2024-03-21",
            "iva": "0.00",
            "cost": "0.00",
            "total_pay": "330.00",
            "actual_total_pay": null,
            "status": "No pagado",
            "client_id": 1,
            "service_id": null,
            "open": 0,
            "created_at": "2024-10-11",
            "updated_at": "2024-10-11",
            "note": "sqws",
            "memo": "sqws",
            "xero_id": null,
            "paid_on": null,
            "start_date": "2024-03-21",
            "use_transactions": "0",
            "billing_type": "none",
            "recurring_invoice": "no",
            "cortado_date": "2024-10-27",
            "csv_generated": 0,
            "payment_id": null,
            "client": {
                "id": 1,
                "name": "Shiguango Esthela",
                "email": "jaquego@gmail.com",
                "phone": "993453408",
                "address": "Sector Jandi 10",
                "coordinates": null,
                "photo": "",
                "dni": "2100454590",
                "dv": null,
                "custom_token_nuvai": null,
                "created_at": "2024-04-02 19:00:15",
                "updated_at": null,
                "balance": "-351.51",
                "odb_id": null,
                "onu_id": null,
                "port": null,
                "onusn": null,
                "zona_id": null,
                "merchant_registration": null,
                "adjustable_amount": "0.00",
                "id_punto_emision": null,
                "wallet_balance": 0,
                "map_marker_icon": null,
                "odb_geo_json": null,
                "odb_geo_json_styles": null,
                "subscriber_no": "0001",
                "electronic_invoice": "No"
            },
            "service": null
        },
        {
            "id": 4585,
            "num_bill": "4624",
            "period": "2024-10-31",
            "release_date": "2024-10-01",
            "expiration_date": "2024-10-31",
            "iva": "15.00",
            "cost": "18.70",
            "total_pay": "21.51",
            "actual_total_pay": null,
            "status": "No pagado",
            "client_id": 1,
            "service_id": 1,
            "open": 0,
            "created_at": "2024-10-07",
            "updated_at": "2024-10-01",
            "note": null,
            "memo": null,
            "xero_id": null,
            "paid_on": null,
            "start_date": "2024-10-01",
            "use_transactions": "0",
            "billing_type": null,
            "recurring_invoice": "no",
            "cortado_date": "2024-10-16",
            "csv_generated": 0,
            "payment_id": null,
            "client": {
                "id": 1,
                "name": "Shiguango Esthela",
                "email": "jaquego@gmail.com",
                "phone": "993453408",
                "address": "Sector Jandi 10",
                "coordinates": null,
                "photo": "",
                "dni": "2100454590",
                "dv": null,
                "custom_token_nuvai": null,
                "created_at": "2024-04-02 19:00:15",
                "updated_at": null,
                "balance": "-351.51",
                "odb_id": null,
                "onu_id": null,
                "port": null,
                "onusn": null,
                "zona_id": null,
                "merchant_registration": null,
                "adjustable_amount": "0.00",
                "id_punto_emision": null,
                "wallet_balance": 0,
                "map_marker_icon": null,
                "odb_geo_json": null,
                "odb_geo_json_styles": null,
                "subscriber_no": "0001",
                "electronic_invoice": "No"
            },
            "service": {
                "id": 1,
                "client_id": 1,
                "ip": "172.16.24.200",
                "mac": "00:00:00:00:00:00",
                "date_in": "2024-04-01",
                "plan_id": 1,
                "router_id": 1,
                "status": "ac",
                "user_hot": "2100492590",
                "pass_hot": "Iu8laQXSAMyHQFlzaPnUbpQMvI0T1aflYS5IMYSisoikdXc+B/D0XK51VaNZoDo1jt6l9YPzbHP4hAexuYnnNA==",
                "typeauth": null,
                "onmikrotik": 1,
                "created_at": "2024-04-02",
                "updated_at": "2024-10-06",
                "billing_type": "recurring",
                "online": "on",
                "tree_priority": 0,
                "manually_cortado": 0,
                "smartolt_sn": null,
                "geo_json": null,
                "geo_json_styles": null,
                "send_invoice": 0,
                "ipv6": "",
                "ipv6_delegated": "",
                "plan": {
                    "id": 1,
                    "name": "Plan Hogar 50M",
                    "download": 51200,
                    "upload": 51200,
                    "num_clients": 0,
                    "cost": "18.70",
                    "iva": "15.00",
                    "burst_limit": 0,
                    "burst_threshold": 0,
                    "burst_time": 0,
                    "priority": 5,
                    "limitat": 100,
                    "aggregation": 1,
                    "title": null,
                    "no_rules": 0,
                    "address_list_name": null
                }
            }
        }
    ],
    "numero_de_factura_no_pagadas": 2
}
                    

Get Paid Invoice

This endpoint provides paid invoice with user, service and plan details for a user using user id

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.
userId number URL Required User ID.

Response

                        
# Here is a curl example
curl \
-X GET http://smartispv7.test/api/SmartIPS-v1/InvoiceClientStatus1/{userId} \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte'
                
# Result example :
{
    "invoices": [
        {
            "id": 1,
            "num_bill": "2",
            "period": "2024-04-30",
            "release_date": "2024-04-02",
            "expiration_date": "2024-04-30",
            "iva": "15.00",
            "cost": "18.70",
            "total_pay": "21.51",
            "actual_total_pay": null,
            "status": "Pagada",
            "client_id": 1,
            "service_id": 1,
            "open": 0,
            "created_at": "2024-10-07",
            "updated_at": "2024-04-24",
            "note": null,
            "memo": null,
            "xero_id": null,
            "paid_on": "2024-04-23",
            "start_date": "2024-04-01",
            "use_transactions": "0",
            "billing_type": "recurring",
            "recurring_invoice": "no",
            "cortado_date": "2024-04-16",
            "csv_generated": 0,
            "payment_id": null,
            "client": {
                "id": 1,
                "name": "Shiguango Esthela",
                "email": "jaquego@gmail.com",
                "phone": "993453408",
                "address": "Sector Jandi 10",
                "coordinates": null,
                "photo": "",
                "dni": "2100454590",
                "dv": null,
                "custom_token_nuvai": null,
                "created_at": "2024-04-02 19:00:15",
                "updated_at": null,
                "balance": "-351.51",
                "odb_id": null,
                "onu_id": null,
                "port": null,
                "onusn": null,
                "zona_id": null,
                "merchant_registration": null,
                "adjustable_amount": "0.00",
                "id_punto_emision": null,
                "wallet_balance": 0,
                "map_marker_icon": null,
                "odb_geo_json": null,
                "odb_geo_json_styles": null,
                "subscriber_no": "0001",
                "electronic_invoice": "No"
            },
            "service": {
                "id": 1,
                "client_id": 1,
                "ip": "172.16.24.200",
                "mac": "00:00:00:00:00:00",
                "date_in": "2024-04-01",
                "plan_id": 1,
                "router_id": 1,
                "status": "ac",
                "user_hot": "2100492590",
                "pass_hot": "Iu8laQXSAMyHQFlzaPnUbpQMvI0T1aflYS5IMYSisoikdXc+B/D0XK51VaNZoDo1jt6l9YPzbHP4hAexuYnnNA==",
                "typeauth": null,
                "onmikrotik": 1,
                "created_at": "2024-04-02",
                "updated_at": "2024-10-06",
                "billing_type": "recurring",
                "online": "on",
                "tree_priority": 0,
                "manually_cortado": 0,
                "smartolt_sn": null,
                "geo_json": null,
                "geo_json_styles": null,
                "send_invoice": 0,
                "ipv6": "",
                "ipv6_delegated": "",
                "plan": {
                    "id": 1,
                    "name": "Plan Hogar 50M",
                    "download": 51200,
                    "upload": 51200,
                    "num_clients": 0,
                    "cost": "18.70",
                    "iva": "15.00",
                    "burst_limit": 0,
                    "burst_threshold": 0,
                    "burst_time": 0,
                    "priority": 5,
                    "limitat": 100,
                    "aggregation": 1,
                    "title": null,
                    "no_rules": 0,
                    "address_list_name": null
                }
            }
        },
        {
            "id": 761,
            "num_bill": "774",
            "period": "2024-05-31",
            "release_date": "2024-05-01",
            "expiration_date": "2024-05-31",
            "iva": "15.00",
            "cost": "18.70",
            "total_pay": "21.51",
            "actual_total_pay": null,
            "status": "Pagada",
            "client_id": 1,
            "service_id": null,
            "open": 0,
            "created_at": "2024-10-07",
            "updated_at": "2024-05-16",
            "note": null,
            "memo": null,
            "xero_id": null,
            "paid_on": "2024-05-15",
            "start_date": "2024-05-01",
            "use_transactions": "0",
            "billing_type": null,
            "recurring_invoice": "no",
            "cortado_date": "2024-05-16",
            "csv_generated": 0,
            "payment_id": null,
            "client": {
                "id": 1,
                "name": "Shiguango Esthela",
                "email": "jaquego@gmail.com",
                "phone": "993453408",
                "address": "Sector Jandi 10",
                "coordinates": null,
                "photo": "",
                "dni": "2100454590",
                "dv": null,
                "custom_token_nuvai": null,
                "created_at": "2024-04-02 19:00:15",
                "updated_at": null,
                "balance": "-351.51",
                "odb_id": null,
                "onu_id": null,
                "port": null,
                "onusn": null,
                "zona_id": null,
                "merchant_registration": null,
                "adjustable_amount": "0.00",
                "id_punto_emision": null,
                "wallet_balance": 0,
                "map_marker_icon": null,
                "odb_geo_json": null,
                "odb_geo_json_styles": null,
                "subscriber_no": "0001",
                "electronic_invoice": "No"
            },
            "service": null
        },
        {
            "id": 1523,
            "num_bill": "1549",
            "period": "2024-06-30",
            "release_date": "2024-06-01",
            "expiration_date": "2024-06-30",
            "iva": "15.00",
            "cost": "18.70",
            "total_pay": "21.51",
            "actual_total_pay": null,
            "status": "Pagada",
            "client_id": 1,
            "service_id": null,
            "open": 0,
            "created_at": "2024-10-07",
            "updated_at": "2024-07-03",
            "note": null,
            "memo": null,
            "xero_id": null,
            "paid_on": "2024-07-02",
            "start_date": "2024-06-01",
            "use_transactions": "0",
            "billing_type": null,
            "recurring_invoice": "no",
            "cortado_date": "2024-06-16",
            "csv_generated": 0,
            "payment_id": null,
            "client": {
                "id": 1,
                "name": "Shiguango Esthela",
                "email": "jaquego@gmail.com",
                "phone": "993453408",
                "address": "Sector Jandi 10",
                "coordinates": null,
                "photo": "",
                "dni": "2100454590",
                "dv": null,
                "custom_token_nuvai": null,
                "created_at": "2024-04-02 19:00:15",
                "updated_at": null,
                "balance": "-351.51",
                "odb_id": null,
                "onu_id": null,
                "port": null,
                "onusn": null,
                "zona_id": null,
                "merchant_registration": null,
                "adjustable_amount": "0.00",
                "id_punto_emision": null,
                "wallet_balance": 0,
                "map_marker_icon": null,
                "odb_geo_json": null,
                "odb_geo_json_styles": null,
                "subscriber_no": "0001",
                "electronic_invoice": "No"
            },
            "service": null
        },
        {
            "id": 2251,
            "num_bill": "2286",
            "period": "2024-07-31",
            "release_date": "2024-07-01",
            "expiration_date": "2024-07-31",
            "iva": "15.00",
            "cost": "18.70",
            "total_pay": "21.51",
            "actual_total_pay": null,
            "status": "Pagada",
            "client_id": 1,
            "service_id": null,
            "open": 0,
            "created_at": "2024-10-07",
            "updated_at": "2024-07-31",
            "note": null,
            "memo": null,
            "xero_id": null,
            "paid_on": "2024-07-26",
            "start_date": "2024-07-01",
            "use_transactions": "0",
            "billing_type": null,
            "recurring_invoice": "no",
            "cortado_date": "2024-07-16",
            "csv_generated": 0,
            "payment_id": null,
            "client": {
                "id": 1,
                "name": "Shiguango Esthela",
                "email": "jaquego@gmail.com",
                "phone": "993453408",
                "address": "Sector Jandi 10",
                "coordinates": null,
                "photo": "",
                "dni": "2100454590",
                "dv": null,
                "custom_token_nuvai": null,
                "created_at": "2024-04-02 19:00:15",
                "updated_at": null,
                "balance": "-351.51",
                "odb_id": null,
                "onu_id": null,
                "port": null,
                "onusn": null,
                "zona_id": null,
                "merchant_registration": null,
                "adjustable_amount": "0.00",
                "id_punto_emision": null,
                "wallet_balance": 0,
                "map_marker_icon": null,
                "odb_geo_json": null,
                "odb_geo_json_styles": null,
                "subscriber_no": "0001",
                "electronic_invoice": "No"
            },
            "service": null
        },
        {
            "id": 2982,
            "num_bill": "3021",
            "period": "2024-08-31",
            "release_date": "2024-08-01",
            "expiration_date": "2024-08-31",
            "iva": "15.00",
            "cost": "18.70",
            "total_pay": "21.51",
            "actual_total_pay": null,
            "status": "Pagada",
            "client_id": 1,
            "service_id": null,
            "open": 0,
            "created_at": "2024-10-07",
            "updated_at": "2024-08-17",
            "note": null,
            "memo": null,
            "xero_id": null,
            "paid_on": "2024-08-16",
            "start_date": "2024-08-01",
            "use_transactions": "0",
            "billing_type": null,
            "recurring_invoice": "no",
            "cortado_date": "2024-08-16",
            "csv_generated": 0,
            "payment_id": null,
            "client": {
                "id": 1,
                "name": "Shiguango Esthela",
                "email": "jaquego@gmail.com",
                "phone": "993453408",
                "address": "Sector Jandi 10",
                "coordinates": null,
                "photo": "",
                "dni": "2100454590",
                "dv": null,
                "custom_token_nuvai": null,
                "created_at": "2024-04-02 19:00:15",
                "updated_at": null,
                "balance": "-351.51",
                "odb_id": null,
                "onu_id": null,
                "port": null,
                "onusn": null,
                "zona_id": null,
                "merchant_registration": null,
                "adjustable_amount": "0.00",
                "id_punto_emision": null,
                "wallet_balance": 0,
                "map_marker_icon": null,
                "odb_geo_json": null,
                "odb_geo_json_styles": null,
                "subscriber_no": "0001",
                "electronic_invoice": "No"
            },
            "service": null
        },
        {
            "id": 3712,
            "num_bill": "3751",
            "period": "2024-09-30",
            "release_date": "2024-09-01",
            "expiration_date": "2024-09-30",
            "iva": "15.00",
            "cost": "18.70",
            "total_pay": "21.51",
            "actual_total_pay": null,
            "status": "Pagada",
            "client_id": 1,
            "service_id": null,
            "open": 0,
            "created_at": "2024-10-07",
            "updated_at": "2024-09-18",
            "note": null,
            "memo": null,
            "xero_id": null,
            "paid_on": "2024-09-18",
            "start_date": "2024-09-01",
            "use_transactions": "0",
            "billing_type": null,
            "recurring_invoice": "no",
            "cortado_date": "2024-09-16",
            "csv_generated": 0,
            "payment_id": null,
            "client": {
                "id": 1,
                "name": "Shiguango Esthela",
                "email": "jaquego@gmail.com",
                "phone": "993453408",
                "address": "Sector Jandi 10",
                "coordinates": null,
                "photo": "",
                "dni": "2100454590",
                "dv": null,
                "custom_token_nuvai": null,
                "created_at": "2024-04-02 19:00:15",
                "updated_at": null,
                "balance": "-351.51",
                "odb_id": null,
                "onu_id": null,
                "port": null,
                "onusn": null,
                "zona_id": null,
                "merchant_registration": null,
                "adjustable_amount": "0.00",
                "id_punto_emision": null,
                "wallet_balance": 0,
                "map_marker_icon": null,
                "odb_geo_json": null,
                "odb_geo_json_styles": null,
                "subscriber_no": "0001",
                "electronic_invoice": "No"
            },
            "service": null
        }
    ],
    "numero_de_factura_pagadas": 6
}
                    

Create Invoice

This endpoint is used to create invoice for a user.

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.
description Array Body Required ["item1" , "item2"]
userID Number URL Required User ID
invoice_billing_type string Body Required none
invoice_date date Body Required 03/21/2024
invoice_memo string Body Required Any caption that you need to add
invoice_pay_date date Body Required 03/21/2024
iva Array Body Required ["10" , "10"]
period_from Array Body Required ["2024-03-21", "2024-03-21"]
period_to Array Body Required ["2024-03-21", "2024-03-21"]
pos Array Body Required ["1" , "2"]
price Array Body Required ["100" , "200"]
quantity Array Body Required ["1","1"]
total Array Body Required ["110" , "220"]
unit Array Body Required ["1" ,"1"]

Response

                        
# Here is a curl example
curl \
-X POST http://smartispv7.test/api/SmartIPS-v1/CreateInvoice/{userId} \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte'
                
# Result example :
{
    "success": true,
    "mesnage": "Factura creada exitosamente",
    "num_bill": 5196,
    "id_invoice": 5196
}
                    

Pay Invoice

This endpoint is used to pay invoice for a user.

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.
way_to_pay string Body Required Efectivo
date Date Body Required 03/20/2024 format
amount integer/float Body Required 21.51
id_pago string Body Required unique payment information
commentary string Body Required Any caption that you need to add
invoice_id Number Body Required 5156
payByWallet Boolean Body Required true or false

Response

                        
# Here is a curl example
curl \
-X POST http://smartispv7.test/api/SmartIPS-v1/pagar_factura \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte'
                
# Result example :
{
    "success": true,
    "mesnage": "factura pagada"
}
                    

Delete Invoice Payment

This endpoint is used to remove payment of paid invoice using invoice id .

Request

Parameter Type Position # Description
Authorization string Header Required This is the app key generated in smartisp app. This key you can find from Config / SmartISP API. Ths key authenticate your request.
invoiceId string URL Required invoice id given in invoice

Response

                        
# Here is a curl example
curl \
-X POST http://smartispv7.test/api/SmartIPS-v1/DeleteIvoicePay/{invoiceID} \
-H 'X-Authorization=87pqQe3ux3UU3vi8dUUTQIxl7DzN5ORrEjhLN2siPOy2EU0hqQABiYNu0erte'
                
# Result example :
{
    "success": true,
    "mensage": "Se a liminado la factura con ID 5156"
}