Issue a service token
POST
/auth/token
const url = 'https://apisandbox.puurk.com/auth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"client_id":"example","client_secret":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://apisandbox.puurk.com/auth/token \ --header 'Content-Type: application/json' \ --data '{ "client_id": "example", "client_secret": "example" }'Exchange API client credentials for a short-lived Bearer JWT (1 hour). Provide credentials via Basic Auth header or JSON body.
Request Bodyrequired
Section titled “Request Bodyrequired”API client credentials
Media typeapplication/json
object
client_id
required
API client ID
string
client_secret
required
API client secret
string
Examplegenerated
{ "client_id": "example", "client_secret": "example"}Responses
Section titled “Responses”Token issued successfully
Media typeapplication/json
object
access_token
JWT Bearer token
string
token_type
Token type (always Bearer)
string
expires_in
Token lifetime in seconds
integer
scopes
Scopes granted to this token
Array<object>
object
resource
Resource the scope applies to (e.g. checkout)
string
oid
Organization ID (null for all organizations)
string
public
Marks a publishable (browser) scope. Only honored on a checkout scope bound to one organization, on a client with allowed_origins.
boolean
actions
Permitted actions
Array<string>
Example
{ "token_type": "Bearer", "expires_in": 3600, "scopes": [ { "actions": [ "read" ] } ]}Invalid credentials
Media typeapplication/json
object
error
Error code
string
message
Human-readable error message
string
Example
{ "error": "invalid_client"}Rate limit exceeded
Media typeapplication/json
object
error
Error code
string
message
Human-readable error message
string
Example
{ "error": "invalid_client"}