Skip to main content
GET
/
api
/
loyalty
/
accounts
/
{id}
/
rank
JavaScript
import SnagSolutions from '@snagsolutions/sdk';

const client = new SnagSolutions({
  apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});

const response = await client.loyalty.accounts.retrieveRank(
  '123e4567-e89b-12d3-a456-426614174333',
  {
    loyaltyCurrencyId: '123e4567-e89b-12d3-a456-426614174333',
    organizationId: '123e4567-e89b-12d3-a456-426614174333',
    websiteId: '123e4567-e89b-12d3-a456-426614174333',
  },
);

console.log(response.rank);
{
  "rank": 1
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string<uuid>
required

UUID of the account

Example:

"123e4567-e89b-12d3-a456-426614174333"

Query Parameters

websiteId
string<uuid>
required

UUID of the website

Example:

"123e4567-e89b-12d3-a456-426614174333"

organizationId
string<uuid>
required

UUID of the organization

Example:

"123e4567-e89b-12d3-a456-426614174333"

loyaltyCurrencyId
string<uuid>
required

UUID of the loyalty currency

Example:

"123e4567-e89b-12d3-a456-426614174333"

Response

200

Schema for a get account rank response

rank
number | null
required

Rank of the user. null means the user has no amount. This api can only return the rank upto 5000, after that it will return "5000+"

Example:

1