REST API endpoints for Discord Entitlements (monetization).
Entitlements represent a user or guild's access to a specific SKU (purchases, subscriptions, gifts).
Summary
Functions
Marks a consumable entitlement as consumed.
Creates a test entitlement for development/testing.
Deletes a test entitlement.
Gets a specific entitlement by ID.
Lists entitlements for the current application.
Functions
Marks a consumable entitlement as consumed.
Only valid for one-time purchase consumable SKUs.
Examples
:ok = EDA.API.Entitlement.consume("entitlement_id")
Creates a test entitlement for development/testing.
Options
:sku_id(required) — the SKU to grant:owner_id(required) — the user or guild ID to grant to:owner_type(required) —1for guild,2for user
Examples
{:ok, entitlement} = EDA.API.Entitlement.create_test(%{
sku_id: "sku_id",
owner_id: "user_id",
owner_type: 2
})
Deletes a test entitlement.
Examples
:ok = EDA.API.Entitlement.delete_test("entitlement_id")
Gets a specific entitlement by ID.
Examples
{:ok, entitlement} = EDA.API.Entitlement.get("entitlement_id")
Lists entitlements for the current application.
Options
:user_id— filter by user:guild_id— filter by guild:sku_ids— comma-separated SKU IDs to filter:before— pagination cursor (snowflake):after— pagination cursor (snowflake):limit— max results (1-100, default 100):exclude_ended— exclude ended entitlements (boolean):exclude_deleted— exclude deleted entitlements (boolean)
Examples
{:ok, entitlements} = EDA.API.Entitlement.list()
{:ok, entitlements} = EDA.API.Entitlement.list(user_id: "123", exclude_ended: true)