Skip to main content
GET
Exchange access code

Overview

Exchange an authorization code for a JWT API key. This is the final step in the OAuth2 flow, converting the temporary code into a permanent access token.
This endpoint requires the X-OAuth2-Client-Secret header for authentication instead of the standard Authorization header.

Path Parameters

Headers

Server-Side Only: This request must be made from your backend server, never from client-side code. The client secret must remain confidential.

Response

The data field contains a JWT API key that you can use to make authenticated API requests.

Using the API Key

Include the JWT as a Bearer token in subsequent API requests:

Token Properties

The JWT API key:
  • Grants access only to the stores the user authorized
  • Has permissions limited to the scopes you requested and the user approved
  • Does not expire until the user revokes authorization
  • Is tied to the specific user and application

Error Responses

Complete Flow Example

Authorizations

Authorization
string
header
required

Your API key goes here

Path Parameters

appId
string<uuid>
required

The application ID.

code
string
required

The authorization code to exchange.

Response

The object was successfully returned.

Represents a default generic response for API endpoints.

success
boolean
required

Indicates whether the operation or response was successful.

message
string | null

A descriptive message providing additional context or information about the response.

code
string | null

The error code (if there was an error) to use when referencing the error

data
string | null

Represents the data associated with a response.

Last modified on July 31, 2026