Exchange authorization code for API keys
Exchanges the one-time authorization code (received in the callback redirect) for the merchant’s API key pair. Call this from your server — never from a browser.
Authentication: client_id and client_secret in the request body.
Your client_secret is issued when your application is approved. Store
it securely server-side and never expose it client-side.
The code is single-use and expires after 10 minutes. Attempting to exchange an already-used or expired code returns an error.
Store sk and signing_secret — both are returned only once. The
sk authenticates every request you make for that merchant. The
signing_secret signs the writes that require a signature (creating and
updating orders, initializing payments): set X-Timestamp to the current
Unix time and X-Signature to the base64 HMAC-SHA256 of
{timestamp}.{requestBody}. Neither value can be retrieved later.
Rate limit: 10 requests/minute per IP address.
Security: Always verify that the state value in the callback
matches what you sent before calling this endpoint.
Body
The one-time authorization code from the callback ?code= parameter.
"abc123def456ghi789jkl012mno345pq"
Your application's client identifier.
"fantastic-storefront"
Your application's client secret. Never send this from a browser.
"YOUR_CLIENT_SECRET"
Must exactly match the redirect URI used in the original authorization request.
"https://yourapp.com/callback"
Response
Code exchanged successfully — store the sk securely server-side
Secret key. Store this securely server-side — it will not be shown again. Use it for all server-side API calls on behalf of the merchant.
"tybrite_sk_live_..."
Publishable key. Safe to use client-side (browser/mobile). Use it for read-only catalog and cart operations.
"tybrite_pk_live_..."
Unique identifier for this key pair. Store it — required to call POST /v1/connect/revoke.
"550e8400-e29b-41d4-a716-446655440000"
The UUID of the store the merchant authorized access to.
"660f9511-f30c-52e5-b827-557766551111"
Environment the key pair is scoped to.
sandbox, production "production"
The permission scopes granted by the merchant.
Your application's client identifier.
"fantastic-storefront"
Request-signing secret for THIS connection. Store it securely server-side alongside the
secret key — it will not be shown again. Use it to sign write requests that require a
signature (creating/updating orders, initializing payments): set X-Timestamp to the
current Unix time and X-Signature to the HMAC-SHA256 of {timestamp}.{request_body}
using this secret. Scoped to this connection, so it can be rotated or revoked
independently of any other integration.
"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
Present only if your application registered a webhook URL. When it did, connecting a merchant
automatically creates a signed webhook subscription for their store — you do not need to call
createWebhookEndpoint yourself. The subscription starts receiving events immediately.
Verify each inbound event POST with webhook_endpoint.signing_secret (this is a different
secret from signing_secret above: signing_secret signs YOUR outbound write requests, while
webhook_endpoint.signing_secret verifies Galactic Core's inbound event POSTs to you). The
secret is returned only once, here.

