66 type RESTGetAPIEntitlementsQuery ,
77 type RESTGetAPIEntitlementsResult ,
88 type RESTGetAPISKUsResult ,
9+ type RESTGetAPISKUSubscriptionResult ,
10+ type RESTGetAPISKUSubscriptionsQuery ,
11+ type RESTGetAPISKUSubscriptionsResult ,
912 type RESTPostAPIEntitlementJSONBody ,
1013 type RESTPostAPIEntitlementResult ,
1114 type Snowflake ,
@@ -17,17 +20,55 @@ export class MonetizationAPI {
1720 /**
1821 * Fetches the SKUs for an application.
1922 *
20- * @see {@link https://discord.com/developers/docs/monetization/skus#list-skus }
23+ * @see {@link https://discord.com/developers/docs/resources/sku#list-skus }
24+ * @param applicationId - The application id to fetch SKUs for
2125 * @param options - The options for fetching the SKUs.
2226 */
2327 public async getSKUs ( applicationId : Snowflake , { signal } : Pick < RequestData , 'signal' > = { } ) {
2428 return this . rest . get ( Routes . skus ( applicationId ) , { signal } ) as Promise < RESTGetAPISKUsResult > ;
2529 }
2630
31+ /**
32+ * Fetches subscriptions for an SKU.
33+ *
34+ * @see {@link https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions }
35+ * @param skuId - The SKU id to fetch subscriptions for
36+ * @param query - The query options for fetching subscriptions
37+ * @param options - The options for fetching subscriptions
38+ */
39+ public async getSKUSubscriptions (
40+ skuId : Snowflake ,
41+ query : RESTGetAPISKUSubscriptionsQuery ,
42+ { signal } : Pick < RequestData , 'signal' > = { } ,
43+ ) {
44+ return this . rest . get ( Routes . skuSubscriptions ( skuId ) , {
45+ signal,
46+ query : makeURLSearchParams ( query ) ,
47+ } ) as Promise < RESTGetAPISKUSubscriptionsResult > ;
48+ }
49+
50+ /**
51+ * Fetches a subscription for an SKU.
52+ *
53+ * @see {@link https://discord.com/developers/docs/resources/subscription#get-sku-subscription }
54+ * @param skuId - The SKU id to fetch subscription for
55+ * @param subscriptionId - The subscription id to fetch
56+ * @param options - The options for fetching the subscription
57+ */
58+ public async getSKUSubscription (
59+ skuId : Snowflake ,
60+ subscriptionId : Snowflake ,
61+ { signal } : Pick < RequestData , 'signal' > = { } ,
62+ ) {
63+ return this . rest . get ( Routes . skuSubscription ( skuId , subscriptionId ) , {
64+ signal,
65+ } ) as Promise < RESTGetAPISKUSubscriptionResult > ;
66+ }
67+
2768 /**
2869 * Fetches the entitlements for an application.
2970 *
30- * @see {@link https://discord.com/developers/docs/monetization/entitlements #list-entitlements }
71+ * @see {@link https://discord.com/developers/docs/resources/entitlement #list-entitlements }
3172 * @param applicationId - The application id to fetch entitlements for
3273 * @param query - The query options for fetching entitlements
3374 * @param options - The options for fetching entitlements
@@ -46,7 +87,7 @@ export class MonetizationAPI {
4687 /**
4788 * Creates a test entitlement for an application's SKU.
4889 *
49- * @see {@link https://discord.com/developers/docs/monetization/entitlements #create-test-entitlement }
90+ * @see {@link https://discord.com/developers/docs/resources/entitlement #create-test-entitlement }
5091 * @param applicationId - The application id to create the entitlement for
5192 * @param body - The data for creating the entitlement
5293 * @param options - The options for creating the entitlement
@@ -65,7 +106,7 @@ export class MonetizationAPI {
65106 /**
66107 * Deletes a test entitlement for an application's SKU.
67108 *
68- * @see {@link https://discord.com/developers/docs/monetization/entitlements #delete-test-entitlement }
109+ * @see {@link https://discord.com/developers/docs/resources/entitlement #delete-test-entitlement }
69110 * @param applicationId - The application id to delete the entitlement for
70111 * @param entitlementId - The entitlement id to delete
71112 * @param options - The options for deleting the entitlement
@@ -81,7 +122,7 @@ export class MonetizationAPI {
81122 /**
82123 * Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
83124 *
84- * @see {@link https://discord.com/developers/docs/monetization/entitlements #consume-an-entitlement }
125+ * @see {@link https://discord.com/developers/docs/resources/entitlement #consume-an-entitlement }
85126 * @param applicationId - The application id to consume the entitlement for
86127 * @param entitlementId - The entitlement id to consume
87128 * @param options - The options for consuming the entitlement
0 commit comments