Skip to main content
POST
Exchange Authorization Code

Body

grant_type
enum<string>
required

Must be authorization_code when exchanging a code from /oauth/authorize, or refresh_token when rotating tokens.

Available options:
authorization_code,
refresh_token
Example:

"authorization_code"

client_id
string
required

Your OAuth application's Client ID (blnk_client_...).

Example:

"blnk_client_c35awnC5stJvE1aMvZYHMBpH"

client_secret
string

Your OAuth application's Client Secret (blnk_secret_...). Required unless using PKCE without a client secret.

Example:

"blnk_secret_Yje9xK2mPqL8vN4rT6wZ1aB3cD5eF7gH9iJ0kL"

code
string

The 5-minute single-use authorization code (blnk_code_...) received at your redirect_uri. Required when grant_type=authorization_code.

Example:

"blnk_code_9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c"

redirect_uri
string

The exact redirect_uri used during the /oauth/authorize request.

Example:

"https://partner.com/oauth/blink/callback"

code_verifier
string

Optional PKCE code verifier matching the code_challenge sent to /oauth/authorize.

refresh_token
string

The refresh token (blnk_rt_...) to rotate. Required when grant_type=refresh_token.

Response

Successfully issued or rotated OAuth access token.

access_token
string

The store-scoped Bearer token used to call /api/v1/* endpoints. Does not expire unless revoked or rotated.

Example:

"blnk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0"

token_type
string
Example:

"Bearer"

refresh_token
string

Refresh token (blnk_rt_...) that can be used with grant_type=refresh_token to rotate the access token.

Example:

"blnk_rt_z9y8x7w6v5u4t3s2r1q0p9o8n7m6l5k4j3i2h1g0"

scope
string

Space-separated list of granted scopes (or * for full store access).

Example:

"products:read orders:read webhooks:write"

store
object