You can use this API to subscribe.
POST /api/v1.0/subscribe
| Name | Type | Description | Required |
|---|---|---|---|
| clientID | string | The merchant app ID provided by the Nagorik | ✔️ |
| requestID | string | Merchant subscription request ID | ✔️ |
| start | date | Subscription start date. Format: 2020-04-04 (after 11:30 PM of a day, you cannot put today as start date) | ✔️ |
| end | date | Subscription end date. Format: 2020-10-04 (cannot be after 730 days) | ✔️ |
| userReturnURL | url | After transaction completion user will be redirect to this URL with the value of invoiceID as an URL query parameter. | ✔️ |
| cycle | string | Payment cycle (one of the following):DAILY,WEEKLY,FIFTEEN_DAYS | ✔️ |
| amount | string | amount | ✔️ |
Status: 200
{
"url": "https://intent.recurring.pay.bka.sh/intent/web/intent/PMKWYBH9",
"invoiceID": "nagorik2021-1195",
"errorCode": "00",
"errorMessage": "Operation Success"
}
curl -X POST http://api.example.com/auth/login \
--data '{
"username": "my-username",
"password": "my-password"
}'
You can use this API for subscription request status.
POST /api/v1.0/subscribe/{$invoiceId}/status
| Name | Type | Description | Required |
|---|---|---|---|
| invoiceId | string | It is the invoiceID, that you received in response to the Subscription Request API. | ✔️ |
Status: 200
{
"invoiceId": "nagorik2021-1195",
"status": "INITIALIZED",
"subscriptionId": "578371",
"createdAt": "2021-12-27 13:32:16",
"errorCode": "00",
"errorMessage": "Operation Success"
}
curl -X POST http://api.example.com/auth/login \
--data '{
"username": "my-username",
"password": "my-password"
}'
You can use this API for subscription details.
POST /api/v1.0/subscription/{$subscriptionId}
| Name | Type | Description | Required |
|---|---|---|---|
| subscriptionId | string | It is the subscriotionID , that you received in response to the Subscription Request Status API. | ✔️ |
Status: 200
{
"id": "578371",
"amount": 1,
"cycle": "WEEKLY",
"enabled": 0,
"createdDate": "2021-12-27T07:32:16.000000Z",
"startDate": "2022-01-01",
"endDate": "2022-02-01",
"nextPaymentDate": "2022-01-08 00:00:00",
"requestID": "test012qe2123e",
"errorCode": "00",
"errorMessage": "Operation Success"
}
curl -X POST http://api.example.com/auth/login \
--data '{
"username": "my-username",
"password": "my-password"
}'
You can use this API for subscription cancel.
POST api/v1.0/subscription/{subscriptionId}/cancel
| Name | Type | Description | Required |
|---|---|---|---|
| subscriptionId | string | It is the subscriotionID , that you received in response to the Subscription Request Status API. | ✔️ |
Status: 200
{
"id": 212,
"subscriptionID": "598857",
"requestID": 212,
"status": "PROCESSED",
"errorCode": "00",
"errorMessage": "Operation Success"
}
curl -X POST http://api.example.com/auth/login \
--data '{
"username": "my-username",
"password": "my-password"
}'
You can use this API for subscription cancel details.
POST api/v1.0/subscription/cancel/{subscriptionId}
| Name | Type | Description | Required |
|---|---|---|---|
| subscriptionId | string | It is the subscriptionID, that you received in response to the Subscription Request API. | ✔️ |
Status: 200
{
"id": 212,
"subscriptionID": "598857",
"requestID": 212,
"status": "PROCESSED",
"errorCode": "00",
"errorMessage": "Operation Success"
}
curl -X POST http://api.example.com/auth/login \
--data '{
"username": "my-username",
"password": "my-password"
}'
You can use this API for payment list.
POST api/v1.0/subscription/{subscriptionId}/payments
| Name | Type | Description | Required |
|---|---|---|---|
| subscriptionId | string | It is the subscriptionID, that you received in response to the Subscription Request API. | ✔️ |
Status: 200
{
"subscriptionPayments": [
{
"paymentId": 628342,
"cycle": "WEEKLY",
"dueDate": "2022-01-11",
"reverseTransactionAmount": null,
"reverseTransactionDate": null,
"reverseTransactionId": null,
"status": "SUCCEEDED_PAYMENT",
"subscriptionId": "598857",
"transactionDate": "2022-01-11 07:31:35",
"transactionId": "9AB8WMM0IE",
"nextPaymentDate": "2022-01-18"
}
],
"errorCode": "00",
"errorMessage": "Operation Success"
}
curl -X POST http://api.example.com/auth/login \
--data '{
"username": "my-username",
"password": "my-password"
}'
You can use this API for payment details.
POST api/v1.0/subscription/payment/{paymentId}
| Name | Type | Description | Required |
|---|---|---|---|
| paymentId | string | paymentId | ✔️ |
Status: 200
{
"paymentId": 628342,
"cycle": "WEEKLY",
"dueDate": "2022-01-11",
"reverseTransactionAmount": null,
"reverseTransactionDate": null,
"reverseTransactionId": null,
"status": "SUCCEEDED_PAYMENT",
"subscriptionId": "598857",
"transactionDate": "2022-01-11 07:31:35",
"transactionId": "9AB8WMM0IE",
"nextPaymentDate": "2022-01-18",
"errorCode": "00",
"errorMessage": "Operation Success"
}
curl -X POST http://api.example.com/auth/login \
--data '{
"username": "my-username",
"password": "my-password"
}'