diff --git a/packages/core/src/api/monetization.ts b/packages/core/src/api/monetization.ts index 7612b2cfec51..4c5c46803049 100644 --- a/packages/core/src/api/monetization.ts +++ b/packages/core/src/api/monetization.ts @@ -4,6 +4,7 @@ import { makeURLSearchParams, type RequestData, type REST } from '@discordjs/res import { Routes, type RESTGetAPIEntitlementsQuery, + type RESTGetAPIEntitlementResult, type RESTGetAPIEntitlementsResult, type RESTGetAPISKUsResult, type RESTGetAPISKUSubscriptionResult, @@ -84,6 +85,24 @@ export class MonetizationAPI { }) as Promise; } + /** + * Fetches an entitlement for an application. + * + * @see {@link https://discord.com/developers/docs/resources/entitlement#get-entitlement} + * @param applicationId - The application id to fetch the entitlement for + * @param entitlementId - The entitlement id to fetch + * @param options - The options for fetching the entitlement + */ + public async getEntitlement( + applicationId: Snowflake, + entitlementId: Snowflake, + { signal }: Pick = {}, + ) { + return this.rest.get(Routes.entitlement(applicationId, entitlementId), { + signal, + }) as Promise; + } + /** * Creates a test entitlement for an application's SKU. *