adding paid features to accounts using API - Heyloyalty/api GitHub Wiki

You need a reseller account and access, to use this feature. It's meant to let you add "paid features" to an existing account, which you're the active reseller for, from your backend.

Example for Endpoints can be found below.

##List paid features currently available

GET /reseller/paidfeatures

Response: 200 OK JSON:


[
{
"name": "ThisIsAFeature",
"id": 1
},
{
"name": "ThisIsAnotherFeature",
"id": 8
}
]

##List paid features on account

GET /reseller/paidfeatures/account/{accountId}

Response: 200 OK JSON:


[
{
"id": 1,
"name": "AwesomeFeature1"
},
{
"id": 2,
"name": "AwesomeFeature2"
}
]

If given wrong featureId:

Errors:

400 Bad Request: "Invalid id specified"

##Assign paid feature to account

POST /reseller/paidfeatures/assign JSON Body:


{
"accountId": 1,
"featureId": 2
}

Response: 204 OK empty response

Errors:

400 Bad Request: "Invalid id specified"

400 Bad Request: "Invalid feature specified"

400 Bad Request: "Paid feature already connected to this account"

##Get accounts with a specific feature

GET reseller/paidfeatures/listAccounts/{featureId}


[
{
"name": "Heyloyalty account",
"id": 1
}
]

Errors:

400 Bad Request: "Invalid feature specified"

##Delete a feature from an account:

DELETE reseller/paidfeatures/{featureId}/{accountId}

Response 204 OK empty response

Errors:

400 Bad Request: "Invalid id specified"

400 Bad Request: "Invalid feature specified"

⚠️ **GitHub.com Fallback** ⚠️