Skip to main content
All routes require:
The caller must be able to access that store. A key with store scope SELECTED must include that store. Access mode FULL skips the scope list and still requires dashboard permission configureStorefront. Access mode RESTRICTED must include the scope on the route and that same permission. discord:write also satisfies discord:read.
PUT calls the same handler as PATCH. clientSecret and botToken are never returned. The response uses hasClientSecret and hasBotToken.

Discord settings

GET, PATCH, and PUT return this object. PATCH and PUT also fill applicationSync. GET sets applicationSync to null. When no integration is saved, configured and enabled are false, the id fields are null, both arrays are empty, showCheckoutLink is true, and inviteUrl is null. The three URL fields are still set.
string
Store record id.
boolean
true when an integration row exists.
boolean
Stored flag. A successful PATCH or PUT saves enabled as true.
string | null
Discord application client id, or null.
boolean
true when a client secret is stored.
boolean
true when a bot token is stored.
string | null
Discord application id, or null.
string | null
Discord application public key, or null.
string[]
Guild ids the bot is in.
string[]
Discord user snowflakes allowed to manage the bot.
string | null
Role snowflake given to customers, or null.
string | null
Discord invite URL shown to customers, or null.
Whether checkout shows the Discord link.
string | null
ISO time of the last command sync, or null.
string
{storePublicUrl}/discord/callback
{storePublicUrl}/discord/link/callback
string
{dashboardUrl}/api/discord/interactions
string | null
Bot invite URL when clientId and a bot token are both stored. Otherwise null.
object | null
null on GET. On PATCH and PUT, the result of pushing the application description, OAuth redirects, and (on a public HTTPS dashboard) the interactions endpoint to Discord.
inviteUrl uses that path when a client id and bot token are stored. The query is client_id, permissions (default 268437504), response_type=code, scope bot applications.commands, redirect_uri (the store redirectUri), and state.

Get Discord settings

Scope: discord:read. No body and no query parameters.
string
required
Store record id.

Update Discord settings

Scope: discord:write. JSON object. The path storeId is the store that is saved. A storeId property in the body is discarded. Client id, client secret, and bot token must all be present after the save, using stored values for any secret you omit. Saving sets enabled to true. Omit clientSecret or botToken to keep the stored secret. A string of only • characters keeps it as well. The bot token is checked with Discord. The client id must match the application id or that application’s bot user id. Guild ids are refreshed from Discord when that call succeeds, and commands are synced per guild.
string
required
Store record id.
string
Discord client id, trimmed, 5–64 characters.
string
Client secret, trimmed, 1–256 characters.
string
Bot token, trimmed, 1–256 characters.
boolean
Accepted on the body. The stored integration is saved with enabled true.
string[]
Up to 50 snowflakes. Each snowflake is 5–32 digits. Replaces the stored list when sent.
string | null
Role snowflake, or null to clear it.
string | null
Discord invite URL, max 500 characters, or null. An empty string clears it. The host must be discord.gg, discord.com, discordapp.com, or a host ending in .discord.com.
Checkout Discord link. Omitted values keep the stored flag, or true when nothing is stored yet.
400 messages from this handler: Zod messages are joined with ; .

Errors

Failed responses use { "success": false, "error": "...", "code": "..." }. A 500 also includes errorId.