Create party session token

View as Markdown
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: 1. API token authenticates the request 2. Party ID and party type are provided in the request 3. System validates the party exists and belongs to the API token's root entity 4. 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_idstringRequiredformat: "uuid"

UUID of the party (payee or payer) to create a token for. This will be used as the user identifier in the token.

party_typeenumRequired

Type of party - either ‘payee’ or ‘payer’

Response

Successful Response
tokenstring
JWT token to be used for further requests
expires_in_secondsinteger
Number of seconds until this token expires
scopeslist of strings
Permission scopes granted to this token