Skip to content
Sections

API reference

OAuth2

Every call carries a Bearer token. Get one from POST /oauth/token with your client ID and secret; it lasts 15 minutes, so cache it and ask again when it is about to run out.

Introspect a token (RFC 7662)

post/oauth/introspect

A client may introspect its own tokens; a partner those of its accounts' clients. Anything else is active: false.

Called by
Client ID and secret

Request body · application/x-www-form-urlencoded

  • client_idstring

    With client_secret_post; otherwise use HTTP Basic.

  • client_secretstring
  • tokenstringrequired
  • token_type_hintstring

Responses

200Token state.Show
  • account_idstring
  • activebooleanrequired
  • aud(string | array of string)
    One of these shapes

    string

    array of string

  • client_idstring
  • expinteger
  • iatinteger
  • issstring
  • jtistring
  • kindstring

    One of partner, account, supplier

  • scopestring
  • substring
  • token_typestring
  • 400Bad request, unsupported grant or scope.
  • 401Client authentication failed (invalid_client).
  • 429Too many token requests.
Request
curl -sS -X POST 'https://suppliers.presslane.ai/oauth/introspect' \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data 'token=string'
Response · 200
{
  "active": false
}
Try it in the sandbox

Revoke a token (RFC 7009)

post/oauth/revoke

Always 200 for an authenticated caller, whether or not the token was valid.

Called by
Client ID and secret

Request body · application/x-www-form-urlencoded

  • client_idstring

    With client_secret_post; otherwise use HTTP Basic.

  • client_secretstring
  • tokenstringrequired
  • token_type_hintstring

Responses

200Revoked (or nothing to do).
  • 400Bad request, unsupported grant or scope.
  • 401Client authentication failed (invalid_client).
  • 429Too many token requests.
Request
curl -sS -X POST 'https://suppliers.presslane.ai/oauth/revoke' \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data 'token=string'
Try it in the sandbox

Get an access token (client credentials)

post/oauth/token

Authenticate with HTTP Basic (client_secret_basic) or client_id and client_secret in the body (client_secret_post). The token is a JWT valid for 15 minutes; there is no refresh token, ask again.

Called by
Client ID and secret

Request body · application/x-www-form-urlencoded

  • client_idstring

    With client_secret_post; otherwise use HTTP Basic.

  • client_secretstring
  • grant_typestringrequired

    Always client_credentials

  • scopestring

    Space-separated; up to those granted. One of: accounts:write, accounts:read, catalogue:read, stock:read, links:write, links:read, webhooks:write, usage:read, inventory:write, orders:write, orders:read.

Responses

200A token.Show
  • access_tokenstringrequired
  • expires_inintegerrequired

    e.g. 900

  • sandboxboolean

    Only present, and true, for a sandbox account: its orders are only ever recorded as tests (see Sandbox accounts in the docs).

    Always true

  • scopestringrequired

    e.g. catalogue:read stock:read links:write

  • token_typestringrequired

    Always Bearer

  • 400Bad request, unsupported grant or scope.
  • 401Client authentication failed (invalid_client).
  • 429Too many token requests.
Request
curl -sS -X POST 'https://suppliers.presslane.ai/oauth/token' \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data 'grant_type=client_credentials'
Response · 200
{
  "access_token": "string",
  "expires_in": 900,
  "scope": "catalogue:read stock:read links:write",
  "token_type": "Bearer"
}
Try it in the sandbox