Digital Entitlements (Emoji + Private Channel Access)
Ledgerline can automatically grant Discord digital perks when a customer's payment is confirmed. In addition to Discord role grants (which have always been supported via Granted Role IDs), you can now attach emoji access and private channel access to any product.
How It Works
When a payment is confirmed the entitlement pipeline runs in two steps:
- Generate — one entitlement record is created per descriptor in the product's
grantedEntitlementslist (or per entry in the legacyGranted Role IDsfield). - Process — each
PENDINGrecord is fulfilled via a Discord REST call and markedGRANTEDorFAILED.
On refund (full or partial) the pipeline issues the matching revoke calls and marks each record
REVOKED.
Entitlement Types
| Type | What it does | Discord API used |
|---|---|---|
| role | Grants a Discord guild role | PUT /guilds/{guildId}/members/{userId}/roles/{roleId} |
| emoji | Same mechanism as role — emoji access is locked to a role; labeled "Custom Emoji Access" in admin | PUT /guilds/{guildId}/members/{userId}/roles/{roleId} |
| channel_access | Grants VIEW_CHANNEL + SEND_MESSAGES on a specific private channel via a per-user permission override | PUT /channels/{channelId}/permissions/{userId} |
Configuring a Product
- Open Products in the admin sidebar and click the product you want to configure (or create a new one).
- Scroll to the Granted Entitlements field.
- Add one row per perk:
| Sub-field | Value |
|---|---|
| Type | role, emoji, or channel_access |
| Target ID | Discord role ID (for role or emoji) or Discord channel ID (for channel_access) |
| Label (optional) | Human-readable name shown in admin UI, e.g. "Resurrected Role" |
- Click Save.
Backward compatibility: The legacy Granted Role IDs array field still works and is treated as a list of
role-type entitlements at fulfilment time. You do not need to migrate existing products unless you want to add emoji or channel access.
Sample Product Configuration
A "Resurrected Member" product might look like this:
{
"name": "Resurrected Member",
"sku": "RES-001",
"priceCents": 4999,
"grantedEntitlements": [
{ "type": "role", "targetId": "1234567890123456789", "label": "Resurrected Role" },
{ "type": "emoji", "targetId": "9876543210987654321", "label": "Custom Emoji Access" },
{ "type": "channel_access", "targetId": "1111222233334444555", "label": "Resurrected Members Only" }
]
}
After payment is confirmed the customer receives:
- The Resurrected Role (unlocks the emoji server-side).
- A per-user permission override on the private channel granting VIEW + SEND.
On full refund, all three are revoked automatically.
Viewing Entitlement Records
Open Entitlements in the admin sidebar (under Users & Identity). Use the Type filter to
narrow by DISCORD_ROLE, DISCORD_EMOJI, CHANNEL_ACCESS, or DIGITAL_ITEM. The Target ID
column shows the Discord role or channel ID for each record.
Records in FAILED state can be retried by clicking Edit / Retry and saving.
Required Bot Permissions
| Entitlement type | Required bot permission |
|---|---|
role / emoji | Manage Roles (the bot's highest role must be above the role being granted) |
channel_access | Manage Channels or Manage Permissions on the target channel |