/buy, get a personal checkout link, pay, and receive the product automatically via DM or role grant. Your bot owns the UX; Shoppex owns the commerce.
Why this works well
No storefront UI needed
The whole buyer journey is inside Discord — slash commands, ephemeral replies, and DMs. No website required.
Native fit for digital resellers
Gaming keys, Discord Nitro-style passes, cheat subscriptions, bot licenses — the primary audience already lives in Discord.
Flow
- The user runs
/buy. - Your bot creates a payment through the Dev API.
- The bot replies with a private checkout link.
- The buyer pays in hosted checkout.
- Shoppex sends your webhook.
- Your bot or worker grants the role or sends the key.
Shape
| Piece | Responsibility |
|---|---|
| Discord bot | Slash commands, DM delivery, role grants, user-to-order mapping |
| Your webhook endpoint | Verify signature, look up the Discord user from customer_email or custom_fields, grant role or DM the license |
| Shoppex | Catalog, payment session creation, license pool, webhook emission |
Key API calls
order:paid, read custom_fields from the payload, look up the Discord user, and deliver:
- For a license pool (
SERIALSproduct), the key is already in the webhook payload. - For a role grant, call Discord’s
PUT /guilds/{guild.id}/members/{user.id}/roles/{role.id}. - For a recurring pass, subscribe to
subscription:renewed/subscription:cancelledand adjust role state.
Use
custom_fields to carry the Discord user ID and guild ID all the way through to the webhook. That way your fulfillment handler does not need a separate lookup.Pitfalls
- Ephemeral reply only — never post the checkout link to a public channel, or another user can pay on the buyer’s behalf.
- Guild rate limits — role grants share Discord’s per-guild bucket. Queue role grants in a worker rather than granting synchronously from the webhook handler.
- Rejoin logic — when a user with an active subscription rejoins the server, re-grant the role. Listen for
GUILD_MEMBER_ADDand check your DB.
Related
Architecture Reference
Setup A (pure backend webhook worker) fits best.
Licenses API
For license-pool products,
/dev/v1/licenses covers validation and HWID resets.