Skip to main content
POST
Exchange authorization code for API keys

Body

application/json
code
string
required

The one-time authorization code from the callback ?code= parameter.

Example:

"abc123def456ghi789jkl012mno345pq"

client_id
string
required

Your application's client identifier.

Example:

"fantastic-storefront"

client_secret
string
required

Your application's client secret. Never send this from a browser.

Example:

"YOUR_CLIENT_SECRET"

redirect_uri
string<uri>
required

Must exactly match the redirect URI used in the original authorization request.

Example:

"https://yourapp.com/callback"

Response

Code exchanged successfully — store the sk securely server-side

sk
string
required

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.

Example:

"tybrite_sk_live_..."

pk
string
required

Publishable key. Safe to use client-side (browser/mobile). Use it for read-only catalog and cart operations.

Example:

"tybrite_pk_live_..."

pair_id
string<uuid>
required

Unique identifier for this key pair. Store it — required to call POST /v1/connect/revoke.

Example:

"550e8400-e29b-41d4-a716-446655440000"

store_id
string<uuid>
required

The UUID of the store the merchant authorized access to.

Example:

"660f9511-f30c-52e5-b827-557766551111"

environment
enum<string>
required

Environment the key pair is scoped to.

Available options:
sandbox,
production
Example:

"production"

scopes
string[]
required

The permission scopes granted by the merchant.

Example:
client_id
string
required

Your application's client identifier.

Example:

"fantastic-storefront"

signing_secret
string | null

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.

Example:

"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"

webhook_endpoint
object

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.

Example: