Tiers
Get tiers
For all of these queries you need the following permission:
tier:read
Get tiers
Our API allows you to fetch tiers as a collection using getTiers
in our SDKs or the tiers
query in GraphQL. In both cases this endpoint supports Pagination.
import { PlainClient } from '@team-plain/typescript-sdk';
const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });
const res = await client.getTiers({
first: 25,
});
if (res.error) {
console.error(res.error);
} else {
console.log(res.data);
}
Get tier by ID
If you know the tiers’s ID in Plain you can use this method to fetch the tier.
import { PlainClient } from '@team-plain/typescript-sdk';
const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });
const res = await client.getTierById({
tierId: 'tier_123',
});
if (res.error) {
console.error(res.error);
} else {
console.log(res.data);
}
Was this page helpful?