API v1.0.1
The generated tokens are valid only for 7 days and can be used for testing purposes only.
After the trial is over, please contact the administration for a production token.
Get Information
Through this api you will get the details of the customer and related services e.g. TV, Internet, IPTV etc.
Test CUID
You can use test cuid 1000001, 1000002, 1000003, 1000004 and 1000005.
https://selfcare.happy.com.np/staging/api/third-party/v1.0.1/get-customer-information |
---|
Attribute | Mandatory | Description |
---|---|---|
code | Yes | Provide the customer's registered mobile no., customer id, stb no. or internet username. |
curl -X POST 'https://selfcare.happy.com.np/staging/api/third-party/v1.0.1/get-customer-information' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3d3dy50aW1lc3Byby5uZXQvIiwiaWF0IjoxNjIyNzQyNzA4LCJleHAiOjE2MjUzMzQ3MDgsIm5iZiI6MTYyMjc0MjcwOCwianRpIjoiYW05Zk5uXzVMNjVSelVuZGJDIiwic3ViIjoxMDAxLCJwcnYiOiIwYTViZ2M5NmE5OTBkM2YxNjAxZjBiODM3Y2I0YzRhZWZoZThiNDUyIiwiZW52IjoidGVzdCJ9.zr8gZ8FVKbUM327-cdrFRAJnOcI9aZxX72o1B9CaskI' \
--data '{"code":"{code}"}'
{
"success": true,
"code": "400aa010",
"body": {
"customer": {
"cuid": "1000000",
"first_name": "rajesh",
"last_name": "lamichhane",
"status": "active"
"connections": {
"tv": [
{
"stb": "1001067100",
"status": "active"
},
{
"stb": "242b422df433w42",
"status": "inactive"
}
],
"internet": [
{
"username": "rajesh-lamichhane",
"status": "active"
}
],
"iptv": []
}
}
}
}
Get Package
Choose customer service (tv, internet or iptv) from above Get Information API and pass it for the package information. Here you will get checkoutId for topup activity.
https://selfcare.happy.com.np/staging/api/third-party/v1.0.1/get-subscription-package |
---|
Attribute | Mandatory | Description |
---|---|---|
cuid | Yes | The Customer ID field. |
service | Yes | Choose the service e.g. tv, internet or iptv. |
reqId | Yes | - Provide stb number if the service is tv - Provide username if the service is internet |
curl -X POST 'https://selfcare.happy.com.np/staging/api/third-party/v1.0.1/get-subscription-package' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3d3dy50aW1lc3Byby5uZXQvIiwiaWF0IjoxNjIyNzQyNzA4LCJleHAiOjE2MjUzMzQ3MDgsIm5iZiI6MTYyMjc0MjcwOCwianRpIjoiYW05Zk5uXzVMNjVSelVuZGJDIiwic3ViIjoxMDAxLCJwcnYiOiIwYTViZ2M5NmE5OTBkM2YxNjAxZjBiODM3Y2I0YzRhZWZoZThiNDUyIiwiZW52IjoidGVzdCJ9.zr8gZ8FVKbUM327-cdrFRAJnOcI9aZxX72o1B9CaskI' \
--data '{"cuid":"{cuid}","service":"{service}","reqId":"{reqId}"}'
{
"success": true,
"code": "400aa010",
"body": {
"checkoutId": "AHf2lUAduUJRFYVmrQp66581",
"customer": {
"cuid": "1000000",
"first_name": "rajesh",
"last_name": "lamichhane",
"status": "active"
},
"internet": {
"connection": {
"username": "rajesh-lamichhane",
"status": "active"
},
"subscriptions": [
{
"code": "130",
"name": "10Mbps Monthly - Nepalgunj",
"startdate": "2021-06-03 02:09:53",
"enddate": "2021-06-05 02:09:53"
}
],
"bouquets": [
{
"code": "132",
"name": "10Mbps Half Yearly - Nepalgunj (HALF YEARLY)",
"price": 7451
},
{
"code": "130",
"name": "10Mbps Monthly - Nepalgunj (MONTHLY)",
"price": 1355
},
{
"code": "131",
"name": "10Mbps Quarterly - Nepalgunj (QUARTERLY)",
"price": 3894
},
{
"code": "134",
"name": "10Mbps Yearly - renew- Nepalgu (YEARLY)",
"price": 11000
},
{
"code": "137",
"name": "15Mbps Half Yearly - Nepalgunj (HALF YEARLY)",
"price": 7909
},
.
..
...
]
}
}
}
{
"success": true,
"code": "400aa010",
"body": {
"checkoutId": "AHf2lUAduUJRFYVmrQp66581",
"customer": {
"cuid": "1000000",
"first_name": "rajesh",
"last_name": "lamichhane",
"status": "active"
},
"tv": {
"connection": {
"stb": "1001067100",
"status": "active"
},
"subscriptions": [
{
"code": "140",
"name": "SKY HD+ Monthly",
"startdate": "2021-06-03 02:09:53",
"enddate": "2021-06-05 02:09:53"
}
],
"bouquets": [
{
"code": "140",
"name": "SKY HD+ Monthly (MONTHLY)",
"price": 550
},
{
"code": "141",
"name": "SKY HD+ Yearly (YEARLY)",
"price": 11000
},
{
"code": "392",
"name": "FIFA WORLD CUP 2022 (MONTHLY) [AddOn]",
"price": 565
},
.
..
...
]
}
}
}
Topup
Through this api you will get the details of the customer and related services e.g. TV, Internet, IPTV etc.
https://selfcare.happy.com.np/staging/api/third-party/v1.0.1/subscription-package-topup |
---|
Attribute | Mandatory | Description |
---|---|---|
cuid | Yes | The Customer ID field. |
service | Yes | Choose the service e.g. tv, internet or iptv. |
reqId | Yes | Provide the customer's stb no. or internet username according to service. |
checkoutId | Yes | The Checkout ID is topup activity token. It's unique and valid for 5 minutes only. |
bouquetId | Yes | The Bouquet ID field, Choose bouquet code for the Get Package API. |
amt | Yes | The selected bouquet price value. |
udf1 | No | - Optional value eg. order id, reference no., txn id etc. - Max length 30. |
udf2 | No | - Optional value eg. order id, reference no., txn id etc. - Max length 30. |
curl -X POST 'https://selfcare.happy.com.np/staging/api/third-party/v1.0.1/subscription-package-topup' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3d3dy50aW1lc3Byby5uZXQvIiwiaWF0IjoxNjIyNzQyNzA4LCJleHAiOjE2MjUzMzQ3MDgsIm5iZiI6MTYyMjc0MjcwOCwianRpIjoiYW05Zk5uXzVMNjVSelVuZGJDIiwic3ViIjoxMDAxLCJwcnYiOiIwYTViZ2M5NmE5OTBkM2YxNjAxZjBiODM3Y2I0YzRhZWZoZThiNDUyIiwiZW52IjoidGVzdCJ9.zr8gZ8FVKbUM327-cdrFRAJnOcI9aZxX72o1B9CaskI' \
--data '{"cuid":"{cuid}", "service":"{service}", "reqId":"{reqId}", "checkoutId":"{checkoutId}", "bouquetId":"{bouquetId}", "amt":"{amt}"}'
{
"success": true,
"code": "400ab001",
"body": {
"result": {
"orderId": "AHf2lUAduUJRFYVmrQp66581",
"txnId": "N112Q0N9cIFTosjN3E56",
"cuid": "1000000",
"reqId": "rajesh-lamichhane",
"bouquetId": "134",
"amt": 11000,
"txnDate": "2021-01-01 16:08:51",
"status": "success",
"service": "internet"
}
}
}
{
"success": true,
"code": "400ab001",
"body": {
"result": {
"orderId": "AHf2lUAduUJRFYVmrQp34oPL",
"txnId": "N112Q0N9cIFTosjN3E56",
"cuid": "1000000",
"reqId": "5001067801",
"bouquetId": "391",
"amt": 590,
"txnDate": "2021-01-01 16:19:51",
"status": "success",
"service": "tv"
}
}
}
Txn Status
This API gets the transaction status corresponding to requested OrderId (Checkout ID) for specific service eg. tv, internet, iptv etc..
Note
The Txn Status API needs to be called after the Topup API to verify the transaction.
https://selfcare.happy.com.np/staging/api/third-party/v1.0.1/txn-status |
---|
Attribute | Mandatory | Description |
---|---|---|
checkoutId | Yes | Use the token (Checkout ID / Order ID) that was used at the time of topup. |
curl -X POST 'https://selfcare.happy.com.np/staging/api/third-party/v1.0.1/txn-status' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3d3dy50aW1lc3Byby5uZXQvIiwiaWF0IjoxNjIyNzQyNzA4LCJleHAiOjE2MjUzMzQ3MDgsIm5iZiI6MTYyMjc0MjcwOCwianRpIjoiYW05Zk5uXzVMNjVSelVuZGJDIiwic3ViIjoxMDAxLCJwcnYiOiIwYTViZ2M5NmE5OTBkM2YxNjAxZjBiODM3Y2I0YzRhZWZoZThiNDUyIiwiZW52IjoidGVzdCJ9.zr8gZ8FVKbUM327-cdrFRAJnOcI9aZxX72o1B9CaskI' \
--data '{"checkoutId":"{checkoutId}"}'
{
"success": true,
"code": "400ab001",
"body": {
"result": {
"orderId": "AHf2lUAduUJRFYVmrQp66581",
"txnId": "N112Q0N9cIFTosjN3E56",
"cuid": "1000000",
"reqId": "rajesh-lamichhane",
"bouquetId": "134",
"amt": 11000,
"txnDate": "2021-01-01 16:08:51",
"status": "success",
"service": "internet"
}
}
}
Changelog v1.0.1
December 21, 2022
- Added Digital TV services.
- Added optional fields
udf1
andudf2
to the Topup API. - The name of the attribute changed from
connection
toconnections
in the Get Information API response. - The name of the attribute changed from
amt
toprice
in the Get Package API bouquets list response. - Minor bug fixed.
Added
Changed
Fixed