Getting existing entitlements

Hi @kani

To get the existing entitlements for an account , try the following in your rule .
Get Native Identity .
Get Identity Id of this using this native identity with the help of Get All Account API EndPoint:

{{baseUrl}}/accounts?filters=nativeIdentity eq $plan.nativeIdentity

Now we have identity Id of the identity for which you need entitlements on a source .
Now to fetch entitlements on a source , let’s get account details of this identity on the source where entitlements belong to . Use the below end point to get Account Id of the identity on a source

{{baseUrl}}/accounts?filters=identityId eq "{identity_id}"&filters=sourceName eq "{Sourcename your entitlements belong to}"

From the above end point , you will be able to get account Id of the identity on the desired source . Now let’s get entitlements for this accounts using the following endpoint:

{{baseUrl}}/accounts/{AccountID}/entitlements

From the above endpoint , you will be able to see all the entitlements that the account holds on the source .

I hope this helps !

Thank you

3 Likes