Stakk

Partner connect

One-click connect for approved partner apps.

Partner connect (Connect Stakk) lets a merchant connect their Stakk shop to your app in one click. It is an OAuth 2.0 authorization code flow. Only apps that Stakk has approved can use it.

0. Apply for partner access

In the Stakk dashboard, open Settings → Developers → Partner apps and select Apply. The shop owner, or a manager who can manage API keys and webhooks, can apply. Tell Stakk:

Field
App name, website, contact emailWho you are. Merchants see the name and description when they connect
What the app doesOne or two sentences, shown on the consent screen
Redirect URIsUp to 5 exact URLs. https only; http://localhost works while testing, never in production
PermissionsThe scopes of the shop API key each connection gets. Full access (*) is not available
Webhook eventsThe events registered when you send webhook_url at token exchange

The application is In review until Stakk approves or rejects it. You can edit it until then; a rejection comes with a note. Once approved, the app shows its client_id. Select Generate client secret and copy it straight away: Stakk stores only a hash and never shows it again. Rotate issues a new secret and stops the old one at once. To change an approved app's redirect URIs or permissions, contact Stakk.

Stakk can suspend an app. A suspended app can't start new connections or exchange codes, and Stakk may also disconnect the shops connected to it.

1. Send the merchant to Stakk

https://stakk.cc/oauth/authorize?client_id=your-app&redirect_uri=https%3A%2F%2Fapp.example.com%2Fstakk%2Fcallback&response_type=code&state=RANDOM&code_challenge=CHALLENGE&code_challenge_method=S256
Parameter
client_idYour app id
redirect_uriExactly one of your registered redirect URIs
response_typecode
stateA random value. It comes back unchanged. Check it
code_challengeOptional PKCE challenge, S256 only. Recommended

The merchant signs in if needed, picks which of their shops to connect (when they have several), and approves. Only the shop owner, or a manager allowed to manage API keys and webhooks, can approve. Stakk redirects back with ?code=...&state=..., or ?error=access_denied&state=... when they cancel. An unknown or unapproved client_id, or an unregistered redirect_uri, is shown on Stakk and never redirected.

The code is valid for 10 minutes and works once.

2. Exchange the code

POST https://stakk.cc/oauth/token from your server. Authenticate with HTTP Basic (client_id:client_secret) or send both in the body. Form-encoded or JSON.

Field
grant_typeauthorization_code
codeThe code from the redirect
redirect_uriThe same redirect_uri as in step 1
code_verifierRequired when you sent a code_challenge
webhook_urlOptional. A public https URL. Stakk registers a signed webhook to it for your app's webhook events
{
  "access_token": "vnx_…",
  "token_type": "Bearer",
  "scope": "orders.read",
  "connection_id": "pcn_…",
  "shop": { "id": "…", "slug": "studio", "name": "Studio", "currency": "EUR" },
  "webhook": { "id": "…", "url": "https://api.bookr.example/stakk/webhook", "events": ["order:paid"], "secret": "whsec_…" }
}

Store access_token and webhook.secret. They are not shown again. The token does not expire. It is a shop API key named after your app, so the merchant can see and revoke it under Developers → API keys.

Use it as Authorization: Bearer on POST /checkout/{shopId}/payments and the Developer API. Verify webhook deliveries with webhook.secret as described in Webhooks.

Connecting the same shop again replaces the previous token and webhook. Sending a used code again fails and also revokes the token that code issued.

Disconnect

POST https://stakk.cc/oauth/revoke with client authentication and token. Stakk deletes the token and the webhook. The response is 200 {} whether or not the token was still live.

Errors

Errors use the OAuth shape { "error", "error_description" }.

errorStatusWhen
invalid_client401Unknown client_id, wrong secret, or the app is not approved (in review, rejected, suspended) or has no client secret yet
invalid_grant400Code unknown, used, expired, for another redirect_uri, or the PKCE verifier does not match. Also when the person who approved no longer manages the shop
invalid_request400Missing code, or webhook_url is not a public http(s) URL
unsupported_grant_type400grant_type is not authorization_code
slow_down429More than 30 requests a minute from one IP