Incentives APIs
Click an API to expand/collapse it.
- Description
- Sets multiple incentives to a set of applications.
- Request Endpoint
- PUT https://<Example api server address>/admin/set/incentives/application
- Parameters
-
None.
- cURL syntax
-
curl --include \
--request PUT \
--header "Content-Type: application/json" \
--data-binary "{
\"applicationIds\" : [\"8c68054f-4963-47bc-b40d-ff7b69d9d280\", \"9sge054f-4963-47bc-b40d-ff7b69d9d280\"],
\"incentiveIds\" : [\"c7e0299e-07d5-4878-a7bf-dd390e1d6867\", \"af0b9c14-1579-4936-ad58-d8120cfe58f5\"]
}" \
'https://core.dev.Example.net/api/admin/set/incentives/application'
- PUT body attributes (JSON)
-
Attribute |
Type |
Use |
Description |
applicationIds |
Array |
Required |
An array of application ids to which incentives should be set. |
incentiveIds |
Array |
Required |
An array of incentive ids to set to an application. |
- PUT body
-
Headers: Content-Type: application/json
{
"applicationIds": [
"8c68054f-4963-47bc-b40d-ff7b69d9d280",
"9sge054f-4963-47bc-b40d-ff7b69d9d280"
],
"incentiveIds": [
"c7e0299e-07d5-4878-a7bf-dd390e1d6867",
"af0b9c14-1579-4936-ad58-d8120cfe58f5"
]
}
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": [
"8c68054f-4963-47bc-b40d-ff7b69d9d280",
"9sge054f-4963-47bc-b40d-ff7b69d9d280"
],
"detail": null,
"error": false,
"message": "Setting incentives to application successful."
}
Return to top
- Description
- Enables an Admin to create a new incentive.
- Request Endpoint
- POST https://<Example api server address>/admin/incentive
- Parameters
-
None.
- cURL syntax
-
curl --include \
--request POST \
--header "Content-Type: application/json" \
--data-binary "{
\"title\" : \"20$ for a deposit\",
\"type\" : \"FIXED\",
\"amount\" : 20,
\"expired\" : false,
\"limit\" : 100,
\"validTill\" : 1465391392
}" \
'https://core.dev.Example.net/api/admin/incentive'
- POST body attributes (JSON)
-
Attribute |
Type |
Use |
Description |
title |
String |
Required |
Unique title for an incentive. |
type |
String |
Required |
It can be "FIXED" or "PERCENT". |
amount |
Number |
Required |
Amount for the incentive. |
limit |
Number |
Optional |
Limit amount for the incentive. |
expired |
Boolean |
Optional |
Incentive has expired or not. |
validTill |
String |
Optional |
Date till which the incentive is valid. |
- POST body
-
Headers: Content-Type: application/json
{
"title": "20$ for a deposit",
"type": "FIXED",
"amount": 20,
"expired": false,
"limit": 100,
"validTill": 1465391392
}
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"id": "c7e0299e-07d5-4878-a7bf-dd390e1d6867",
"updatedBy": "",
"title": "20$ for a deposit",
"type": "FIXED",
"amount": 20,
"limit": 100,
"expired": false,
"validTill": 1465391392
},
"detail": null,
"error": false,
"message": "Creating incentive successful."
}
Return to top
- Description
- Deletes an existing incentive.
- Request Endpoint
- DELETE https://<Example api server address>/admin/incentive/{id}
- Parameters
-
Parameter |
Type |
Use |
Description |
id |
String |
Required |
UUID of an incentive. |
- cURL syntax
-
curl --include \
--request DELETE \
'https://core.dev.Example.net/api/admin/incentive/id'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": true,
"detail": null,
"error": false,
"message": "Deleting an incentive successful."
}
Return to top
- Description
- Fetches all incentives.
- Request Endpoint
- GET https://<Example api server address>/admin/incentives
- Parameters
-
None.
- cURL syntax
-
curl --include \
'https://core.dev.Example.net/api/admin/incentives'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": [
{
"id": "90064c1a-d9d1-4d87-af65-c84b0565676c",
"updatedBy": "",
"title": "30$ for a deposit",
"type": "FIXED",
"amount": 30,
"limit": 100,
"expired": false,
"validTill": 1465391392
}
],
"detail": null,
"error": false,
"message": "Fetching all incentives successful."
}
Return to top
- Description
- Fetches all incentives of an application.
- Request Endpoint
- GET https://<Example api server address>/application/{id}/incentives
- Parameters
-
Parameter |
Type |
Use |
Description |
id |
String |
Required |
UUID of an application. |
- cURL syntax
-
curl --include \
'https://core.dev.Example.net/api/application/id/incentives'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": [
{
"id": "af0b9c14-1579-4936-ad58-d8120cfe58f5",
"title": "10$ for a deposit",
"type": "PERCENT",
"amount": 10,
"limit": null,
"expired": false,
"validTill": null
}
],
"detail": null,
"error": false,
"message": "Fetching incentives of an application successful."
}
Return to top
- Description
- Updates an existing incentive.
- Request Endpoint
- PUT https://<Example api server address>/admin/incentive/{id}
- Parameters
-
Parameter |
Type |
Use |
Description |
id |
String |
Required |
UUID of an incentive. |
- cURL syntax
-
curl --include \
--request PUT \
--header "Content-Type: application/json" \
--data-binary "{
\"title\" : \"20$ for a deposit\",
\"type\" : \"FIXED\",
\"amount\" : 25,
\"expired\" : false,
\"limit\" : 50,
\"validTill\" : 1465391392
}" \
'https://core.dev.Example.net/api/admin/incentive/id'
- PUT body attributes (JSON)
-
Attribute |
Type |
Use |
Description |
title |
String |
Required |
Unique title for an incentive. |
type |
String |
Required |
It can be "FIXED" or "PERCENT". |
amount |
Number |
Required |
Amount for the incentive. |
limit |
Number |
Optional |
Limit amount for the incentive. |
expired |
Boolean |
Optional |
Incentive has expired or not. |
validTill |
String |
Optional |
Date till which the incentive is valid. |
- PUT body
-
Headers: Content-Type: application/json
{
"title": "20$ for a deposit",
"type": "FIXED",
"amount": 25,
"expired": false,
"limit": 50,
"validTill": 1465391392
}
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"id": "90064c1a-d9d1-4d87-af65-c84b0565676c",
"updatedBy": "",
"title": "30$ for a deposit",
"type": "FIXED",
"amount": 25,
"limit": 50,
"expired": false,
"validTill": 1465391392
},
"detail": null,
"error": false,
"message": "Updating an incentive successful."
}
Return to top
- Description
- Applies incentives to a deposit amount.
- Request Endpoint
- POST https://<Example api server address>/user/apply/incentives
- Parameters
-
None.
- cURL syntax
-
curl --include \
--request POST \
--header "Content-Type: application/json" \
--data-binary "{
\"userId\" : \"dc26a81a-c3c3-41eb-951c-e1a27fa4ba92\",
\"applicationId\" : \"8c68054f-4963-47bc-b40d-ff7b69d9d\",
\"incentiveIds\" : [\"c7e0299e-07d5-4878-a7bf-dd390e1d6867\"],
\"depositAmount\" : 50
}" \
'https://core.dev.Example.net/api/user/apply/incentive'
- POST body attributes (JSON)
-
Attribute |
Type |
Use |
Description |
userId |
String |
Required |
UUID of a user. |
applicationId |
String |
Required |
UUID of an application. |
incentiveIds |
Array |
Required |
UUID's of incentives. |
depositAmount |
Number |
Required |
Double value of the deposit amount. |
- POST body
-
Headers: Content-Type: application/json
{
"userId": "dc26a81a-c3c3-41eb-951c-e1a27fa4ba92",
"applicationId": "8c68054f-4963-47bc-b40d-ff7b69d9d",
"incentiveIds": [
"c7e0299e-07d5-4878-a7bf-dd390e1d6867"
],
"depositAmount": 50
}
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"depositAmount": 60,
"incentivesApplied": [
{
"incentiveApplied": false,
"incentiveId": "c7e0299e-07d5-4878-a7bf-dd390e1d6867",
"incentiveAmount": 10,
"message": Added incentive amount to deposit amount successfully."
}
]
},
"detail": null,
"error": false,
"message": "Applying incentives to deposit amount successful."
}
Return to top