Create party session token
Generate a session token for either payee or payer (party-based approach).
This is the new party endpoint that supports both payees and payers. It can be used instead of the separate legacy /api/session-tokens endpoint.
This endpoint can only be called with an API token context. It generates a short-lived JWT token with appropriate scopes based on the party type.
The process:
- API token authenticates the request
- Party ID and party type are provided in the request
- System validates the party exists and belongs to the API token’s root entity
- A session token is created with appropriate scopes based on party type
This allows frontend applications to make authenticated requests on behalf of a specific party.
Authentication
x-api-keystring
RootPay API key sent in the x-api-key header. Keys are environment-scoped: live_* for production, test_* for sandbox.
Request
This endpoint expects an object.
party_id
UUID of the party (payee or payer) to create a token for. This will be used as the user identifier in the token.
party_type
Type of party - either ‘payee’ or ‘payer’
Allowed values:
Response
Successful Response
token
JWT token to be used for further requests
expires_in_seconds
Number of seconds until this token expires
scopes
Permission scopes granted to this token