GET
/
api
/
loyalty
/
accounts
/
{id}
/
rank
import SnagSolutions from '@snagsolutions/sdk';

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

async function main() {
  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);
}

main();
{
  "rank": 1
}

Authorizations

X-API-KEY
string
header
required

Path Parameters

id
string
required

UUID of the account

Example:

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

Query Parameters

websiteId
string
required

UUID of the website

Example:

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

organizationId
string
required

UUID of the organization

Example:

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

loyaltyCurrencyId
string
required

UUID of the loyalty currency

Example:

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

Response

200
application/json
200

Schema for a get account rank response

rank
number | null
required

Rank of the user. null means the user has no amount.

Example:

1