latestOpenAPI 3.0.1Proprietary2026-08-1844131294.9 KB

59cd6443fdbf

OAuth

OAuth 2.0 Token Exchange

Implements RFC 8693 (OAuth 2.0 Token Exchange) with extensions.

Validates a partner access token and exchanges it for a JWT token. This implementation uses the requested_subject field (common extension to RFC 8693) to specify the platform user ID for whom the token is being requested.

Security considerations:

  • Uses HTTPS in production (enforced by infrastructure)
  • Validates partner access token
  • Generates cryptographically secure JWT tokens

Grant Type:

  • Only urn:ietf:params:oauth:grant-type:token-exchange grant type is supported

Authentication:

  • This endpoint does NOT require a bearer token
  • Authentication is performed using the subject_token in the request body
post/authenticate/partner/token-exchange

Request body

grant_type'urn:ietf:params:oauth:grant-type:token-exchange' required

OAuth 2.0 grant type (must be "urn:ietf:params:oauth:grant-type:token-exchange")

subject_tokenstring required

The partner access token to be exchanged

subject_token_type'urn:ietf:params:oauth:token-type:access_token' required

Token type (must be "urn:ietf:params:oauth:token-type:access_token")

requested_subjectstring required

The platform user ID for whom the token is being requested (extension field)

scope'ADMIN' | 'MANAGER' | 'PAYROLL_ADMIN' | 'BILLING_ADMIN' | 'HR_ADMIN' | 'IT_ADMIN'

User scope/role for access permissions

Example request

{
  "grant_type": "urn:ietf:params:oauth:grant-type:token-exchange",
  "subject_token": "partner_access_token_abc123",
  "subject_token_type": "urn:ietf:params:oauth:token-type:access_token",
  "requested_subject": "user_id_xyz789",
  "scope": "ADMIN"
}

Response

Token exchanged successfully

access_tokenstring required

The access token (JWT) to use for authenticated requests

token_type'Bearer' required

Token type (always "Bearer")

expires_ininteger required

Token expiration time in seconds

refresh_tokenstring

The refresh token (only included for token-exchange endpoint)

customer_user_idstring

The customer user ID (UUID). Included when a user was auto-provisioned.

Example response

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.refresh...",
  "customer_user_id": "759a086f-48b3-4e34-aefd-00c8a9e68523"
}